Skip to content

Commit

Permalink
Update tests to check for negative zero
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatos committed Sep 26, 2024
1 parent cab62e7 commit b8e6f1b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 14 additions & 1 deletion unittests/ASM/X87/FScale-Zero.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
"R9": "0",
"R10": "0",
"R11": "0",
"R12": "0"
"R12": "0",
"R13": "0x8000000000000000"
}
}
%endif

section .data
neg_zero dq 0x8000000000000000 ; -0.0

section .bss
align 8
Expand Down Expand Up @@ -69,4 +72,14 @@ fscale
fst qword [rel intstor]
mov r12, [rel intstor]

; tests scaling negative zero
mov rax, 1048576
mov qword [rel intstor], rax
finit
fild qword [rel intstor]
fld qword [rel neg_zero]
fscale
fst qword [rel intstor]
mov r13, [rel intstor]

hlt
13 changes: 13 additions & 0 deletions unittests/ASM/X87_F64/FScale-Zero_F64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
}
%endif

section .data
neg_zero dq 0x8000000000000000 ; -0.0

section .bss
intstor: resq 1

Expand Down Expand Up @@ -65,4 +68,14 @@ fscale
fst qword [rel intstor]
mov r12, [rel intstor]

; tests scaling negative zero
mov rax, 1048576
mov qword [rel intstor], rax
finit
fild qword [rel intstor]
fld qword [rel neg_zero]
fscale
fst qword [rel intstor]
mov r13, [rel intstor]

hlt

0 comments on commit b8e6f1b

Please sign in to comment.