[PATCH] D116325: [X86] Add missing CET intrinsics support
Freddy, Ye via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 3 19:41:10 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0bab74280570: [X86] Add missing CET intrinsics support (authored by FreddyYe).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116325/new/
https://reviews.llvm.org/D116325
Files:
clang/lib/Headers/cetintrin.h
clang/test/CodeGen/X86/cetintrin.c
Index: clang/test/CodeGen/X86/cetintrin.c
===================================================================
--- clang/test/CodeGen/X86/cetintrin.c
+++ clang/test/CodeGen/X86/cetintrin.c
@@ -37,6 +37,12 @@
return _rdsspd(a);
}
+unsigned int test_rdsspd_i32() {
+ // CHECK-LABEL: @test_rdsspd_i32
+ // CHECK: call i32 @llvm.x86.rdsspd(i32 %{{[a-z0-9.]+}})
+ return _rdsspd_i32();
+}
+
#ifdef __x86_64__
unsigned long long test_rdsspq(unsigned long long a) {
// X86_64-LABEL: @test_rdsspq
@@ -44,6 +50,12 @@
return _rdsspq(a);
}
+unsigned long long test_rdsspq_i64() {
+ // X86_64-LABEL: @test_rdsspq_i64
+ // X86_64: call i64 @llvm.x86.rdsspq(i64 %{{[a-z0-9.]+}})
+ return _rdsspq_i64();
+}
+
unsigned long long test_get_ssp(void) {
// X86_64-LABEL: @test_get_ssp
// X86_64: call i64 @llvm.x86.rdsspq(i64 0)
Index: clang/lib/Headers/cetintrin.h
===================================================================
--- clang/lib/Headers/cetintrin.h
+++ clang/lib/Headers/cetintrin.h
@@ -42,10 +42,20 @@
return __builtin_ia32_rdsspd(__a);
}
+static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd_i32() {
+ unsigned int t;
+ return __builtin_ia32_rdsspd(t);
+}
+
#ifdef __x86_64__
static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long long __a) {
return __builtin_ia32_rdsspq(__a);
}
+
+static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq_i64() {
+ unsigned long long t;
+ return __builtin_ia32_rdsspq(t);
+}
#endif /* __x86_64__ */
#ifdef __x86_64__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116325.397188.patch
Type: text/x-patch
Size: 1555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220104/7da929f8/attachment.bin>
More information about the cfe-commits
mailing list