mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 14:33:25 +00:00
Enable AVX-512 flags in XCR0
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
4292ec2ebb
commit
6cfccccab1
@ -135,7 +135,10 @@ fn enable_common_cpu_features() {
|
||||
}
|
||||
|
||||
let mut xcr0 = x86_64::registers::xcontrol::XCr0::read();
|
||||
xcr0 |= XCr0Flags::AVX | XCr0Flags::SSE;
|
||||
// TODO: Ensure proper saving and restoring of floating-point states
|
||||
// to correctly support advanced instructions like AVX-512.
|
||||
let avx512 = XCr0Flags::OPMASK | XCr0Flags::ZMM_HI256 | XCr0Flags::HI16_ZMM;
|
||||
xcr0 |= XCr0Flags::AVX | XCr0Flags::SSE | avx512;
|
||||
unsafe {
|
||||
x86_64::registers::xcontrol::XCr0::write(xcr0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user