[PATCH] D21959: [X86] Add xgetbv xsetbv intrinsics

Elena Demikhovsky via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 20 01:32:42 PDT 2016


delena added a comment.

#include <x86intrin.h>in the test is not clear for me. Does it mean that you broke backward compatibility?


================
Comment at: lib/CodeGen/CGBuiltin.cpp:6779
@@ -6776,1 +6778,3 @@
   }
+  case X86::BI__builtin_ia32_xgetbv: {
+    return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_xgetbv), Ops);
----------------
remove {}

================
Comment at: lib/Headers/intrin.h:905
@@ -906,9 +904,3 @@
 }
-static __inline__ unsigned __int64 __cdecl __DEFAULT_FN_ATTRS
-_xgetbv(unsigned int __xcr_no) {
-  unsigned int __eax, __edx;
-  __asm__ ("xgetbv" : "=a" (__eax), "=d" (__edx) : "c" (__xcr_no));
-  return ((unsigned __int64)__edx << 32) | __eax;
-}
 static __inline__ void __DEFAULT_FN_ATTRS
 __halt(void) {
----------------
I'm not sure that we can move it from one file to another. And what was wrong with current implementation.


https://reviews.llvm.org/D21959





More information about the cfe-commits mailing list