diff options
author | Michael Liao <michael.liao@intel.com> | 2012-11-10 05:17:46 +0000 |
---|---|---|
committer | Michael Liao <michael.liao@intel.com> | 2012-11-10 05:17:46 +0000 |
commit | 625a875f052027e770ad360a10096220d63143ae (patch) | |
tree | 6a3b83981907db0a08991009b28517573c2c6aed /clang/test/CodeGen/rtm-builtins.c | |
parent | 9fbda3953b0666e288156c54f5f6973e9dd4019e (diff) | |
download | bcm5719-llvm-625a875f052027e770ad360a10096220d63143ae.tar.gz bcm5719-llvm-625a875f052027e770ad360a10096220d63143ae.zip |
Add clang support of RTM from TSX
- New options '-mrtm'/'-mno-rtm' are added to enable/disable RTM feature
- Builtin macro '__RTM__' is defined if RTM feature is enabled
- RTM intrinsic header is added and introduces 3 new intrinsics, namely
'_xbegin', '_xend', and '_xabort'.
- 3 new builtins are added to keep compatible with gcc, namely
'__builtin_ia32_xbegin', '__builtin_ia32_xend', and '__builtin_ia32_xabort'.
- Test cases for pre-defined macro and new intrinsic codegen are added.
llvm-svn: 167665
Diffstat (limited to 'clang/test/CodeGen/rtm-builtins.c')
-rw-r--r-- | clang/test/CodeGen/rtm-builtins.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGen/rtm-builtins.c b/clang/test/CodeGen/rtm-builtins.c new file mode 100644 index 00000000000..c4939a9a3d9 --- /dev/null +++ b/clang/test/CodeGen/rtm-builtins.c @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +rtm -emit-llvm -o - | FileCheck %s + +// Don't include mm_malloc.h, it's system specific. +#define __MM_MALLOC_H + +#include <immintrin.h> + +unsigned int test_xbegin(void) { + // CHECK: i32 @llvm.x86.xbegin() + return _xbegin(); +} + +void +test_xend(void) { + // CHECK: void @llvm.x86.xend() + _xend(); +} + +void +test_xabort(void) { + // CHECK: void @llvm.x86.xabort(i8 2) + _xabort(2); +} |