-
-
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
JIT: explicitly handle __extendhfsf2 and friends #44975
Conversation
A partial fix to #44829, but perhaps we will still have ABI problems with the sysimg (which may not link directly enough on linux in many cases)
|
||
extern float __gnu_h2f_ieee(uint16_t param); | ||
extern float __extendhfsf2(uint16_t param); | ||
extern uint16_t __gnu_f2h_ieee(float param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extern uint16_t __gnu_f2h_ieee(float param); | |
extern double __gnu_f2h_ieee(uint16_t param); |
(not that it matters here, since we just need the declared prototype)
Another idea, adjust the TLI to have different names for these intrinsics? There are two reasons for trying to supply our own. 1. Some platforms were missing these, 2. We want our rounding semantics |
Ah, are we able to do that? Do you know how we can change these TLI names? |
When in question do what Clang does? https://github.com/llvm/llvm-project/blob/26b0ecb8985b7e76a5ca0965d3d464611eda14f0/clang/lib/CodeGen/BackendUtil.cpp#L246-L278 and since we then have a |
I thought the TargetLibraryInfoImpl was private to the TargetMachine so that passes couldn't access or change it |
That is true passes can't access it directly, but when you create your TM you can pass it a TLII and you can change it beforehand as Clang does in the link above |
Could you also add __truncsfhf2, which is an equivalent version of __gnu_f2h_ieee. When working on the riscv port, I found llvm and gcc will emit a call to __truncsfhf2 on riscv instead of __gnu_f2h_ieee. |
A partial fix to #44829, but perhaps we will still have ABI problems with the sysimg (which may not link directly enough on linux in many cases)
@nalimilan @vchuravy I don't know how to make the linux linker work any better than this. The COFF and MACHO linkers would support two-level namespaces which would solve it, but the linux ELF implementations likely have problems with this still.