core::num::f16b Rust's 16bit Brain Float - #160859
Conversation
|
Some changes occurred in compiler/rustc_attr_ir cc @jdonszelmann, @JonathanBrouwer This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410
|
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
… and backend handling. GCC and Cranelift explicitly unsupported
|
@rustbot reroll |
…long with traits agreed on in the RFC
…6b` to be treated as a primitive scalar
| } | ||
|
|
||
| fn type_f16b(&self) -> Type<'gcc> { | ||
| bug!("f16b is not supported by the GCC codegen backend") |
There was a problem hiding this comment.
I believe GCC actually supports this type: https://github.com/rust-lang/gccjit.rs/blob/master/src/context.rs#L1482
bf10f8a to
01c5c1b
Compare
|
cc @bjorn3 |
| let bfloat = scalar_unit(Primitive::Float(abi::Float::F16B)); | ||
| assert_eq!(layout.size, abi::Float::F16B.size()); | ||
| assert_eq!(layout.align, abi::Float::F16B.align(cx)); | ||
| layout.backend_repr = BackendRepr::Scalar(bfloat); |
There was a problem hiding this comment.
You probably also want to add a check that you can't take a reference to the inner field just like for #[repr(simd)].
There was a problem hiding this comment.
What is the calling convention of other targets?
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
Implements the RFC: f16b type. Best reviewed commit by commit, happy to split into separate PRs if that is deemed easier to review. However the line count and surface area is, in my opinion, reasonably small.
Adds;
f16balong withbfloatlang item to work with LLVM, GCC is explicitlyunimplemented!(...)f16bfeature gate, page forf16bon libruscdoc and astruct bf16incore::numf16bas a scalar primitive for scalable vectorsIssues;