Implement SSE instructions

This commit is contained in:
2026-03-07 17:36:09 +01:00
parent 40bfc1e916
commit 5e616c1879
16 changed files with 80 additions and 15 deletions

19
kernel/amd64/fx.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef _KERNEL_AMD64_FX_H
#define _KERNEL_AMD64_FX_H
#define fx_save(buf) \
do { \
__asm__ volatile ("fxsave64 (%0)" ::"r"((buf)) : "memory"); \
} while (0)
#define fx_restore(buf) \
do { \
__asm__ volatile ("fxrstor64 (%0)" ::"r"((buf)) : "memory"); \
} while (0)
#define fx_init(buf) \
do { \
__asm__ volatile ("fninit; fxsave64 (%0)" ::"r"((buf)) : "memory"); \
} while (0)
#endif // _KERNEL_AMD64_FX_H