diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2014-04-24 17:18:27 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2014-04-24 17:18:27 +0000 |
commit | 35f9e1aa4990a20245cb7c39eb01f9feffc97853 (patch) | |
tree | 12f8866fbe3cf355e19b2bce470cf22a4c9a33ea /include | |
parent | 2dbbd173946632d950715001330070d656858642 (diff) | |
download | llvm-35f9e1aa4990a20245cb7c39eb01f9feffc97853.tar.gz llvm-35f9e1aa4990a20245cb7c39eb01f9feffc97853.tar.bz2 llvm-35f9e1aa4990a20245cb7c39eb01f9feffc97853.tar.xz |
[X86] Add support for Read Time Stamp Counter x86 builtin intrinsics.
This patch:
- Adds two new X86 builtin intrinsics ('int_x86_rdtsc' and
'int_x86_rdtscp') as GCCBuiltin intrinsics;
- Teaches the backend how to lower the two new builtins;
- Introduces a common function to lower READCYCLECOUNTER dag nodes
and the two new rdtsc/rdtscp intrinsics;
- Improves (and extends) the existing x86 test 'rdtsc.ll'; now test 'rdtsc.ll'
correctly verifies that both READCYCLECOUNTER and the two new intrinsics
work fine for both 64bit and 32bit Subtargets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/IntrinsicsX86.td | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/IR/IntrinsicsX86.td b/include/llvm/IR/IntrinsicsX86.td index 8f64b5d8ee..e262687e91 100644 --- a/include/llvm/IR/IntrinsicsX86.td +++ b/include/llvm/IR/IntrinsicsX86.td @@ -18,6 +18,15 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". } //===----------------------------------------------------------------------===// +// Read Time Stamp Counter. +let TargetPrefix = "x86" in { + def int_x86_rdtsc : GCCBuiltin<"__builtin_ia32_rdtsc">, + Intrinsic<[llvm_i64_ty], [], []>; + def int_x86_rdtscp : GCCBuiltin<"__builtin_ia32_rdtscp">, + Intrinsic<[llvm_i64_ty], [llvm_ptr_ty], [IntrReadWriteArgMem]>; +} + +//===----------------------------------------------------------------------===// // 3DNow! let TargetPrefix = "x86" in { |