FEX/unittests/ASM/X87/D9_FD_2.asm
Ryan Houdek 3b0fb27ae9 Softfloat: Fixes FSCALE
I misread the implementation details of this instruction when
implementing.

The pseudocode says `ST(0) = ST(0) ∗ 2^rndint(ST(1))` so I understood
the instruction to use the current rounding mode of the host to extract
the integer portion of `ST(1)`.

The actual implementation is in the details of the statement `the
integer portion of the floating- point value in ST(1).`

This behaves like round towards zero/truncate, additional hardware
testing and documentation reading confirms this.

Fixes #1584
2022-03-13 14:11:31 -07:00

31 lines
348 B
NASM

%ifdef CONFIG
{
"RegData": {
"MM6": ["0x8000000000000000", "0x3FFF"],
"MM7": ["0xD000000000000000", "0xC001"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
lea rdx, [rel data2]
fld tword [rdx + 8 * 0]
lea rdx, [rel data]
fld tword [rdx + 8 * 0]
fscale
hlt
align 8
data:
dt 64.0
dq 0
data2:
dt -6.5
dq 0