diff options
author | Mon P Wang <wangmp@apple.com> | 2008-07-30 04:36:53 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-07-30 04:36:53 +0000 |
commit | ce3ac89e28b77bb0b3028cf78ba302c14dcac0cd (patch) | |
tree | 37ed9c9fbdaaa1209eb34379b2a0a06941b1c735 /include/llvm/Intrinsics.td | |
parent | 8e2fd03941800ee0405593e4ac8d249f12eea60a (diff) | |
download | external_llvm-ce3ac89e28b77bb0b3028cf78ba302c14dcac0cd.zip external_llvm-ce3ac89e28b77bb0b3028cf78ba302c14dcac0cd.tar.gz external_llvm-ce3ac89e28b77bb0b3028cf78ba302c14dcac0cd.tar.bz2 |
Added support for overloading intrinsics (atomics) based on pointers
to different address spaces. This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Intrinsics.td')
-rw-r--r-- | include/llvm/Intrinsics.td | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index aea92c9..f9cee62 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -64,6 +64,11 @@ class LLVMPointerType<LLVMType elty> LLVMType ElTy = elty; } +class LLVMAnyPointerType<LLVMType elty> + : LLVMType<iPTRAny>{ + LLVMType ElTy = elty; +} + class LLVMMatchType<int num> : LLVMType<OtherVT>{ int Number = num; @@ -84,6 +89,7 @@ def llvm_f128_ty : LLVMType<f128>; def llvm_ppcf128_ty : LLVMType<ppcf128>; def llvm_ptr_ty : LLVMPointerType<llvm_i8_ty>; // i8* def llvm_ptrptr_ty : LLVMPointerType<llvm_ptr_ty>; // i8** +def llvm_anyptr_ty : LLVMPointerType<llvm_i8_ty>; // (space)i8* def llvm_empty_ty : LLVMType<OtherVT>; // { } def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; // { }* @@ -271,62 +277,62 @@ def int_memory_barrier : Intrinsic<[llvm_void_ty, llvm_i1_ty, llvm_i1_ty, llvm_i1_ty, llvm_i1_ty, llvm_i1_ty], []>; def int_atomic_cmp_swap : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_val_compare_and_swap">; def int_atomic_load_add : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_add">; def int_atomic_swap : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_lock_test_and_set">; def int_atomic_load_sub : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_sub">; def int_atomic_load_and : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_and">; def int_atomic_load_or : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_or">; def int_atomic_load_xor : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_xor">; def int_atomic_load_nand : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_nand">; def int_atomic_load_min : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_min">; def int_atomic_load_max : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_max">; def int_atomic_load_umin : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_umin">; def int_atomic_load_umax : Intrinsic<[llvm_anyint_ty, - LLVMPointerType<LLVMMatchType<0>>, + LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>], [IntrWriteArgMem]>, GCCBuiltin<"__sync_fetch_and_umax">; |