-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x87 fst/fld optimization for different addrmodes
Includes tests and instcountci files and tests. When the x87 optimizations were implement, we missed optimizing different addressing modes. This commit addresses this issue. Discussed in #4252.
- Loading branch information
Showing
10 changed files
with
28,666 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0x3f800000", | ||
"RBX": "0x3f800000", | ||
"RCX": "0x3f800000", | ||
"RBP": "0x3f800000", | ||
"RDI": "0x3f800000", | ||
"RSP": "0x3f800000" | ||
}, | ||
"MemoryRegions": { | ||
"0xf0000000": "4096" | ||
}, | ||
"Mode": "32BIT" | ||
} | ||
%endif | ||
|
||
section .bss | ||
base resb 4096 | ||
|
||
section .text | ||
|
||
; Setup | ||
fld1 | ||
lea edx, [rel base] | ||
mov esi, 0x64 | ||
|
||
; Test fst | ||
fst dword [edx] | ||
fst dword [edx + 0xa] | ||
fst dword [edx + esi] | ||
fst dword [edx + esi * 4] | ||
fst dword [edx + esi + 0xa] | ||
fst dword [edx + esi * 4 + 0xa] | ||
|
||
; Result check | ||
mov eax, dword [edx] | ||
mov ebx, dword [edx + 0xa] | ||
mov ecx, dword [edx + esi] | ||
mov ebp, dword [edx + esi * 4] | ||
mov edi, dword [edx + esi + 0xa] | ||
mov esp, dword [edx + esi * 4 + 0xa] | ||
|
||
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,43 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0x3f800000", | ||
"RBX": "0x3f800000", | ||
"RCX": "0x3f800000", | ||
"R8": "0x3f800000", | ||
"R9": "0x3f800000", | ||
"R10": "0x3f800000" | ||
}, | ||
"MemoryRegions": { | ||
"0x100000000": "4096" | ||
} | ||
} | ||
%endif | ||
|
||
section .bss | ||
base resb 4096 | ||
|
||
section .text | ||
|
||
; Setup | ||
fld1 | ||
lea rdx, [rel base] | ||
mov rsi, 0x64 | ||
|
||
; Test fst | ||
fst dword [rdx] | ||
fst dword [rdx + 0xa] | ||
fst dword [rdx + rsi] | ||
fst dword [rdx + rsi * 4] | ||
fst dword [rdx + rsi + 0xa] | ||
fst dword [rdx + rsi * 4 + 0xa] | ||
|
||
; Result check | ||
mov eax, dword [rdx] | ||
mov ebx, dword [rdx + 0xa] | ||
mov ecx, dword [rdx + rsi] | ||
mov r8d, dword [rdx + rsi * 4] | ||
mov r9d, dword [rdx + rsi + 0xa] | ||
mov r10d, dword [rdx + rsi * 4 + 0xa] | ||
|
||
hlt |
Oops, something went wrong.