-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need to install compiler-rt #14818
Comments
Llvm emits a function call for that? |
Oh i see, it's probably caused by the |
yes, it's the combination of being a generic arch and i128 (and expecting that compiler-rt will exist). i guess i opened the issue so that nobody will be particularly surprised when I open a PR for it. |
I think people will not be surprised if the PR includes tests for these functions =). |
looks like the is actually an upstream bug ( |
There was a thread on llvm dev abouty |
All modern Intel CPUs have the I also hear that "The 64-bit version of Windows 8.1 requires this feature" https://en.wikipedia.org/wiki/X86-64. |
I confirm that this patch $ git diff
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 284ae89..e9a40ac 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -5802,6 +5802,8 @@ static inline SmallVector<std::string,10> getTargetFeatures() {
#ifdef V128_BUG
HostFeatures["avx"] = false;
#endif
+ // Require cx16 (cmpxchg16b)
+ HostFeatures["cx16"] = true;
#endif
// Figure out if we know the cpu_target resolves the issue. |
This makes 128-bit atomics work on Intel. Without this feature, LLVM does not always know how to generate the respective code. The CPU feature `cx16` describes whether the CPU supports the `cmpxchg16b` instruction. All modern Intel CPUs support this feature; see the discussion in JuliaLang#14818. When Julia generates code for a `native` 64-bit CPU, this flag is already set correctly. However, when Julia generates code for either a 32-bit or a `generic` Intel CPU, then LLVM assumes pessimistically that this feature is not present. According to Wikipedia <https://en.wikipedia.org/wiki/X86-64>, this is only relevant for "early AMD64 processors", and "the 64-bit version of Windows 8.1 requires the instruction". I thus suggest to require this instruction as well when threading is enabled. The alternative is to disable support for 128-bit atomics. The generic CPU target is apparently specified at many occasions, including for 32-bit Intel CPUs and in Travis. Closes JuliaLang#14818.
This makes 128-bit atomics work on Intel. Without this feature, LLVM does not always know how to generate the respective code. The CPU feature `cx16` describes whether the CPU supports the `cmpxchg16b` instruction. All modern Intel CPUs support this feature; see the discussion in JuliaLang#14818. When Julia generates code for a `native` 64-bit CPU, this flag is already set correctly. However, when Julia generates code for either a 32-bit or a `generic` Intel CPU, then LLVM assumes pessimistically that this feature is not present. According to Wikipedia <https://en.wikipedia.org/wiki/X86-64>, this is only relevant for "early AMD64 processors", and "the 64-bit version of Windows 8.1 requires the instruction". I thus suggest to require this instruction as well when threading is enabled. The alternative is to disable support for 128-bit atomics. The generic CPU target is apparently specified at many occasions, including for 32-bit Intel CPUs and in Travis. Closes JuliaLang#14818.
I believe this was corrected by #15219. |
Unfortunately, #15219 only corrects this for 64-bit Intel systems, not for 32-bit systems. |
Looks like llvm-svn have some issue that might be related? http://buildbot.e.ip.saba.us:8010/builders/nightly_llvmsvn-x64/builds/196/steps/make%20testall/logs/stdio |
The text was updated successfully, but these errors were encountered: