From fcb37cb7d69e8272e0917a3735311cab96f92e17 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 22 Mar 2021 13:12:53 -0700 Subject: [PATCH] Fix asm! from AT&T to Intel syntax --- library/core/src/num/dec2flt/algorithm.rs | 4 ++-- library/std/src/sys/sgx/abi/mem.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/num/dec2flt/algorithm.rs b/library/core/src/num/dec2flt/algorithm.rs index a88bcdbaed0..313b6870ac9 100644 --- a/library/core/src/num/dec2flt/algorithm.rs +++ b/library/core/src/num/dec2flt/algorithm.rs @@ -62,7 +62,7 @@ fn set_cw(cw: u16) { // any `u16` unsafe { asm!( - "fldcw ({})", + "fldcw word ptr [{}]", in(reg) &cw, options(nostack), ) @@ -86,7 +86,7 @@ pub fn set_precision() -> FPUControlWord { // any `u16` unsafe { asm!( - "fnstcw ({})", + "fnstcw word ptr [{}]", in(reg) &mut cw, options(nostack), ) diff --git a/library/std/src/sys/sgx/abi/mem.rs b/library/std/src/sys/sgx/abi/mem.rs index 9c593a00511..1e743894a9f 100644 --- a/library/std/src/sys/sgx/abi/mem.rs +++ b/library/std/src/sys/sgx/abi/mem.rs @@ -36,7 +36,7 @@ pub fn image_base() -> u64 { let base: u64; unsafe { asm!( - "lea IMAGE_BASE(%rip), {}", + "lea {}, qword ptr [rip + IMAGE_BASE]", lateout(reg) base, options(nostack, preserves_flags, nomem, pure), ) -- GitLab