Import the base tree (MIT, see LICENSE)

This commit is contained in:
Valiantsin Dzerakh
2026-11-04 22:16:41 +03:00
committed by chrg6
commit 0478c13e45
734 changed files with 233953 additions and 0 deletions

12
runtime/platform/fp_x86.h Normal file
View File

@@ -0,0 +1,12 @@
// FP control on x86-64: MXCSR (rounding control bits 13-14, FTZ bit 15, DAZ bit 6, exception flags and masks).
// Inline on purpose: lifted FP code (simd.h) reads and writes it on every operation that depends on the guest FPCR.
#pragma once
#include <stdint.h>
#include <xmmintrin.h>
#define PLAT_FP_RC_MASK 0x6000u // rounding control: 0 nearest, 0x2000 down, 0x4000 up, 0x6000 toward zero
#define PLAT_FP_FTZ 0x8000u
#define PLAT_FP_DAZ 0x0040u
static inline uint32_t plat_fp_get(void) { return _mm_getcsr(); }
static inline void plat_fp_set(uint32_t v) { _mm_setcsr(v); }