This is split from D113107 to address #56204 and https://discourse.llvm.org/t/how-to-build-compiler-rt-for-new-x86-half-float-abi/63366
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/docs/LanguageExtensions.rst | ||
---|---|---|
746–752 | Could you take the wording I suggested from the other patch? You'll need to drop the part about avoiding intermediate truncations, but it's important to still document the practical/performance difference when AVX512-FP16 is not available, even if the observable behavior is the same. | |
clang/docs/ReleaseNotes.rst | ||
520 | ||
clang/test/SemaCXX/Float16.cpp | ||
8 | This test (and Float16.c) should continue to have positive and negative examples even if generic x86_64 is no longer negative. Generic i386 should still be negative, for example. |
Thanks @vitalybuka ! I believe the fail was caused by missing COMPILER_RT_HAS_FLOAT16 in these tests. Relanded.
This broke some compiler-rt tests on Darwin:
https://green.lab.llvm.org/green/job/clang-stage1-RA/29920/
Test Result (3 failures / +3) Builtins-x86_64-darwin.Builtins-x86_64-darwin.extendhfsf2_test.c Builtins-x86_64-darwin.Builtins-x86_64-darwin.truncdfhf2_test.c Builtins-x86_64-darwin.Builtins-x86_64-darwin.truncsfhf2_test.c
@pengfei could you fix the Darwin tests as well? And a general comment regarding the ongoing _Float16 effort: I think that this change should have been a part of https://reviews.llvm.org/D107082 to make it possible to build a consistently working toolchain. Thus, if this commit can't be landed in a reasonable time, I'd suggest reverting https://reviews.llvm.org/D107082.
Thanks @benlangmuir for the revert. The problem seems Darwin supports the _Float16 type already but with a different ABI. I have no idea how to solve the problem ATM. Post a question on discourse: https://discourse.llvm.org/t/compiler-rt-tests-fail-on-darwin-stage1-build-after-the-abi-change-of-half-type-on-x86/63508
@alexfh I'm working on that. I'm asking suggestion on solving it in a better way, but at least we can disable the test for Darwin (maybe just for stage1 if possible) since it's expected due to the ABI change.
clang/test/CodeGen/X86/Float16-arithmetic.c | ||
---|---|---|
2 | Use one line for RUN. This isn't long. Delete excess spaces. x86_64-unknown-unknown can be simplified as x86_64 | |
3 | Delete --check-prefixes=CHECK. This is the default. | |
5 | The test only has negative patterns. Such a test is prone to be stale without being noticed. Add some positive CHECK lines. |
clang/lib/Basic/Targets/X86.cpp | ||
---|---|---|
357 | _Float16 for x86 convey no extra information since this file is for x86. |
clang/lib/Basic/Targets/X86.cpp | ||
---|---|---|
357 | Thinking again: The comment just repeats what the code does. So it can be deleted. |
clang/lib/Basic/Targets/X86.cpp | ||
---|---|---|
357 | Yeah, I had the same feeling when updating. Will delete, thanks! :) |
Could you take the wording I suggested from the other patch? You'll need to drop the part about avoiding intermediate truncations, but it's important to still document the practical/performance difference when AVX512-FP16 is not available, even if the observable behavior is the same.