pub fn enable_sse() {
    // Follow the protocol described in Intel SDM, 13.1.3 Initialization of the SSE Extensions
    unsafe {
        let mut cr4 = controlregs::cr4();
        // Operating system provides facilities for saving and restoring SSE state
        // using FXSAVE and FXRSTOR instructions
        cr4 |= controlregs::Cr4::CR4_ENABLE_SSE;
        // The operating system provides a SIMD floating-point exception (#XM) handler
        //cr4 |= x86::controlregs::Cr4::CR4_UNMASKED_SSE;
        controlregs::cr4_write(cr4);

        let mut cr0 = controlregs::cr0();
        // Disables emulation of the x87 FPU
        cr0 &= !controlregs::Cr0::CR0_EMULATE_COPROCESSOR;
        // Required for Intel 64 and IA-32 processors that support the SSE
        cr0 |= controlregs::Cr0::CR0_MONITOR_COPROCESSOR;
        controlregs::cr0_write(cr0);
    }
}
/// Enable SSE functionality and disable the old x87 FPU.
/// (yes this goes against conventional
/// wisdom that thinks SSE instructions in the
/// kernel are a bad idea)
///
/// # TODO
/// This is public because of the integration tests (and ideally shouldn't be).
Enable SSE functionality and disable the old x87 FPU.
(yes this goes against conventional
wisdom that thinks SSE instructions in the
kernel are a bad idea)
Enable SSE functionality and disable the old x87 FPU . ( yes this goes against conventional wisdom that thinks SSE instructions in the kernel are a bad idea )
pub fn enable_sse() {
    // Follow the protocol described in Intel SDM, 13.1.3 Initialization of the SSE Extensions
    unsafe {
        let mut cr4 = controlregs::cr4();
        // Operating system provides facilities for saving and restoring SSE state
        // using FXSAVE and FXRSTOR instructions
        cr4 |= controlregs::Cr4::CR4_ENABLE_SSE;
        // The operating system provides a SIMD floating-point exception (#XM) handler
        //cr4 |= x86::controlregs::Cr4::CR4_UNMASKED_SSE;
        controlregs::cr4_write(cr4);
        let mut cr0 = controlregs::cr0();
        // Disables emulation of the x87 FPU
        cr0 &= !controlregs::Cr0::CR0_EMULATE_COPROCESSOR;
        // Required for Intel 64 and IA-32 processors that support the SSE
        cr0 |= controlregs::Cr0::CR0_MONITOR_COPROCESSOR;
        controlregs::cr0_write(cr0);
    }
}
pub fn enable_sse ( ) { // Follow the protocol described in Intel SDM, 13.1.3 Initialization of the SSE Extensions unsafe { let mut cr4 = controlregs :: cr4 ( ) ; // Operating system provides facilities for saving and restoring SSE state // using FXSAVE and FXRSTOR instructions cr4 |= controlregs :: Cr4 :: CR4_ENABLE_SSE ; // The operating system provides a SIMD floating-point exception (#XM) handler //cr4 |= x86::controlregs::Cr4::CR4_UNMASKED_SSE; controlregs :: cr4_write ( cr4 ) ; let mut cr0 = controlregs :: cr0 ( ) ; // Disables emulation of the x87 FPU cr0 &= ! controlregs :: Cr0 :: CR0_EMULATE_COPROCESSOR ; // Required for Intel 64 and IA-32 processors that support the SSE cr0 |= controlregs :: Cr0 :: CR0_MONITOR_COPROCESSOR ; controlregs :: cr0_write ( cr0 ) ; } }
Enable SSE functionality and disable the old x87 FPU.
Enable SSE functionality and disable the old x87 FPU .
todo
This is public because of the integration tests (and ideally shouldn't be).
This is public because of the integration tests ( and ideally shouldn ' t be ) .