Skip to content

Commit 8a7eac2

Browse files
committed
Merge pull request #15219 from eschnett/eschnett/cmpxchg16b
Require the `cx16` feature on Intel CPUs when threading is enabled
2 parents 4d47175 + b87d54c commit 8a7eac2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/codegen.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5794,7 +5794,7 @@ static void init_julia_llvm_env(Module *m)
57945794
}
57955795

57965796
// Helper to figure out what features to set for the LLVM target
5797-
// If the user specifies native ( or does not specify ) we default
5797+
// If the user specifies native (or does not specify) we default
57985798
// using the API provided by LLVM
57995799
static inline SmallVector<std::string,10> getTargetFeatures() {
58005800
StringMap<bool> HostFeatures;
@@ -5807,13 +5807,19 @@ static inline SmallVector<std::string,10> getTargetFeatures() {
58075807
// Platform specific overides follow
58085808
#if defined(_CPU_X86_64_) || defined(_CPU_X86_)
58095809
#ifndef USE_MCJIT
5810-
// Temporarily disable Haswell BMI2 features due to LLVM bug.
5810+
// Temporarily disable Haswell BMI2 features due to LLVM bug.
58115811
HostFeatures["bmi2"] = false;
58125812
HostFeatures["avx2"] = false;
58135813
#endif
58145814
#ifdef V128_BUG
58155815
HostFeatures["avx"] = false;
58165816
#endif
5817+
// Require cx16 (cmpxchg16b)
5818+
// We need this for 128-bit atomic operations. We only need this
5819+
// when threading is enabled; however, to test whether this excludes
5820+
// important systems, we require this even when threading is
5821+
// disabled.
5822+
HostFeatures["cx16"] = true;
58175823
#endif
58185824

58195825
// Figure out if we know the cpu_target

0 commit comments

Comments
 (0)