diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-01-31 19:44:55 +0000 | 
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-01-31 19:44:55 +0000 | 
| commit | 12fb89ec519371bcf3024c9b50a7338f6cb91e88 (patch) | |
| tree | 6c7ff5203b1a4dd7ac9aef575976b726aca87ec1 | |
| parent | c18b36625ef3bd04bb8af9860c20ce219c0e1814 (diff) | |
| download | bcm5719-llvm-12fb89ec519371bcf3024c9b50a7338f6cb91e88.tar.gz bcm5719-llvm-12fb89ec519371bcf3024c9b50a7338f6cb91e88.zip  | |
MS Intrin.h: implement __cpuidex and simplify __cpuid
The two identical implementations of __cpuid for X86 / X86_64 were
leftovers from my first iteration on the patch that implemented it.
llvm-svn: 200568
| -rw-r--r-- | clang/lib/Headers/Intrin.h | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Headers/Intrin.h b/clang/lib/Headers/Intrin.h index 6fd1eeb3739..3bb304a3115 100644 --- a/clang/lib/Headers/Intrin.h +++ b/clang/lib/Headers/Intrin.h @@ -53,6 +53,7 @@ void __addfsword(unsigned long, unsigned short);  void __code_seg(const char *);  static __inline__  void __cpuid(int[4], int); +static __inline__  void __cpuidex(int[4], int, int);  void __debugbreak(void);  __int64 __emul(int, int); @@ -876,14 +877,13 @@ _ReturnAddress(void) {  }  static __inline__ void __attribute__((__always_inline__, __nodebug__))  __cpuid(int __info[4], int __level) { -#if __i386__ -  __asm__ ("cpuid" -         : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3]) -         : "0"(__level)); -#else    __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3]) -                   : "0"(__level)); -#endif +                   : "a"(__level)); +} +static __inline__ void __attribute__((__always_inline__, __nodebug__)) +__cpuidex(int __info[4], int __level, int __ecx) { +  __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3]) +                   : "a"(__level), "c"(__ecx));  }  static __inline__ unsigned __int64 __cdecl __attribute__((__always_inline__, __nodebug__))  _xgetbv(unsigned int __xcr_no) {  | 

