[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)
Jonas Paulsson via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 7 15:01:51 PST 2025
JonPsson1 wrote:
> To clarify, the code is calling `__extendhfdf2` then `__truncdfhf2` from either libgcc or from compiler-rt with your patches, and the compiler-rt version is incorrect? Could you have it print the intermediate results as u16 hex (`Op0 + Op1`, `Res2`, `Res`)?
Yes, my test program is calling either libgcc or compiler-rt implementaions of the same function. Yes, on this branch.
```
libgcc compiler-rt
vlreph %v0, 0(%r1) 0x3e00 (1.5) 0x3e00
brasl %r14, __extendhfdf2 at PLT 0x3ff8000000000000 0x3fc0000000000000
ldr %f8, %f0
vlreph %v0, 0(%r13) 0x3800 (0.5) 0x3800
brasl %r14, __extendhfdf2 at PLT 0x3fe0000000000000 0x3f00000000000000
ldr %f2, %f0
ldr %f0, %f8
brasl %r14, fun2 at PLT 0x4000000000000000 (2.0) 0x3fc0010000000000
brasl %r14, __truncdfhf2 at PLT 0x4000 0x3000
brasl %r14, __extendhfsf2 at PLT 0x40000000 0x3e000000
```
> Not sure if you are testing only on s390x but there should probably be a unit test at https://github.com/llvm/llvm-project/tree/d90423e310482bdbc731242fa25dcb3dd44e69de/compiler-rt/test/builtins/Unit to see if things work on other platforms.
I am testing on s390x, and I guess it's unfortunate that there is no such test for hfdf - this is the file that was missing and that I added. I guess it should be added once it is confirmed to work properly (or if someone would provide the right values). The tests that are already there have been passing always while working on this, even when building with gcc.
https://github.com/llvm/llvm-project/pull/109164
More information about the cfe-commits
mailing list