unittests: Fixes mixture of code and data in the same page

Test behaviour themselves not changed at all, just data moved or
aligned.

For tests that aren't explicitly testing out SMC behaviour, we were
accidentally relying on some aggressive SMC tracking by mixing data and
code in the same page. To fix this just align the test's data to the
next page boundary which means FEX's SMC tracking won't get triggered
since it is no longer living in the same page.

This has been a thorn for a while, so just get rid of it. We obviously
still have ASM tests that still exist that /do/ rely on SMC, and those
are still expected to work.
This commit is contained in:
Ryan Houdek committed 2025-10-20 16:46:36 -07:00
1 parent edde5c8516
commit 7937b7e52d
382 files changed
+630 -664

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ vpinsrd xmm5, dword [rel .data_temp + 8], 1
hlt
align 16
align 4096
.data_xmm0:
dq 0x400c000000000000, 0x400c000000000000
.data_xmm1:
@@ -14,6 +14,7 @@ movzx eax, word [rel data]
mov ebx, dword [rel data + 2]
hlt
align 4096
data:
; Limit
dw 0
@@ -48,7 +48,7 @@ vgatherqpd xmm7, [xmm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd xmm7, [xmm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd xmm7, [xmm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd xmm7, [xmm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -48,7 +48,7 @@ vgatherqpd ymm7, [ymm0 * 1 + eax + 1], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd ymm7, [ymm0 * 2 + eax + 2], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd ymm7, [ymm0 * 4 + eax + 4], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vgatherqpd ymm7, [ymm0 * 8 + eax + 8], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -48,7 +48,7 @@ vgatherqps xmm7, [xmm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [xmm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [xmm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [xmm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -48,7 +48,7 @@ vgatherqps xmm7, [ymm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [ymm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [ymm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vgatherqps xmm7, [ymm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -48,7 +48,7 @@ vpgatherqd xmm7, [xmm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [xmm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [xmm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [xmm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -48,7 +48,7 @@ vpgatherqd xmm7, [ymm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [ymm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [ymm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -52,7 +52,7 @@ vpgatherqd xmm7, [ymm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_11111111:
dd 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000, 0x8000_0000
@@ -48,7 +48,7 @@ vpgatherqq xmm7, [xmm0 * 1 + eax + 1], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq xmm7, [xmm0 * 2 + eax + 2], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq xmm7, [xmm0 * 4 + eax + 4], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq xmm7, [xmm0 * 8 + eax + 8], xmm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -48,7 +48,7 @@ vpgatherqq ymm7, [ymm0 * 1 + eax + 1], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq ymm7, [ymm0 * 2 + eax + 2], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq ymm7, [ymm0 * 4 + eax + 4], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
@@ -52,7 +52,7 @@ vpgatherqq ymm7, [ymm0 * 8 + eax + 8], ymm1
hlt
align 32
align 4096
.mask_1111:
dq 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000, 0x8000_0000_0000_0000
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
fst dword [edx + 8 * 1]
@@ -17,6 +17,7 @@ mov eax, [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x3f800000
dq 0
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
fstp dword [edx + 8 * 2]
@@ -18,6 +18,7 @@ mov eax, [edx + 8 * 2]
hlt
align 4096
.data:
dq 0x3f800000
dq 0x40000000
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
o16 fstenv [edx + 8 * 3]
@@ -40,6 +40,7 @@ fld dword [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x3f800000
dq 0x40000000
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
o32 fstenv [edx + 8 * 3]
@@ -40,6 +40,7 @@ fld dword [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x3f800000
dq 0x40000000
+4 -10
View File
@@ -20,16 +20,6 @@
; Then do fincstp and store the stack values into MMX registers through memory
; such that MM0 has the value of ST0 and so on.
section .bss
align 8
temp: resq 1
stack: resq 8
section .text
global _start
_start:
mov eax, 0x3ff00000 ; 1.0
mov [rel temp], eax
fld dword [rel temp]
@@ -100,3 +90,7 @@ movq mm6, [rel stack + 8 * 6]
movq mm7, [rel stack + 8 * 7]
hlt
align 4096
temp: dq 0
stack: times 8 dq 0
+4 -10
View File
@@ -20,16 +20,6 @@
; Then do fincstp and store the stack values into MMX registers through memory
; such that MM0 has the value of ST0 and so on.
section .bss
align 8
temp: resq 1
stack: resq 8
section .text
global _start
_start:
mov eax, 0x3ff00000 ; 1.0
mov [rel temp], eax
fld dword [rel temp]
@@ -99,3 +89,7 @@ movq mm6, [rel stack + 8 * 6]
movq mm7, [rel stack + 8 * 7]
hlt
align 4096
temp: dq 0
stack: times 8 dq 0
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fiadd dword [edx + 8 * 1]
@@ -18,7 +18,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fiadd dword [edx + 8 * 1]
@@ -29,6 +29,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fimul dword [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fimul dword [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fisub dword [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fisub dword [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fisubr dword [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fisubr dword [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fidiv dword [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fidiv dword [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fidivr dword [edx + 8 * 1]
@@ -17,7 +17,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fidivr dword [edx + 8 * 1]
@@ -27,6 +27,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
@@ -20,6 +20,7 @@ mov eax, [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x44800000
dq 0
+2 -1
View File
@@ -9,7 +9,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
@@ -21,6 +21,7 @@ mov eax, [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x44800000
dq 0
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
fistp dword [edx + 8 * 1]
@@ -19,6 +19,7 @@ mov eax, [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x44800000
dq 0
+3 -3
View File
@@ -7,16 +7,16 @@
}
%endif
lea edx, [data]
lea edx, [rel data]
fld tword [edx + 8 * 0]
lea edx, [data2]
lea edx, [rel data2]
fstp tword [edx + 8 * 0]
fld tword [edx + 8 * 0]
hlt
align 8
align 4096
data:
dt 2.0
dq 0
+4 -6
View File
@@ -7,12 +7,6 @@
}
%endif
section .bss
control: resb 2 ; Reserve space for the FPU control word
section .text
global _start
_start:
fninit
; Ensures that fnstcw after fninit sets the correct value
@@ -20,3 +14,7 @@ fnstcw [rel control]
mov ax, word [rel control]
hlt
align 4096
control:
times 2 db 0 ; Reserve space for the FPU control word
+4 -4
View File
@@ -9,21 +9,21 @@
}
%endif
lea edx, [data]
lea edx, [rel data]
fld tword [edx + 8 * 0]
lea edx, [data3]
lea edx, [rel data3]
fisttp qword [edx + 8 * 0]
mov eax, [edx + 4 * 0]
mov ebx, [edx + 4 * 1]
lea edx, [data2]
lea edx, [rel data2]
fld tword [edx + 8 * 0]
hlt
align 8
align 4096
data:
dt 2.0
dq 0
+4 -4
View File
@@ -10,21 +10,21 @@
}
%endif
lea edx, [data]
lea edx, [rel data]
fld tword [edx + 8 * 0]
lea edx, [data3]
lea edx, [rel data3]
fst qword [edx + 8 * 0]
mov eax, [edx + 4 * 0]
mov ebx, [edx + 4 * 1]
lea edx, [data2]
lea edx, [rel data2]
fld tword [edx + 8 * 0]
hlt
align 8
align 4096
data:
dt 2.0
dq 0
+4 -4
View File
@@ -9,21 +9,21 @@
}
%endif
lea edx, [data]
lea edx, [rel data]
fld tword [edx + 8 * 0]
lea edx, [data3]
lea edx, [rel data3]
fstp qword [edx + 8 * 0]
mov eax, [edx + 4 * 0]
mov ebx, [edx + 4 * 1]
lea edx, [data2]
lea edx, [rel data2]
fld tword [edx + 8 * 0]
hlt
align 8
align 4096
data:
dt 2.0
dq 0
+2 -1
View File
@@ -22,7 +22,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fldz
fild word [edx + 2 * 1]
@@ -81,6 +81,7 @@ psrldq xmm7, 6
hlt
align 4096
.data:
dw 0
dw 2
+2 -1
View File
@@ -22,7 +22,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fldz
fild word [edx + 2 * 1]
@@ -81,6 +81,7 @@ psrldq xmm7, 6
hlt
align 4096
.data:
dw 0
dw 2
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
mov eax, -1
mov ebx, -1
@@ -21,6 +21,7 @@ mov bx, word [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x3f800000
dq 0
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fiadd word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fiadd word [edx + 8 * 1]
@@ -27,6 +27,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fimul word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fimul word [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fisub word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fisub word [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fisubr word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fisubr word [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fidiv word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fidiv word [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+3 -2
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld qword [edx + 8 * 0]
fidivr word [edx + 8 * 1]
@@ -16,7 +16,7 @@ fstp tword [rel data2]
movups xmm0, [rel data2]
; Test negative
lea edx, [.data_neg]
lea edx, [rel .data_neg]
fld qword [edx + 8 * 0]
fidivr word [edx + 8 * 1]
@@ -25,6 +25,7 @@ movups xmm1, [rel data2]
hlt
align 4096
.data:
dq 0x3ff0000000000000
dq 2
+4 -4
View File
@@ -8,20 +8,20 @@
}
%endif
lea edx, [data]
lea edx, [rel data]
fld tword [edx + 8 * 0]
lea edx, [data3]
lea edx, [rel data3]
fisttp word [edx + 8 * 0]
mov ax, word [edx + 8 * 0]
lea edx, [data2]
lea edx, [rel data2]
fld tword [edx + 8 * 0]
hlt
align 8
align 4096
data:
dt 2.0
dq 0
+2 -1
View File
@@ -9,7 +9,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
@@ -22,6 +22,7 @@ mov ax, word [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x44800000
dq -1
+2 -1
View File
@@ -8,7 +8,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
@@ -21,6 +21,7 @@ mov ax, word [edx + 8 * 1]
hlt
align 4096
.data:
dq 0x44800000
dq -1
+2 -1
View File
@@ -9,7 +9,7 @@
}
%endif
lea edx, [.data]
lea edx, [rel .data]
fld dword [edx + 8 * 0]
@@ -22,6 +22,7 @@ mov ebx, dword [edx + 4 * 3]
hlt
align 4096
.data:
dq 0x44800000
dq -1
+6 -5
View File
@@ -15,11 +15,6 @@
}
%endif
section .bss
base resb 4096
section .text
; Setup
fld1
lea edx, [rel base]
@@ -42,3 +37,9 @@ mov edi, dword [edx + esi + 0xa]
mov esp, dword [edx + esi * 4 + 0xa]
hlt
align 4096
section .bss
base resb 4096
section .text
+12 -16
View File
@@ -15,22 +15,6 @@
}
%endif
section .data
align 4
nmidpoint:
dd -1.5
nsamidpoint:
dd -1.49999
nsbmidpoint:
dd -1.50001
section .bss
align 4
tmp resd 1
section .text
; Rounding tests to ensure rounding modes are actually working
;;; Negative tests
;; Mid-point
@@ -174,3 +158,15 @@ mov bp, word [rel tmp]
or edi, ebp
hlt
align 4096
nmidpoint:
dd -1.5
nsamidpoint:
dd -1.49999
nsbmidpoint:
dd -1.50001
align 4
tmp:
dd 0
+12 -15
View File
@@ -11,21 +11,6 @@
}
%endif
section .data
align 4
midpoint:
dd 1.5
samidpoint:
dd 1.50001
sbmidpoint:
dd 1.49999
section .bss
align 4
tmp resd 1
section .text
; Rounding tests to ensure rounding modes are actually working
;; Mid-point
finit
@@ -161,3 +146,15 @@ fistp dword [rel tmp]
or ecx, dword [rel tmp]
hlt
align 4096
midpoint:
dd 1.5
samidpoint:
dd 1.50001
sbmidpoint:
dd 1.49999
align 4
tmp:
dd 0
@@ -22,5 +22,6 @@ and eax, 1
hlt
align 4096
.data:
dd 0
@@ -21,6 +21,7 @@ and eax, 1
hlt
align 4096
.large_value:
dt 1e20
.data:
@@ -24,5 +24,6 @@ and eax, 1
hlt
align 4096
.thirty: dd 30
.dummy: dw 0
@@ -24,5 +24,6 @@ and eax, 1
hlt
align 4096
.forty: dd 40
.dummy: dd 0
@@ -24,5 +24,6 @@ and eax, 1
hlt
align 4096
.seventyfive: dd 75
.dummy: dq 0
@@ -24,6 +24,7 @@ and eax, 1
hlt
align 4096
.pos_inf:
dq 0
dw 0
@@ -24,6 +24,7 @@ and eax, 1
hlt
align 4096
.pos_inf:
dq 0
dw 0
@@ -24,6 +24,7 @@ and eax, 1
hlt
align 4096
.pos_inf:
dq 0
dw 0
@@ -11,8 +11,8 @@
; Setup memory with +infinity (0x7FF0000000000000 for double precision +infinity)
; In 32-bit mode, we need to store the double in two parts
mov dword [.data], 0x00000000 ; Low 32 bits
mov dword [.data+4], 0x7FF00000 ; High 32 bits
mov dword [rel .data], 0x00000000 ; Low 32 bits
mov dword [rel .data+4], 0x7FF00000 ; High 32 bits
; Create +infinity by dividing 1.0 by 0.0
fld1
@@ -20,7 +20,7 @@ fldz
fdiv
; Subtract ∞ - ∞ using memory operand - this should be invalid
fsub qword [.data]
fsub qword [rel .data]
fstsw ax
and eax, 1
@@ -28,4 +28,5 @@ and eax, 1
hlt
section .data
.data: dq 0
align 4096
.data: dq 0
@@ -9,12 +9,12 @@
; Test Invalid Operation with reduced precision (64-bit)
; Set precision control to 64-bit (PC = 10b)
fnstcw [.saved_cw]
mov ax, [.saved_cw]
fnstcw [rel .saved_cw]
mov ax, [rel .saved_cw]
and ax, 0xFCFF
or ax, 0x0200
mov [.new_cw], ax
fldcw [.new_cw]
mov [rel .new_cw], ax
fldcw [rel .new_cw]
; Perform invalid operation: 0.0 / 0.0
fldz
@@ -25,9 +25,10 @@ fstsw ax
and eax, 1
; Restore original control word
fldcw [.saved_cw]
fldcw [rel .saved_cw]
hlt
align 4096
.saved_cw: dw 0
.new_cw: dw 0
+4 -3
View File
@@ -12,18 +12,19 @@
; Load a value that fits in int16 range
finit
fld qword [.value]
fld qword [rel .value]
; Convert to int16 - this should work without overflow
fistp word [.result]
fistp word [rel .result]
fstsw ax
and eax, 1
; Load the result to verify conversion worked
movzx ebx, word [.result]
movzx ebx, word [rel .result]
hlt
align 4096
.value: dq 12345.75
.result: dw 0
+7 -9
View File
@@ -57,16 +57,14 @@ and ebx, eax
hlt
section .bss
align 32
result11: resd 1
result12: resd 1
result21: resd 1
result22: resd 1
result31: resd 1
result32: resd 1
align 4096
result11: dd 0
result12: dd 0
result21: dd 0
result22: dd 0
result31: dd 0
result32: dd 0
section .data
align 8
data1:
dd -1.0
+7 -9
View File
@@ -51,16 +51,14 @@ and ebx, eax
hlt
section .bss
align 32
result11: resd 1
result12: resd 1
result21: resd 1
result22: resd 1
result31: resd 1
result32: resd 1
align 4096
result11: dd 0
result12: dd 0
result21: dd 0
result22: dd 0
result31: dd 0
result32: dd 0
section .data
align 32
data1:
dd 1.0
+3 -5
View File
@@ -68,11 +68,9 @@ pfrcp mm1, [rel data5]
hlt
section .bss
align 8
result resd 1
align 4096
result: dd 0
section .data:
align 8
data1:
dd -1.0
@@ -106,4 +104,4 @@ dd 1.0
tolerance:
dd 0x38800000 ; 2^-14 - 14bit accuracy
define_check_data_constants
define_check_data_constants
+6 -8
View File
@@ -48,14 +48,12 @@ pfrsqrt mm4, [rel data5] ; pfrsqrt(0.0) == inf
pfrsqrt mm5, [rel data6] ; pfrsqrt(-0.0) == -inf
hlt
section .bss
align 8
result1: resb 32
result2: resb 32
result3: resb 32
result4: resb 32
align 4096
result1: times 32 db 0
result2: times 32 db 0
result3: times 32 db 0
result4: times 32 db 0
section .data
align 32
data1:
dd 1.0
@@ -96,4 +94,4 @@ dd -9.0
tolerance:
dd 0x38000000 ; 2^-15 - accurate to 15bits
define_check_data_constants
define_check_data_constants
+1 -1
View File
@@ -23,7 +23,7 @@ ldmxcsr [rel .data_mxcsr]
vaddps xmm1, xmm1, xmm2
hlt
align 32
align 4096
.data_three:
dd 3.0, 0x00cfffff
@@ -111,5 +111,6 @@ mov r15, [rel .data + (15 * 8)]
hlt
align 4096
.data:
times 16 dq 0x4142434445464748
+2 -1
View File
@@ -34,7 +34,8 @@ mov qword [rbp-0x9f0], rax
mov qword [rbp-0x9e8], rdx
hlt
align 16
align 4096
.data:
times 4096 db 0
.data_mid:
+1 -1
View File
@@ -57,7 +57,7 @@ pand xmm7, [rel .x87_mask]
hlt
align 16
align 4096
.save_data:
times 64 dq 0
+1 -1
View File
@@ -56,7 +56,7 @@ pand xmm7, [rel .x87_mask]
hlt
align 16
align 4096
.save_data:
times 64 dq 0
@@ -110,7 +110,8 @@ movups xmm7, [rel .temp_x87_result + (3 * 16)]
movups xmm8, [rel .temp_x87_result + (4 * 16)]
hlt
align 32
align 4096
.temp_x87_result:
times (16 * 8) db 0
@@ -84,6 +84,7 @@ mov edx, dword [rel .results + (4 * 3)]
hlt
align 4096
.results:
dd 0, 0, 0, 0, 0, 0, 0, 0
; 4096 bytes of random data.
@@ -28,6 +28,7 @@ mov rdx, [rel .test + 8]
hlt
align 4096
.test:
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
+1
View File
@@ -76,6 +76,7 @@ movzx ebx, dl
hlt
align 4096
.current_x:
dq 1
@@ -43,7 +43,8 @@ pextrb [rbx + rcx], xmm0, 0
movaps xmm5, [rbx + rcx]
hlt
align 32
align 4096
.data:
dq 0x7172737475767778
dq 0x4142434445464748
@@ -30,6 +30,7 @@ movups xmm0, [rel .data_result]
hlt
align 4096
.data1:
dt 2.0
dq 0
@@ -32,6 +32,7 @@ movups xmm0, [rel .data_result]
hlt
align 4096
; This or zero are incorrect results
.data1:
dt 2.0
+1
View File
@@ -63,6 +63,7 @@ mov rsp, qword [rel .data_result + (8 * 7)]
hlt
align 4096
.data_big:
dq 83403126337775.0
@@ -50,6 +50,7 @@ mov rdi, qword [rel .data_res_neg_64]
hlt
align 4096
; One-integer larger than what int16_t can hold
.double_larger_than_int16:
dq 32768.0
+1 -1
View File
@@ -52,7 +52,7 @@ roundps xmm7, [rdx + 8 * 0], 00000100b
hlt
align 16
align 4096
.data:
dd 0.5, -0.5, 1.5, -1.5
dq 0, 0
Loaded 100 of 382 files, more files were not shown because too many files have changed in this diff. Show more