-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable f16 in assembly on aarch64 platforms that support it
Signed-off-by: rongfu.leng <lenronfu@gmail.com>
- Loading branch information
1 parent
4bc39f0
commit dd8dc65
Showing
9 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule backtrace
updated
8 files
+3 −3 | Cargo.lock | |
+2 −2 | Cargo.toml | |
+1 −1 | crates/as-if-std/Cargo.toml | |
+2 −2 | src/backtrace/dbghelp32.rs | |
+2 −2 | src/backtrace/dbghelp64.rs | |
+2 −3 | src/symbolize/dbghelp.rs | |
+10 −6 | src/symbolize/gimli/coff.rs | |
+21 −3 | src/symbolize/gimli/macho.rs |
Submodule book
updated
20 files
Submodule edition-guide
updated
5 files
Submodule rust-by-example
updated
5 files
+1 −1 | .github/workflows/rbe.yml | |
+1 −7 | TRANSLATING.md | |
+166 −194 | po/ja.po | |
+2 −2 | src/custom_types/structs.md | |
+1 −1 | src/scope/borrow.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@ only-aarch64 | ||
//@ run-pass | ||
|
||
#![feature(f16, f128)] | ||
use std::arch::asm; | ||
#[inline(never)] | ||
pub fn f32_to_f16_asm(a: f32) -> f16 { | ||
let ret: f16; | ||
unsafe { | ||
asm!( | ||
"fcvt {ret:h}, {a:s}", | ||
a = in(vreg) a, | ||
ret = lateout(vreg) ret, | ||
options(nomem, nostack), | ||
); | ||
} | ||
ret | ||
} | ||
fn main() { | ||
assert_eq!(f32_to_f16_asm(1.0 as f32), 1.0); | ||
} |