Repository navigation
Arm NEON bf16 intrinsics - #2256
Jamesbarford wants to merge 4 commits into
Conversation
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| if self.kind() == TypeKind::BFloat && self.simd_len.is_none() && self.vec_len.is_none() { | ||
| return "f16b".to_string(); | ||
| } |
There was a problem hiding this comment.
Why does this need special-casing? A comment would help.
There was a problem hiding this comment.
Added, it's so we now create NanEqF16b
| } | ||
|
|
||
| fn comparison_function(&self) -> String { | ||
| if self.kind() == TypeKind::BFloat { |
There was a problem hiding this comment.
similarly a comment on why this type is special would help.
There was a problem hiding this comment.
Removed and renamed NanEqBF16 to NanEqF16b which makes the code simpler, removing this case.
| if arg.ty.kind() == TypeKind::BFloat { | ||
| let ty = arg.ty.rust_type(); | ||
| return format!( | ||
| "let {name}: {ty} = std::ptr::read_unaligned(\ | ||
| {vals_name}.as_ptr().add((i+{idx}) % {PASSES}) as *const {ty});", | ||
| vals_name = test_values_array_name(&arg.ty), | ||
| ); | ||
| } |
There was a problem hiding this comment.
why is this special-cased? could use a comment.
There was a problem hiding this comment.
We don't need this. I was experimenting and forgot to remove it.
| CcArgStyle::Clang if !a32 && !big_endian => vec![ | ||
| "-march=armv8.6a+crypto+crc+dotprod+fp16+sve2-aes+sve2-sm4+sve2-sha3+sve2-bitperm+\ | ||
| f32mm+f64mm+sve2p1", | ||
| "-march=armv8.6a+crypto+crc+dotprod+fp16+bf16+lut+sve2-aes+sve2-sm4+sve2-sha3+\ |
There was a problem hiding this comment.
lut because the relevant bf16 intrinsics are part of that target feature?
There was a problem hiding this comment.
While I was fiddling about with the tests I added it and forgot that we skip testing the intrinsics which require lut due to the version of QEMU not supporting it. So I've removed it.
523c658 to
1a54bf3
Compare
1a54bf3 to
f3ac668
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Adds support for bfloat intrinsics for NEON