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

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 18 08:59:53 PDT 2016


rnk added a comment.

Hm, resending my comments because it doesn't appear to work from email. I swear it used to...

In https://reviews.llvm.org/D21959#519179, @guyblank wrote:

> Still, __XSAVE__ should have been defined when compiling for a target that supports the feature.


That's not how MSVC intrinsics (or icc intrinsics, right?) are supposed to work, though. In MSVC, all intrinsics are always available, regardless of subtarget options. Unfortunately, Clang is not very compatible in this area, because of the way that we map the vector intrinsics to our generic vector IR and then codegen that. In this case, we don't have any generic instruction to map to, so I think we should try to be compatible here.

> But anyway, the xsaveintrin.h is quite small so always including it shouldn't be an issue.

>  Are you ok with me removing the #if just for this header file, or would you like to wait for Nico?


I think removing the _MSC_VER check is probably OK, but will the new LLVM intrinsic you added generate correct code when the xsave feature is disabled, as I expect it is in Chromium?


Repository:
  rL LLVM

https://reviews.llvm.org/D21959





More information about the cfe-commits mailing list