From b7280a765d89c4bfb807c0a8effbb5fa088f905a Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Mon, 11 May 2026 14:05:15 +0200 Subject: [PATCH] asm_tests: Re-optimize FYL2X for reduced precision x87 path --- unittests/ASM/X87_F64/D9_F9_2_F64.asm | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 unittests/ASM/X87_F64/D9_F9_2_F64.asm diff --git a/unittests/ASM/X87_F64/D9_F9_2_F64.asm b/unittests/ASM/X87_F64/D9_F9_2_F64.asm new file mode 100644 index 000000000..1940c6b3b --- /dev/null +++ b/unittests/ASM/X87_F64/D9_F9_2_F64.asm @@ -0,0 +1,32 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "1" + }, + "Env": { "FEX_X87REDUCEDPRECISION" : "1" } +} +%endif + +%include "checkprecision.mac" + +mov rsi, 0xe0000000 + +; y=1, x = 0.25 +fld1 +lea rdx, [rel x_quarter] +fld qword [rdx] +fyl2xp1 +fstp qword [rsi] +check_relerr_d rel expected_quarter, rsi, rel tolerance + +hlt + +align 8 +x_quarter: + dq 0x3FD0000000000000 +expected_quarter: + dq 0x3FD49A784BCD1B87 ; matches the LUT-based F64 FYL2X path +tolerance: + dq 0x3CB0000000000000 ; 2^-52, ~1 ULP relative error + +define_check_data_constants