[PATCH] [PowerPC] Initial VSX intrinsic support, with min/max for vector double

hfinkel at anl.gov hfinkel at anl.gov
Thu Oct 23 23:21:57 PDT 2014


================
Comment at: lib/Sema/DeclSpec.cpp:692
@@ -691,2 +691,3 @@
   TypeSpecOwned = false;
-  if (TypeAltiVecVector && !TypeAltiVecBool && (TypeSpecType == TST_double)) {
+  if (TypeAltiVecVector && !TypeAltiVecBool && (TypeSpecType == TST_double) &&
+      (TypeSpecWidth == TSW_long || TypeSpecWidth == TSW_longlong)) {
----------------
XL's docs say:

  Note: The vector unsigned long long, vector bool long long, vector signed long long, and vector double types require architectures that support the VSX instruction set extensions, such as POWER7. You must specify the -qarch=pwr7 compiler option when you use these types.

I think it makes sense to do the corresponding thing in Clang. We should only make the VSX types available when PPCTargetInfo::getTargetDefines defines __VSX__, otherwise we should restrict to the Altivec types.

My motivation for saying this is that getting front-end syntax errors with nice error messages is preferable to getting 'cannot select' errors from the backend.

http://reviews.llvm.org/D5949






More information about the cfe-commits mailing list