forked from OSchip/llvm-project
[X86] Add missing CET intrinsics support
These two intrinsics are documented o SDM and intrinsic guide. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D116325
This commit is contained in:
parent
5723261370
commit
0bab742805
|
@ -42,10 +42,20 @@ static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd(unsigned int __a) {
|
||||||
return __builtin_ia32_rdsspd(__a);
|
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__
|
#ifdef __x86_64__
|
||||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long long __a) {
|
static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long long __a) {
|
||||||
return __builtin_ia32_rdsspq(__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__ */
|
#endif /* __x86_64__ */
|
||||||
|
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
|
|
|
@ -37,6 +37,12 @@ unsigned int test_rdsspd(unsigned int a) {
|
||||||
return _rdsspd(a);
|
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__
|
#ifdef __x86_64__
|
||||||
unsigned long long test_rdsspq(unsigned long long a) {
|
unsigned long long test_rdsspq(unsigned long long a) {
|
||||||
// X86_64-LABEL: @test_rdsspq
|
// X86_64-LABEL: @test_rdsspq
|
||||||
|
@ -44,6 +50,12 @@ unsigned long long test_rdsspq(unsigned long long a) {
|
||||||
return _rdsspq(a);
|
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) {
|
unsigned long long test_get_ssp(void) {
|
||||||
// X86_64-LABEL: @test_get_ssp
|
// X86_64-LABEL: @test_get_ssp
|
||||||
// X86_64: call i64 @llvm.x86.rdsspq(i64 0)
|
// X86_64: call i64 @llvm.x86.rdsspq(i64 0)
|
||||||
|
|
Loading…
Reference in New Issue