forked from FEX-Emu/FEX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FEX-Emu#4093 from pmatos/FXtractFix
Fix FXTRACT for 0.0 and -0.0
- Loading branch information
Showing
17 changed files
with
447 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"MM7": ["0x8000000000000000", "0xFFFF"], | ||
"MM6": ["0x0000000000000000", "0x0000"], | ||
"MM5": ["0x8000000000000000", "0xFFFF"], | ||
"MM4": ["0x0000000000000000", "0x8000"] | ||
}, | ||
"MemoryRegions": { | ||
"0x100000000": "4096" | ||
} | ||
} | ||
%endif | ||
|
||
section .data | ||
nzer: dq -0.0 | ||
|
||
section .text | ||
global _start | ||
_start: | ||
finit | ||
fldz | ||
fxtract ; MM7 is -inf, MM6 is 0.0 | ||
|
||
lea rdx, [rel nzer] | ||
fld qword [rdx] | ||
fxtract ; MM5 is -inf, MM4 is -0.0 | ||
|
||
hlt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"R8": "1" | ||
} | ||
} | ||
%endif | ||
; , | ||
; "R9": "1", | ||
; "R10": "1", | ||
; "R11": "1", | ||
; "R12": "1" | ||
section .data | ||
num0: dq 0.0 | ||
num1: dq 125.78 | ||
num2: dq 1023.12 | ||
num3: dq -23487.152 | ||
num4: dq -1230192.123 | ||
|
||
;; Tests the FScale / FExtract inverse behaviour | ||
section .text | ||
global _start | ||
_start: | ||
|
||
; num0 == 0.0 | ||
finit | ||
fld qword [rel num0] | ||
fld st0 | ||
fxtract | ||
fscale | ||
fstp st1 ; at this point st0 and st1 should be the same | ||
fcom | ||
fnstsw ax | ||
and ax, 0x4500 | ||
cmp ax, 0x4000 | ||
setz r8b | ||
|
||
; ; num1 == 125.78 | ||
; finit | ||
; fld qword [rel num1] | ||
; fld st0 | ||
; fxtract | ||
; fscale | ||
; fstp st1 ; at this point st0 and st1 should be the same | ||
; fcom | ||
; fnstsw ax | ||
; and ax, 0x4500 | ||
; cmp ax, 0x4000 | ||
; setz r9b | ||
|
||
; ; num2 == 1023.12 | ||
; finit | ||
; fld qword [rel num2] | ||
; fld st0 | ||
; fxtract | ||
; fscale | ||
; fstp st1 ; at this point st0 and st1 should be the same | ||
; fcom | ||
; fnstsw ax | ||
; and ax, 0x4500 | ||
; cmp ax, 0x4000 | ||
; setz r10b | ||
|
||
; ; num3 == -23487.152 | ||
; finit | ||
; fld qword [rel num3] | ||
; fld st0 | ||
; fxtract | ||
; fscale | ||
; fstp st1 ; at this point st0 and st1 should be the same | ||
; fcom | ||
; fnstsw ax | ||
; and ax, 0x4500 | ||
; cmp ax, 0x4000 | ||
; setz r11b | ||
|
||
; ; num4 == -1230192.123 | ||
; finit | ||
; fld qword [rel num4] | ||
; fld st0 | ||
; fxtract | ||
; fscale | ||
; fstp st1 ; at this point st0 and st1 should be the same | ||
; fcom | ||
; fnstsw ax | ||
; and ax, 0x4500 | ||
; cmp ax, 0x4000 | ||
; setz r12b | ||
|
||
hlt |
Oops, something went wrong.