diff options
author | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
commit | fc74ff5a0792641885551a63d9ddf8cbfdf76e3c (patch) | |
tree | 955a1295c3fd4378a49478ad5835ca21b769417e /lib/Headers/ia32intrin.h | |
parent | 3176e97f130184ece0e1a21352c8124cc83ff24a (diff) | |
download | FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.zip FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.tar.gz |
Vendor import of clang trunk r256945:
https://llvm.org/svn/llvm-project/cfe/trunk@256945
Diffstat (limited to 'lib/Headers/ia32intrin.h')
-rw-r--r-- | lib/Headers/ia32intrin.h | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/lib/Headers/ia32intrin.h b/lib/Headers/ia32intrin.h index 5adf3f1..b2f82bb 100644 --- a/lib/Headers/ia32intrin.h +++ b/lib/Headers/ia32intrin.h @@ -32,50 +32,26 @@ static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) __readeflags(void) { - unsigned long long __res = 0; - __asm__ __volatile__ ("pushf\n\t" - "popq %0\n" - :"=r"(__res) - : - : - ); - return __res; + return __builtin_ia32_readeflags_u64(); } static __inline__ void __attribute__((__always_inline__, __nodebug__)) __writeeflags(unsigned long long __f) { - __asm__ __volatile__ ("pushq %0\n\t" - "popf\n" - : - :"r"(__f) - :"flags" - ); + __builtin_ia32_writeeflags_u64(__f); } #else /* !__x86_64__ */ static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __readeflags(void) { - unsigned int __res = 0; - __asm__ __volatile__ ("pushf\n\t" - "popl %0\n" - :"=r"(__res) - : - : - ); - return __res; + return __builtin_ia32_readeflags_u32(); } static __inline__ void __attribute__((__always_inline__, __nodebug__)) __writeeflags(unsigned int __f) { - __asm__ __volatile__ ("pushl %0\n\t" - "popf\n" - : - :"r"(__f) - :"flags" - ); + __builtin_ia32_writeeflags_u32(__f); } #endif /* !__x86_64__ */ |