summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-06-04 21:39:20 +0000
committerReid Kleckner <rnk@google.com>2018-06-04 21:39:20 +0000
commit89fbd551450d22ef01a33d208870407c7eff208b (patch)
treec023a11822186c0c13945b07a28fda68f3bc6cfb /clang/lib/Basic
parent36df9d8514f755598d435a7f3205648dc0239c1d (diff)
downloadbcm5719-llvm-89fbd551450d22ef01a33d208870407c7eff208b.tar.gz
bcm5719-llvm-89fbd551450d22ef01a33d208870407c7eff208b.zip
Revert r333791 "Cap "voluntary" vector alignment at 16 for all Darwin platforms."
Adding __attribute__((aligned(32))) to __m256 breaks the implementation of _mm256_loadu_ps on Windows. On Windows, alignment attributes have higher precedence than packing attributes. We also might want to carefully consider the consequences of changing our vector typedefs, since many users copy them and invent their own new, non-Intel specific vector type names. llvm-svn: 333958
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets/OSTargets.h3
-rw-r--r--clang/lib/Basic/Targets/X86.h7
2 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index 6cc3c095557..18239a2ec77 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -113,9 +113,6 @@ public:
}
this->MCountName = "\01mcount";
-
- // Cap vector alignment at 16 bytes for all Darwin platforms.
- this->MaxVectorAlign = 128;
}
std::string isValidSectionSpecifier(StringRef SR) const override {
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 9d277e94cc0..5b862face9b 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -421,6 +421,7 @@ public:
LongDoubleWidth = 128;
LongDoubleAlign = 128;
SuitableAlign = 128;
+ MaxVectorAlign = 256;
// The watchOS simulator uses the builtin bool type for Objective-C.
llvm::Triple T = llvm::Triple(Triple);
if (T.isWatchOS())
@@ -436,6 +437,9 @@ public:
if (!DarwinTargetInfo<X86_32TargetInfo>::handleTargetFeatures(Features,
Diags))
return false;
+ // We now know the features we have: we can decide how to align vectors.
+ MaxVectorAlign =
+ hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
return true;
}
};
@@ -798,6 +802,9 @@ public:
if (!DarwinTargetInfo<X86_64TargetInfo>::handleTargetFeatures(Features,
Diags))
return false;
+ // We now know the features we have: we can decide how to align vectors.
+ MaxVectorAlign =
+ hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
return true;
}
};
OpenPOWER on IntegriCloud