forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IR] Add an xpassing test for
f128
intrinsic lowering
`f128` intrinsic functions lower to incorrect libc calls. Add a test showing current behavior. [IR] Correct lowering of `f128` intrinsics Change the lowering of 128-bit floating point math function intrinsics to use binary128 functions (`sqrtf128`) rather than `long double` functions (`sqrtl`). Currently intrinsic calls such as `@llvm.sqrt.f128` are lowered to libc's `long double` functions. On platforms where `long double` is not `fp128`, this results in incorrect math. define fp128 @test_sqrt(fp128 %a) { start: %0 = tail call fp128 @llvm.sqrt.f128(fp128 %a) ret fp128 %0 } declare fp128 @llvm.sqrt.f128(fp128) lowers to test_sqrt: # @test_sqrt jmp sqrtl@PLT # TAILCALL On x86 this results in the binary128 argument being treated as 80-bit extended precision. This has no effect on clang, which lowers builtins to the libc calls directly without going through LLVM intrinsics. Fixes llvm#44744 Differential Revision: https://reviews.llvm.org/D157836
- Loading branch information
Showing
2 changed files
with
80 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.