Skip to content
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

gen/target: make real 128bit on RISC-V targets #3892

Merged
merged 2 commits into from
Jan 17, 2022

Conversation

ljmf00
Copy link
Contributor

@ljmf00 ljmf00 commented Jan 7, 2022

RISC-V ILP32/LP64 ABI defines long double as 128bit.

Reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#cc-type-details
Signed-off-by: Luís Ferreira contact@lsferreira.net

ljmf00 and others added 2 commits January 7, 2022 01:06
RISC-V ILP32/LP64 ABI defines `long double` as 128bit.

Reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#cc-type-details
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
@kinke
Copy link
Member

kinke commented Jan 16, 2022

I took the liberty of fixing this for LLVM < 9, refactoring the function while at it. The switch can be replaced by a terser if (triple.isX86()) … else if … chain once support for LLVM < 9 is dropped.

@ljmf00
Copy link
Contributor Author

ljmf00 commented Jan 16, 2022

The ultimate goal would be to use clang::TargetInfo, which gives you information about all target-specific types, sizes, etc... I didn't search in which version this is available, but I think the downside is the dependency to libclang. But if you do it statically, maybe it is not a big of an hassle.

@kinke kinke merged commit 63d18b4 into ldc-developers:master Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants