-
Notifications
You must be signed in to change notification settings - Fork 57
Add demangling for f16
and f128
#64
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
`k` was selected for `f16` and `q` for `f128`. These are different from LLVM's defaults.
The f16 & f128 RFC was merged so I think it is OK to decide on mangling. Marking it as ready for review @Mark-Simulacrum |
I think we probably don't need different mangling for PowerPC that LLVM seems to have but could use confirmation https://github.com/llvm/llvm-project/blob/fdef7952cbc26fd31d0d92a4f14dde58bc461fe9/clang/lib/Basic/Targets/PPC.h#L351 patch llvm/llvm-project@0461534 |
@rcvalle / @michaelwoerister, we need this mangling at some point - any guidance on how to proceed? Itanium uses |
We'll need to take a look at what the grammar allows. Is this implemented in the compiler already? Will these types be primitive types in Rust? |
I just saw the links in the PR message. Will read those 🙂 |
The primitives exist in the compiler but not yet fully exposed (rust-lang/rust#121926 coming soon). Currently it does the itanium mangling and just ICEs with v0 mangling. |
@ehuss suggested here that we extend the mangling scheme by updating the official docs. I think that is a good idea. Would you mind opening a PR that adds the two cases to the basic types section and then we can do a compiler team FCP to sign off on the change. |
I added a comment at rust-lang/rust#121728 (comment), but this is for CFI encoding and cross-language CFI compatibility and independent/dissociated to Rust mangling/demangling and a different encoding can be used for it. |
Thanks for the pointers, I opened rust-lang/rust#122106 to follow up |
I think this can be closed now, right @tgross35? |
Totally forgot abut this, thanks! |
k
was selected forf16
/half
andq
forf128
/quad
.These are different from LLVM's defaults which are
Dh
for half (link) andg
for quad (link). I don't know if there is any reason to mirror LLVM here because it would mean adding multi character tags for primitives. I just usedq
because it it's more obviously in line withf
forfloat
/f32
andd
fordouble
/f64
.Part of rust-lang/rust#114607