mirror of
https://codeberg.org/wownero/RandomWOW
synced 2026-03-06 06:37:33 -05:00
FPROUND - variable flag offset
This commit is contained in:
@@ -466,7 +466,9 @@ namespace RandomX {
|
||||
void AssemblyGeneratorX86::h_FPROUND(Instruction& instr, int i) {
|
||||
genar(instr, i);
|
||||
asmCode << "\tmov rcx, rax" << std::endl;
|
||||
asmCode << "\tshl eax, 13" << std::endl;
|
||||
int rotate = (13 - (instr.imm8 & 63)) & 63;
|
||||
if (rotate != 0)
|
||||
asmCode << "\trol rax, " << rotate << std::endl;
|
||||
asmCode << "\tand eax, 24576" << std::endl;
|
||||
asmCode << "\tor eax, 40896" << std::endl;
|
||||
asmCode << "\tmov dword ptr [rsp - 8], eax" << std::endl;
|
||||
|
||||
@@ -574,7 +574,15 @@ namespace RandomX {
|
||||
|
||||
void JitCompilerX86::h_FPROUND(Instruction& instr, int i) {
|
||||
genar(instr);
|
||||
emit(0x00250de0c1c88b48); //mov rcx,rax; shl eax,0xd
|
||||
emitByte(0x48);
|
||||
emit(uint16_t(0xc88b)); //mov rcx,rax
|
||||
int rotate = (13 - (instr.imm8 & 63)) & 63;
|
||||
if (rotate != 0) {
|
||||
emitByte(0x48);
|
||||
emit(uint16_t(0xc0c1)); //rol rax
|
||||
emitByte(rotate);
|
||||
}
|
||||
emit(uint16_t(0x0025));
|
||||
emit(0x00009fc00d000060); //and eax,0x6000; or eax,0x9fc0
|
||||
emit(0x2454ae0ff8244489); //ldmxcsr DWORD PTR [rsp-0x8]
|
||||
emitByte(0xf8);
|
||||
|
||||
@@ -8859,7 +8859,7 @@ rx_body_509:
|
||||
and ecx, 2047
|
||||
mov rax, qword ptr [rsi+rcx*8]
|
||||
mov rcx, rax
|
||||
shl eax, 13
|
||||
rol rax, 34
|
||||
and eax, 24576
|
||||
or eax, 40896
|
||||
mov dword ptr [rsp - 8], eax
|
||||
|
||||
Reference in New Issue
Block a user