Skip to content

Commit

Permalink
Merge pull request rust-lang#697 from tgross35/f16-asm
Browse files Browse the repository at this point in the history
Resolve FIXMEs related to `f16` assembly
  • Loading branch information
tgross35 authored Sep 28, 2024
2 parents 243871e + 5849947 commit d5ca981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
7 changes: 2 additions & 5 deletions testcrate/benches/float_extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ float_bench! {
sys_available: not(feature = "no-sys-f16"),
asm: [
#[cfg(target_arch = "aarch64")] {
// FIXME(f16_f128): remove `to_bits()` after f16 asm support (rust-lang/rust/#116909)
let ret: f32;
asm!(
"fcvt {ret:s}, {a:h}",
a = in(vreg) a.to_bits(),
a = in(vreg) a,
ret = lateout(vreg) ret,
options(nomem, nostack, pure),
);
Expand Down Expand Up @@ -96,9 +95,7 @@ pub fn float_extend() {
extend_f16_f32(&mut criterion);

#[cfg(f128_enabled)]
{
extend_f16_f128(&mut criterion);
}
extend_f16_f128(&mut criterion);
}

extend_f32_f64(&mut criterion);
Expand Down
14 changes: 5 additions & 9 deletions testcrate/benches/float_trunc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ float_bench! {
sys_available: not(feature = "no-sys-f16"),
asm: [
#[cfg(target_arch = "aarch64")] {
// FIXME(f16_f128): remove `from_bits()` after f16 asm support (rust-lang/rust/#116909)
let ret: u16;
let ret: f16;
asm!(
"fcvt {ret:h}, {a:s}",
a = in(vreg) a,
ret = lateout(vreg) ret,
options(nomem, nostack, pure),
);

f16::from_bits(ret)
ret
};
],
}
Expand All @@ -37,16 +36,15 @@ float_bench! {
sys_available: not(feature = "no-sys-f16"),
asm: [
#[cfg(target_arch = "aarch64")] {
// FIXME(f16_f128): remove `from_bits()` after f16 asm support (rust-lang/rust/#116909)
let ret: u16;
let ret: f16;
asm!(
"fcvt {ret:h}, {a:d}",
a = in(vreg) a,
ret = lateout(vreg) ret,
options(nomem, nostack, pure),
);

f16::from_bits(ret)
ret
};
],
}
Expand Down Expand Up @@ -138,9 +136,7 @@ pub fn float_trunc() {
// FIXME(#655): `f16` tests disabled until we can bootstrap symbols
#[cfg(f16_enabled)]
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
{
trunc_f128_f16(&mut criterion);
}
trunc_f128_f16(&mut criterion);

trunc_f128_f32(&mut criterion);
trunc_f128_f64(&mut criterion);
Expand Down

0 comments on commit d5ca981

Please sign in to comment.