-
Notifications
You must be signed in to change notification settings - Fork 125
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 #4169 from Sonicadvance1/x87_loadstore_tests
unittests/ASM: Fixes x87 80-bit loads on the edge of page boundaries.
- Loading branch information
Showing
6 changed files
with
91 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"MM7": ["0x5354555657584142", "0x0000000000005152"], | ||
"MM6": ["0xe94de5eae34fc1c0", "0x0000000000004039"] | ||
}, | ||
"MemoryRegions": { | ||
"0x100000000": "4096" | ||
} | ||
} | ||
%endif | ||
|
||
finit ; enters x87 state | ||
|
||
mov rax, 0x100000000 | ||
mov rbx, 0x4142434445464748 | ||
mov rcx, 0x5152535455565758 | ||
mov rdx, (0x100000000 + 0x1000 - 16) | ||
|
||
mov [rdx], rbx | ||
mov [rdx + 8], rcx | ||
|
||
mov rdx, 0x100000000 + 0x1000 | ||
|
||
; Do an 80-bit load at the edge of a page. | ||
; Ensuring tword loads don't extend past the end of a page. | ||
fld tword [rdx - 10] | ||
|
||
; Do an 80-bit BCD load at the edge of a page. | ||
fbld [rdx - 10] | ||
|
||
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,33 @@ | ||
%ifdef CONFIG | ||
{ | ||
"MemoryRegions": { | ||
"0x100000000": "4096" | ||
} | ||
} | ||
%endif | ||
|
||
finit ; enters x87 state | ||
|
||
mov rax, 0x100000000 | ||
mov rbx, 0x4142434445464748 | ||
mov rcx, 0x5152535455565758 | ||
mov rdx, (0x100000000 + 0x1000 - 16) | ||
|
||
mov [rdx], rbx | ||
mov [rdx + 8], rcx | ||
|
||
mov rdx, 0x100000000 + 0x1000 | ||
|
||
; Load the data in to an x87 register for storing. | ||
fld tword [rdx - 16] | ||
fld tword [rdx - 16] | ||
|
||
; Do an 80-bit store at the edge of a page. | ||
; Ensuring tword stores don't extend past the end of a page. | ||
; If storing past the end of the page, then an unhandled SIGSEGV will occur. | ||
fstp tword [rdx - 10] | ||
|
||
; Do an 80-bit bcd store at the edge of a page. | ||
fbstp [rdx - 10] | ||
|
||
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
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