mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list
Despite that the `fflags` register (representing floating point exception flags) is stated as a flag register in the reference, it's not in the default clobber list of the RISC-V inline assembly and it would be better to fix it.
This commit is contained in:
@@ -240,6 +240,7 @@ fn codegen_inline_asm(
|
||||
}
|
||||
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
|
||||
constraints.extend_from_slice(&[
|
||||
"~{fflags}".to_string(),
|
||||
"~{vtype}".to_string(),
|
||||
"~{vl}".to_string(),
|
||||
"~{vxsat}".to_string(),
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use minicore::*;
|
||||
|
||||
// CHECK-LABEL: @flags_clobber
|
||||
// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"()
|
||||
// CHECK: call void asm sideeffect "", "~{fflags},~{vtype},~{vl},~{vxsat},~{vxrm}"()
|
||||
#[no_mangle]
|
||||
pub unsafe fn flags_clobber() {
|
||||
asm!("", options(nostack, nomem));
|
||||
|
||||
Reference in New Issue
Block a user