Remove the FP area initialization code

When using the optimized string lib in Occlum, the memset function would
use xmm0 register, as the result, the FP area initialization code would
modify the FP area before saving it. So just ignor the FP area
initialization code.
This commit is contained in:
zongmin.gu 2020-10-21 08:37:47 +08:00 committed by Tate, Hongliang Tian
parent 5f05c16700
commit d63bfac61c

@ -908,11 +908,11 @@ pub struct FpRegs {
impl FpRegs { impl FpRegs {
/// Save the current CPU floating pointer states to an instance of FpRegs /// Save the current CPU floating pointer states to an instance of FpRegs
pub fn save() -> Self { pub fn save() -> Self {
let mut fpregs = FpRegs { let mut fpregs = MaybeUninit::<Self>::uninit();
inner: Aligned([0u8; 512]), unsafe {
}; _fxsave(fpregs.as_mut_ptr() as *mut u8);
unsafe { _fxsave(fpregs.inner.as_mut_ptr()) }; fpregs.assume_init()
fpregs }
} }
/// Restore the current CPU floating pointer states from this FpRegs instance /// Restore the current CPU floating pointer states from this FpRegs instance