WIP FPC-III support
[linux/fpc-iii.git] / arch / x86 / include / asm / fpu / xcr.h
blob1c7ab8d95da5ab2bef213081db153e5b7738a9c8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_FPU_XCR_H
3 #define _ASM_X86_FPU_XCR_H
5 /*
6 * MXCSR and XCR definitions:
7 */
9 static inline void ldmxcsr(u32 mxcsr)
11 asm volatile("ldmxcsr %0" :: "m" (mxcsr));
14 extern unsigned int mxcsr_feature_mask;
16 #define XCR_XFEATURE_ENABLED_MASK 0x00000000
18 static inline u64 xgetbv(u32 index)
20 u32 eax, edx;
22 asm volatile("xgetbv" : "=a" (eax), "=d" (edx) : "c" (index));
23 return eax + ((u64)edx << 32);
26 static inline void xsetbv(u32 index, u64 value)
28 u32 eax = value;
29 u32 edx = value >> 32;
31 asm volatile("xsetbv" :: "a" (eax), "d" (edx), "c" (index));
34 #endif /* _ASM_X86_FPU_XCR_H */