From cf6472df90d1bb656b12a16005d11c0cfaf49fc4 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Thu, 16 Oct 2025 08:53:58 +0200 Subject: [PATCH] Revert "asm_tests: Fix quiet and signalling nan propagation" This reverts commit c480b0ba4151799620927e557e8e58397a409285. --- unittests/32Bit_ASM/CMakeLists.txt | 2 +- .../32Bit_ASM/Includes/nan_test_macros.inc | 130 ------------------ .../X87/x87_32bit_qnan_preservation.asm | 36 ----- .../X87/x87_32bit_snan_preservation.asm | 36 ----- .../32Bit_ASM/X87/x87_neg_snan_roundtrip.asm | 34 ----- .../32Bit_ASM/X87/x87_snan_preservation.asm | 36 ----- .../32Bit_ASM/X87/x87_snan_roundtrip.asm | 35 ----- unittests/ASM/Includes/nan_test_macros.inc | 128 ----------------- .../ASM/X87/x87_32bit_qnan_preservation.asm | 35 ----- .../ASM/X87/x87_32bit_snan_preservation.asm | 35 ----- unittests/ASM/X87/x87_neg_snan_roundtrip.asm | 33 ----- unittests/ASM/X87/x87_qnan_preservation.asm | 33 ----- unittests/ASM/X87/x87_snan_preservation.asm | 35 ----- unittests/ASM/X87/x87_snan_roundtrip.asm | 33 ----- .../x87_32bit_qnan_preservation_F64.asm | 35 ----- .../x87_32bit_snan_preservation_F64.asm | 37 ----- .../X87_F64/x87_neg_snan_roundtrip_F64.asm | 35 ----- .../ASM/X87_F64/x87_qnan_preservation_F64.asm | 35 ----- .../ASM/X87_F64/x87_snan_preservation_F64.asm | 37 ----- .../ASM/X87_F64/x87_snan_roundtrip_F64.asm | 35 ----- 20 files changed, 1 insertion(+), 854 deletions(-) delete mode 100644 unittests/32Bit_ASM/Includes/nan_test_macros.inc delete mode 100644 unittests/32Bit_ASM/X87/x87_32bit_qnan_preservation.asm delete mode 100644 unittests/32Bit_ASM/X87/x87_32bit_snan_preservation.asm delete mode 100644 unittests/32Bit_ASM/X87/x87_neg_snan_roundtrip.asm delete mode 100644 unittests/32Bit_ASM/X87/x87_snan_preservation.asm delete mode 100644 unittests/32Bit_ASM/X87/x87_snan_roundtrip.asm delete mode 100644 unittests/ASM/Includes/nan_test_macros.inc delete mode 100644 unittests/ASM/X87/x87_32bit_qnan_preservation.asm delete mode 100644 unittests/ASM/X87/x87_32bit_snan_preservation.asm delete mode 100644 unittests/ASM/X87/x87_neg_snan_roundtrip.asm delete mode 100644 unittests/ASM/X87/x87_qnan_preservation.asm delete mode 100644 unittests/ASM/X87/x87_snan_preservation.asm delete mode 100644 unittests/ASM/X87/x87_snan_roundtrip.asm delete mode 100644 unittests/ASM/X87_F64/x87_32bit_qnan_preservation_F64.asm delete mode 100644 unittests/ASM/X87_F64/x87_32bit_snan_preservation_F64.asm delete mode 100644 unittests/ASM/X87_F64/x87_neg_snan_roundtrip_F64.asm delete mode 100644 unittests/ASM/X87_F64/x87_qnan_preservation_F64.asm delete mode 100644 unittests/ASM/X87_F64/x87_snan_preservation_F64.asm delete mode 100644 unittests/ASM/X87_F64/x87_snan_roundtrip_F64.asm diff --git a/unittests/32Bit_ASM/CMakeLists.txt b/unittests/32Bit_ASM/CMakeLists.txt index bce760836..462b319d4 100644 --- a/unittests/32Bit_ASM/CMakeLists.txt +++ b/unittests/32Bit_ASM/CMakeLists.txt @@ -38,7 +38,7 @@ foreach(ASM_SRC ${ASM_SOURCES}) add_custom_command(OUTPUT ${OUTPUT_NAME} DEPENDS "${TMP_FILE}" - COMMAND "nasm" ARGS "-i" "${CMAKE_SOURCE_DIR}/unittests/32Bit_ASM/Includes/" "${TMP_FILE}" "-o" "${OUTPUT_NAME}") + COMMAND "nasm" ARGS "${TMP_FILE}" "-o" "${OUTPUT_NAME}") add_custom_command(OUTPUT ${OUTPUT_CONFIG_NAME} DEPENDS "${ASM_SRC}" diff --git a/unittests/32Bit_ASM/Includes/nan_test_macros.inc b/unittests/32Bit_ASM/Includes/nan_test_macros.inc deleted file mode 100644 index c730fc915..000000000 --- a/unittests/32Bit_ASM/Includes/nan_test_macros.inc +++ /dev/null @@ -1,130 +0,0 @@ -; NaN Testing Macros for 32-bit Assembly Tests -; Implements NaN triple testing system: -; - Bit 2: 1 if value is NaN -; - Bit 1: 1 if quiet NaN -; - Bit 0: 1 if signaling NaN -; -; Triple values: -; 0b000 (0): Not a NaN -; 0b101 (5): Signaling NaN -; 0b110 (6): Quiet NaN -; -; ASSUMPTION: All input pointers (edx) are valid and non-null - -; Macro: CHECK_NAN_TRIPLE_32 -; Checks 32-bit float NaN classification and returns triple in EAX -; Input: 32-bit float value in xmm0 -; Output: NaN triple in EAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_32 0 - push ecx - push esi - push edx - - xor eax, eax - ucomiss xmm0, xmm0 - setp al - mov ecx, eax - shl ecx, 2 - - ; Extract and check quiet bit (bit 22) - movd edx, xmm0 - and edx, 0x00400000 - mov esi, edx - shr esi, 22 - and esi, eax - and esi, 1 - shl esi, 1 - add ecx, esi - - ; Check for signaling NaN (NaN but not quiet) - test edx, edx - sete dl - and dl, al - movzx eax, dl - or eax, ecx - - pop edx - pop esi - pop ecx -%endmacro - -; Macro: CHECK_NAN_TRIPLE_64 -; Checks 64-bit double NaN classification and returns triple in EAX -; Input: 64-bit double value should be pre-stored at [edx] by caller -; Output: NaN triple in EAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_64 0 - push ebx - push esi - sub esp, 12 - - ; Load 64-bit double and use SSE for NaN comparison - movsd xmm0, qword [edx] - xor eax, eax - ucomisd xmm0, xmm0 - setp al - - mov ecx, eax - movsd qword [esp], xmm0 - mov edx, 524288 - and edx, [esp + 4] - shl ecx, 2 - - ; Extract quiet bit (bit 51) - mov ebx, edx - shr ebx, 19 - and bl, al - movzx esi, bl - lea ecx, [ecx + 2*esi] - - ; Check for signaling NaN (NaN but not quiet) - test edx, edx - sete dl - and dl, al - movzx eax, dl - or eax, ecx - - add esp, 12 - pop esi - pop ebx -%endmacro - -; Macro: CHECK_NAN_TRIPLE_80 -; Checks 80-bit extended precision NaN classification and returns triple in EAX -; Input: 80-bit extended precision value in memory at [eax] (10 bytes) -; Output: NaN triple in EAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_80 0 - push ebx - push esi - sub esp, 20 - - ; Load the 80-bit value and store copy for bit manipulation - fld tword [eax] - fld st0 - fstp tword [esp] - - ; Get bits 63:32 from stored significand - mov ecx, [esp + 4] - xor eax, eax - fucomip st0 - setp al - mov edx, eax - shl edx, 2 - - ; Extract quiet bit (bit 30 in high dword) - mov ebx, ecx - shr ebx, 30 - and bl, al - movzx esi, bl - lea edx, [edx + 2*esi] - - ; Check for signaling NaN using bt instruction - bt ecx, 30 - setae cl - and cl, al - movzx eax, cl - or eax, edx - - add esp, 20 - pop esi - pop ebx -%endmacro diff --git a/unittests/32Bit_ASM/X87/x87_32bit_qnan_preservation.asm b/unittests/32Bit_ASM/X87/x87_32bit_qnan_preservation.asm deleted file mode 100644 index bc216b046..000000000 --- a/unittests/32Bit_ASM/X87/x87_32bit_qnan_preservation.asm +++ /dev/null @@ -1,36 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Mode": "32BIT" -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 quiet NaN preservation in non-reduced precision mode (32-bit) -; This test verifies that FLDT loads a quiet NaN and preserves its nature -; We test that loading a quiet nan preserves it -; that then storing it as 32bit, keeps it as a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea edx, [.data] -fld tword [edx] ; load qnan 80bit -fstp dword [edx + 16] ; store qnan as 32bit - -; Check the stored 32-bit value using NaN triple macro -lea edx, [.data + 16] -movss xmm0, [edx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -.data: - dq 0xc000000000000000 ; quiet NaN significand - dw 0x7fff ; NaN exponent - dd 0 ; space for 32-bit result \ No newline at end of file diff --git a/unittests/32Bit_ASM/X87/x87_32bit_snan_preservation.asm b/unittests/32Bit_ASM/X87/x87_32bit_snan_preservation.asm deleted file mode 100644 index 96b5e4d22..000000000 --- a/unittests/32Bit_ASM/X87/x87_32bit_snan_preservation.asm +++ /dev/null @@ -1,36 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Mode": "32BIT" -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in non-reduced precision mode (32-bit) -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 32bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN (converted from signaling) - -finit -lea edx, [.data] -fld tword [edx] ; load snan -fstp dword [edx + 16] ; store snan as 32bit qnan - -; Check the stored 32-bit value using NaN triple macro -lea edx, [.data + 16] -movss xmm0, [edx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -.data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dd 0 ; space for 32-bit result \ No newline at end of file diff --git a/unittests/32Bit_ASM/X87/x87_neg_snan_roundtrip.asm b/unittests/32Bit_ASM/X87/x87_neg_snan_roundtrip.asm deleted file mode 100644 index 933d40d5e..000000000 --- a/unittests/32Bit_ASM/X87/x87_neg_snan_roundtrip.asm +++ /dev/null @@ -1,34 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - }, - "Mode": "32BIT" -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling negative NaN round-trip preservation in non-reduced precision mode (32-bit) -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -lea edx, [.data] -fld tword [edx] ; load snan 80bit -fstp tword [edx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -lea eax, [.data + 16] -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -.data: - dq 0xa000000000000000 ; signaling nan significand - dw 0xffff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) \ No newline at end of file diff --git a/unittests/32Bit_ASM/X87/x87_snan_preservation.asm b/unittests/32Bit_ASM/X87/x87_snan_preservation.asm deleted file mode 100644 index 08eb75ee0..000000000 --- a/unittests/32Bit_ASM/X87/x87_snan_preservation.asm +++ /dev/null @@ -1,36 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Mode": "32BIT" -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in non-reduced precision mode (32-bit) -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 64bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -mov edx, .data -fld tword [edx] ; load snan -fstp qword [edx + 16] ; store snan as 64bit qnan - -; Check the stored 64-bit value using NaN triple macro -mov edx, .data -add edx, 16 -CHECK_NAN_TRIPLE_64 - -hlt - -align 8 -.data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dq 0 ; space for 64-bit result \ No newline at end of file diff --git a/unittests/32Bit_ASM/X87/x87_snan_roundtrip.asm b/unittests/32Bit_ASM/X87/x87_snan_roundtrip.asm deleted file mode 100644 index 15f84b650..000000000 --- a/unittests/32Bit_ASM/X87/x87_snan_roundtrip.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - }, - "Mode": "32BIT" -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN round-trip preservation in non-reduced precision mode (32-bit) -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -mov edx, .data -fld tword [edx] ; load nan 80bit -fstp tword [edx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -mov eax, edx -add eax, 16 -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -.data: - dq 0xa000000000000000 ; signaling nan significand - dw 0x7fff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) \ No newline at end of file diff --git a/unittests/ASM/Includes/nan_test_macros.inc b/unittests/ASM/Includes/nan_test_macros.inc deleted file mode 100644 index fc623dbe9..000000000 --- a/unittests/ASM/Includes/nan_test_macros.inc +++ /dev/null @@ -1,128 +0,0 @@ -; NaN Testing Macros for Assembly Tests -; Implements NaN triple testing system: -; - Bit 2: 1 if value is NaN -; - Bit 1: 1 if quiet NaN -; - Bit 0: 1 if signaling NaN -; -; Triple values: -; 0b000 (0): Not a NaN -; 0b101 (5): Signaling NaN -; 0b110 (6): Quiet NaN -; -; ASSUMPTION: All input pointers (rdx) are valid and non-null - -; Macro: CHECK_NAN_TRIPLE_32 -; Checks 32-bit float NaN classification and returns triple in EAX -; Input: 32-bit float value in xmm0 -; Output: NaN triple in EAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_32 0 - push rcx - push rsi - push rdx - - xor eax, eax - ucomiss xmm0, xmm0 - setp al - lea rcx, [4*rax] - - ; Extract and check quiet bit (bit 22) - movd edx, xmm0 - and edx, 0x00400000 - mov esi, edx - shr esi, 22 - and sil, al - movzx esi, sil - lea rcx, [rcx + 2*rsi] - - ; Check for signaling NaN (NaN but not quiet) - test edx, edx - sete dl - and dl, al - movzx eax, dl - or eax, ecx - - pop rdx - pop rsi - pop rcx -%endmacro - -; Macro: CHECK_NAN_TRIPLE_64 -; Checks 64-bit double NaN classification and returns triple in RAX -; Input: 64-bit double value in xmm0 -; Output: NaN triple in RAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_64 0 - push rcx - push rsi - push rdx - - xor eax, eax - ucomisd xmm0, xmm0 - setp al - lea rcx, [4*rax] - - ; Extract and check quiet bit (bit 51) - movq rdx, xmm0 - mov rsi, 0x0008000000000000 - and rsi, rdx - mov rdx, rsi - shr rdx, 51 - and dl, al - movzx rdx, dl - lea rcx, [rcx + 2*rdx] - - ; Check for signaling NaN (NaN but not quiet) - test rsi, rsi - sete dl - and dl, al - movzx eax, dl - or eax, ecx - - pop rdx - pop rsi - pop rcx -%endmacro - -; Macro: CHECK_NAN_TRIPLE_80 -; Checks 80-bit extended precision NaN classification and returns triple in RAX -; Input: 80-bit extended precision value in memory at [rax] (10 bytes) -; Output: NaN triple in RAX (bits 2:0) -%macro CHECK_NAN_TRIPLE_80 0 - push rcx - push rdx - push rsi - - ; Load the 80-bit value twice for comparison - fld tword [rax] - fld tword [rax] - - ; Store one copy to memory for bit manipulation - sub rsp, 16 - fstp tword [rsp] - - ; Use fucomip for NaN detection - xor eax, eax - fucomip st0, st1 - setp al - lea rdx, [4*rax] - - ; Extract and check quiet bit (bit 62) - mov rcx, 0x4000000000000000 - and rcx, [rsp] - mov rsi, rcx - shr rsi, 62 - and sil, al - movzx rsi, sil - lea rdx, [rdx + 2*rsi] - - ; Check for signaling NaN (NaN but not quiet) - test rcx, rcx - sete cl - and cl, al - movzx eax, cl - or eax, edx - - add rsp, 16 - pop rsi - pop rdx - pop rcx -%endmacro diff --git a/unittests/ASM/X87/x87_32bit_qnan_preservation.asm b/unittests/ASM/X87/x87_32bit_qnan_preservation.asm deleted file mode 100644 index 180c1589f..000000000 --- a/unittests/ASM/X87/x87_32bit_qnan_preservation.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 quiet NaN preservation in non-reduced precision mode -; This test verifies that FLDT loads a quiet NaN and preserves its nature -; We test that loading a quiet nan preserves it -; that then storing it as 32bit, keeps it as a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load qnan 80bit -fstp dword [rdx + 16] ; store qnan as 32bit - -; Check the stored 32-bit value using NaN triple macro -lea rdx, [rel data + 16] -movss xmm0, [rdx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -data: - dq 0xc000000000000000 ; quiet NaN significand - dw 0x7fff ; NaN exponent - dd 0 ; space for 32-bit result \ No newline at end of file diff --git a/unittests/ASM/X87/x87_32bit_snan_preservation.asm b/unittests/ASM/X87/x87_32bit_snan_preservation.asm deleted file mode 100644 index 214a11539..000000000 --- a/unittests/ASM/X87/x87_32bit_snan_preservation.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in non-reduced precision mode -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 32bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN (converted from signaling) - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan -fstp dword [rdx + 16] ; store snan as 32bit qnan - -; Check the stored 32-bit value using NaN triple macro -lea rdx, [rel data + 16] -movss xmm0, [rdx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dd 0 ; space for 32-bit result diff --git a/unittests/ASM/X87/x87_neg_snan_roundtrip.asm b/unittests/ASM/X87/x87_neg_snan_roundtrip.asm deleted file mode 100644 index b1ede0433..000000000 --- a/unittests/ASM/X87/x87_neg_snan_roundtrip.asm +++ /dev/null @@ -1,33 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 signaling negative NaN round-trip preservation in non-reduced precision mode -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan 80bit -fstp tword [rdx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -lea rax, [rel data + 16] -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -data: - dq 0xa000000000000000 ; signaling nan significand - dw 0xffff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) \ No newline at end of file diff --git a/unittests/ASM/X87/x87_qnan_preservation.asm b/unittests/ASM/X87/x87_qnan_preservation.asm deleted file mode 100644 index edafd23e4..000000000 --- a/unittests/ASM/X87/x87_qnan_preservation.asm +++ /dev/null @@ -1,33 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 quiet NaN preservation in non-reduced precision mode -; This test verifies that quiet NaNs remain quiet during conversion -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load qnan 80bit -fstp qword [rdx + 16] ; store qnan as 64bit - -; Check the stored 64-bit value using NaN triple macro -lea rdx, [rel data + 16] -movsd xmm0, [rdx] ; Load 64-bit double into xmm0 -CHECK_NAN_TRIPLE_64 - -hlt - -align 8 -data: - dq 0xc000000000000000 ; quiet NaN significand - dw 0x7fff ; NaN exponent - dq 0 ; space for 64-bit result \ No newline at end of file diff --git a/unittests/ASM/X87/x87_snan_preservation.asm b/unittests/ASM/X87/x87_snan_preservation.asm deleted file mode 100644 index 934bbc3fc..000000000 --- a/unittests/ASM/X87/x87_snan_preservation.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in non-reduced precision mode -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 64bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan -fstp qword [rdx + 16] ; store snan as 64bit qnan - -; Check the stored 64-bit value using NaN triple macro -lea rdx, [rel data + 16] -movsd xmm0, [rdx] ; Load 64-bit double into xmm0 -CHECK_NAN_TRIPLE_64 - -hlt - -align 8 -data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dq 0 ; space for 64-bit result \ No newline at end of file diff --git a/unittests/ASM/X87/x87_snan_roundtrip.asm b/unittests/ASM/X87/x87_snan_roundtrip.asm deleted file mode 100644 index ee2c43413..000000000 --- a/unittests/ASM/X87/x87_snan_roundtrip.asm +++ /dev/null @@ -1,33 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - } -} -%endif - -%include "nan_test_macros.inc" - -mov rsp, 0xe0000040 - -; Test x87 signaling NaN round-trip preservation in non-reduced precision mode -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load nan 80bit -fstp tword [rdx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -lea rax, [rel data + 16] -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -data: - dq 0xa000000000000000 ; signaling nan significand - dw 0x7fff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) \ No newline at end of file diff --git a/unittests/ASM/X87_F64/x87_32bit_qnan_preservation_F64.asm b/unittests/ASM/X87_F64/x87_32bit_qnan_preservation_F64.asm deleted file mode 100644 index 7c0e55f86..000000000 --- a/unittests/ASM/X87_F64/x87_32bit_qnan_preservation_F64.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Env": { "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 quiet NaN preservation in reduced precision mode -; This test verifies that quiet NaNs remain quiet during conversion -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load qnan 80bit -fstp dword [rdx + 16] ; store qnan as 32bit - -; Check the stored 32-bit value using NaN triple macro -lea rdx, [rel data + 16] -movss xmm0, [rdx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -data: - dq 0xc000000000000000 ; quiet NaN significand - dw 0x7fff ; NaN exponent - dd 0 ; space for 32-bit result - diff --git a/unittests/ASM/X87_F64/x87_32bit_snan_preservation_F64.asm b/unittests/ASM/X87_F64/x87_32bit_snan_preservation_F64.asm deleted file mode 100644 index b1ecbef95..000000000 --- a/unittests/ASM/X87_F64/x87_32bit_snan_preservation_F64.asm +++ /dev/null @@ -1,37 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Env": { "FEX_X87REDUCEDPRECISION" : "1", "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in reduced precision mode -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 32bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN (converted from signaling) - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan -fstp dword [rdx + 16] ; store snan as 32bit qnan - -; Check the stored 32-bit value using NaN triple macro -lea rdx, [rel data + 16] -movss xmm0, [rdx] ; Load 32-bit float into xmm0 -CHECK_NAN_TRIPLE_32 - -hlt - -align 8 -data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dd 0 ; space for 32-bit result - diff --git a/unittests/ASM/X87_F64/x87_neg_snan_roundtrip_F64.asm b/unittests/ASM/X87_F64/x87_neg_snan_roundtrip_F64.asm deleted file mode 100644 index 0dac7e0ca..000000000 --- a/unittests/ASM/X87_F64/x87_neg_snan_roundtrip_F64.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - }, - "Env": { "FEX_X87REDUCEDPRECISION" : "1", "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling negative NaN round-trip preservation in reduced precision mode -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan 80bit -fstp tword [rdx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -lea rax, [rel data + 16] -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -data: - dq 0xa000000000000000 ; signaling nan significand - dw 0xffff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) - diff --git a/unittests/ASM/X87_F64/x87_qnan_preservation_F64.asm b/unittests/ASM/X87_F64/x87_qnan_preservation_F64.asm deleted file mode 100644 index 4dd09c85c..000000000 --- a/unittests/ASM/X87_F64/x87_qnan_preservation_F64.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Env": { "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 quiet NaN preservation in reduced precision mode -; This test verifies that quiet NaNs remain quiet during conversion -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load qnan 80bit -fstp qword [rdx + 16] ; store qnan as 64bit - -; Check the stored 64-bit value using NaN triple macro -lea rdx, [rel data + 16] -movsd xmm0, [rdx] ; Load 64-bit double into xmm0 -CHECK_NAN_TRIPLE_64 - -hlt - -align 8 -data: - dq 0xc000000000000000 ; quiet NaN significand - dw 0x7fff ; NaN exponent - dq 0 ; space for 64-bit result - diff --git a/unittests/ASM/X87_F64/x87_snan_preservation_F64.asm b/unittests/ASM/X87_F64/x87_snan_preservation_F64.asm deleted file mode 100644 index 4abd58bbe..000000000 --- a/unittests/ASM/X87_F64/x87_snan_preservation_F64.asm +++ /dev/null @@ -1,37 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "6" - }, - "Env": { "FEX_X87REDUCEDPRECISION" : "1", "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN non-preservation in reduced precision mode -; This test verifies that FLDT loads a signaling NaN and DOES NOT preserve its signaling nature -; We test that loading a signaling nan preserves it but -; that then storing it as 64bit, transforms it to a quiet nan. -; Returns NaN triple: 6 (0b110) for quiet NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load snan -fstp qword [rdx + 16] ; store snan as 64bit qnan - -; Check the stored 64-bit value using NaN triple macro -lea rdx, [rel data + 16] -movsd xmm0, [rdx] ; Load 64-bit double into xmm0 -CHECK_NAN_TRIPLE_64 - -hlt - -align 8 -data: - dq 0xa000000000000000 ; signaling NaN significand - dw 0x7fff ; signaling NaN exponent - dq 0 ; space for 64-bit result - diff --git a/unittests/ASM/X87_F64/x87_snan_roundtrip_F64.asm b/unittests/ASM/X87_F64/x87_snan_roundtrip_F64.asm deleted file mode 100644 index f20724b84..000000000 --- a/unittests/ASM/X87_F64/x87_snan_roundtrip_F64.asm +++ /dev/null @@ -1,35 +0,0 @@ -%ifdef CONFIG -{ - "RegData": { - "RAX": "5" - }, - "Env": { "FEX_X87REDUCEDPRECISION" : "1", "FEX_X87STRICTREDUCEDPRECISION" : "1" } -} -%endif - -%include "nan_test_macros.inc" - -mov esp, 0xe0000040 - -; Test x87 signaling NaN round-trip preservation in reduced precision mode -; This test verifies that FLDT -> FSTPT preserves signaling nan across round-trip -; Returns NaN triple: 5 (0b101) for signaling NaN - -finit -lea rdx, [rel data] -fld tword [rdx] ; load nan 80bit -fstp tword [rdx + 16] ; store nan as 80bit - -; Check the stored 80-bit value using NaN triple macro -lea rax, [rel data + 16] -CHECK_NAN_TRIPLE_80 - -hlt - -align 16 -data: - dq 0xa000000000000000 ; signaling nan significand - dw 0x7fff ; signaling nan exponent - dw 0, 0, 0 ; padding to 16 bytes - dq 0, 0 ; space for 80-bit result (16 bytes) -