forked from koniifer/ableos
Fixed x86 asm
This commit is contained in:
parent
6e464be33d
commit
30ee6c84fc
|
@ -32,9 +32,9 @@ macro_rules! fnsdef {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut mxcsr = 0_u32;
|
let mut mxcsr = 0_u32;
|
||||||
'a: {
|
'a: {
|
||||||
asm!("stmxcsr {}", in(reg) &mut mxcsr);
|
asm!("stmxcsr [{}]", in(reg) &mut mxcsr);
|
||||||
asm!(
|
asm!(
|
||||||
"ldmxcsr {}",
|
"ldmxcsr [{}]",
|
||||||
in(reg) &(mxcsr & !arin::_MM_ROUND_MASK | match mode {
|
in(reg) &(mxcsr & !arin::_MM_ROUND_MASK | match mode {
|
||||||
RoundingMode::NearestEven => break 'a,
|
RoundingMode::NearestEven => break 'a,
|
||||||
RoundingMode::Truncate => arin::_MM_ROUND_TOWARD_ZERO,
|
RoundingMode::Truncate => arin::_MM_ROUND_TOWARD_ZERO,
|
||||||
|
@ -47,7 +47,7 @@ macro_rules! fnsdef {
|
||||||
op!($ins, val, result => $to);
|
op!($ins, val, result => $to);
|
||||||
|
|
||||||
// Set MXCSR to original value
|
// Set MXCSR to original value
|
||||||
asm!("ldmxcsr {}", in(reg) &mxcsr);
|
asm!("ldmxcsr [{}]", in(reg) &mxcsr);
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue