aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-01 07:30:57 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-01 07:30:57 +0000
commitdc722d6516b01c93e936b4eb91ae7af5c5244187 (patch)
tree34e666b58bd37b31caccb1e4f6a50e5b1858a988 /include
parentded5ed873fa7cd85f0b9d7c677b81dddf9a61eaa (diff)
downloadexternal_llvm-dc722d6516b01c93e936b4eb91ae7af5c5244187.zip
external_llvm-dc722d6516b01c93e936b4eb91ae7af5c5244187.tar.gz
external_llvm-dc722d6516b01c93e936b4eb91ae7af5c5244187.tar.bz2
For PR1297:
Implement bswap, ctpop, ctlz, and cttz utilizing the new overloaded intrinsic feature of tblgen. By defining llvm_int_ty to have an ValueType of iAny, any intrinsic using that type becomes an overloaded intrinsic. This signals that a) any integer type could be used for that argument and b) the intrinsic needs a suffix to match each such argument for the actual intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Intrinsics.td25
1 files changed, 6 insertions, 19 deletions
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
index b0aca08..7b85d62 100644
--- a/include/llvm/Intrinsics.td
+++ b/include/llvm/Intrinsics.td
@@ -78,7 +78,8 @@ class LLVMEmptyStructType
}
def llvm_void_ty : LLVMType<isVoid, "Type::VoidTyID">;
-def llvm_bool_ty : LLVMIntegerType<i1, 1>;
+def llvm_int_ty : LLVMIntegerType<iAny, 0>;
+def llvm_i1_ty : LLVMIntegerType<i1 , 1>;
def llvm_i8_ty : LLVMIntegerType<i8 , 8>;
def llvm_i16_ty : LLVMIntegerType<i16, 16>;
def llvm_i32_ty : LLVMIntegerType<i32, 32>;
@@ -202,24 +203,10 @@ def int_siglongjmp : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_i32_ty]>;
// None of these intrinsics accesses memory at all.
let Properties = [IntrNoMem] in {
- def int_bswap_i16 : Intrinsic<[llvm_i16_ty, llvm_i16_ty]>;
- def int_bswap_i32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty]>;
- def int_bswap_i64 : Intrinsic<[llvm_i64_ty, llvm_i64_ty]>;
-
- def int_ctpop_i8 : Intrinsic<[llvm_i8_ty, llvm_i8_ty]>;
- def int_ctpop_i16 : Intrinsic<[llvm_i16_ty, llvm_i16_ty]>;
- def int_ctpop_i32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty]>;
- def int_ctpop_i64 : Intrinsic<[llvm_i64_ty, llvm_i64_ty]>;
-
- def int_ctlz_i8 : Intrinsic<[llvm_i8_ty, llvm_i8_ty]>;
- def int_ctlz_i16 : Intrinsic<[llvm_i16_ty, llvm_i16_ty]>;
- def int_ctlz_i32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty]>;
- def int_ctlz_i64 : Intrinsic<[llvm_i64_ty, llvm_i64_ty]>;
-
- def int_cttz_i8 : Intrinsic<[llvm_i8_ty, llvm_i8_ty]>;
- def int_cttz_i16 : Intrinsic<[llvm_i16_ty, llvm_i16_ty]>;
- def int_cttz_i32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty]>;
- def int_cttz_i64 : Intrinsic<[llvm_i64_ty, llvm_i64_ty]>;
+ def int_bswap: Intrinsic<[llvm_int_ty, llvm_int_ty]>;
+ def int_ctpop: Intrinsic<[llvm_i32_ty, llvm_int_ty]>;
+ def int_ctlz : Intrinsic<[llvm_i32_ty, llvm_int_ty]>;
+ def int_cttz : Intrinsic<[llvm_i32_ty, llvm_int_ty]>;
}
//===------------------------ Debugger Intrinsics -------------------------===//