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

Support f16 and f128 #8312

Open
tgross35 opened this issue Apr 7, 2024 · 1 comment
Open

Support f16 and f128 #8312

tgross35 opened this issue Apr 7, 2024 · 1 comment
Labels
cranelift:area:clif cranelift Issues related to the Cranelift code generator

Comments

@tgross35
Copy link

tgross35 commented Apr 7, 2024

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

Add support for 16-bit and 128-bit IEEE floating point numbers.

Benefit

This will allow using these types with rustc_codegen_clif, as described at rust-lang/rustc_codegen_cranelift#1461

Implementation

Unsure

Alternatives

Unsure, maybe it would be possible to stub out these types if adding them is difficult.

@jameysharp jameysharp added cranelift Issues related to the Cranelift code generator cranelift:area:clif labels May 11, 2024
@jameysharp
Copy link
Contributor

Adding the types is pretty easy, I think, and extending CLIF floating-point instructions to allow the new types is also pretty easy. Successfully compiling anything that uses the types is the hard part, I imagine.

I think the places to add the types are:

Once the tests are passing again after that, I think you'll have a compiler that will accept f16/f128 instructions. But if you use them, then it will fail later: during lowering on all backends; in the interpreter; in compiletests and runtests; and in fuzzing.

I think this is a fairly large project, but if rustc needs these types, I think it's reasonable to add the types in one PR and then work on adding implementations for them everywhere over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:clif cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

2 participants