-
Notifications
You must be signed in to change notification settings - Fork 135
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 #1515 from Sonicadvance1/fix_ptest
OpcodeDispatcher: Fixes ptest flags calculation.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xFFFFFFFFFFFF43FF", | ||
"RBX": "0" | ||
} | ||
} | ||
%endif | ||
|
||
; Set EFLAGS to known value with sahf | ||
mov rax, -1 | ||
sahf | ||
|
||
movups xmm0, [rel .data] | ||
; Tests a bug that FEX had where ptest would not set OF, SF, AF, PF to zero | ||
ptest xmm0, xmm0 | ||
|
||
; Now load back | ||
; ZF = 1 | ||
; CF = 1 | ||
; OF, SF, AF, PF should be zero | ||
lahf | ||
|
||
; lahf doesn't get OF, get it with seto | ||
mov rbx, 0 | ||
seto bl | ||
|
||
hlt | ||
|
||
.data: | ||
dq 0 | ||
dq 0 |