mirror of
https://github.com/wownero/RandomX.git
synced 2026-10-17 15:31:50 +02:00
4 scratchpad segments
This commit is contained in:
+14
-14
@@ -182,17 +182,17 @@ namespace RandomX {
|
||||
emitByte(0xe8); //xor rbp, rax
|
||||
}
|
||||
emitByte(0x25); //and eax,
|
||||
if (instr.loca & 15) {
|
||||
//if (instr.loca & 15) {
|
||||
if (instr.loca & 3) {
|
||||
emit(ScratchpadL1 - 1); //first 16 KiB of scratchpad
|
||||
}
|
||||
else {
|
||||
emit(ScratchpadL2 - 1); //first 256 KiB of scratchpad
|
||||
}
|
||||
}
|
||||
/*}
|
||||
else {
|
||||
emit(ScratchpadL3 - 1); //whole scratchpad
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void JitCompilerX86::genar(Instruction& instr) {
|
||||
@@ -271,7 +271,7 @@ namespace RandomX {
|
||||
}
|
||||
|
||||
void JitCompilerX86::gencr(Instruction& instr, bool rax = true) {
|
||||
if (instr.locc & 16) { //write to register
|
||||
if (instr.locc & 8) { //write to register
|
||||
emit(uint16_t(0x8b4c)); //mov
|
||||
if (rax) {
|
||||
emitByte(0xc0 + 8 * (instr.regc % RegistersCount)); //regc, rax
|
||||
@@ -281,17 +281,17 @@ namespace RandomX {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (instr.locc & 15) {
|
||||
if (instr.locc & 3) {
|
||||
//if (instr.locc & 7) {
|
||||
if (instr.locc & 1) {
|
||||
scratchpadStoreR(instr, ScratchpadL1, rax);
|
||||
}
|
||||
else {
|
||||
scratchpadStoreR(instr, ScratchpadL2, rax);
|
||||
}
|
||||
}
|
||||
/*}
|
||||
else {
|
||||
scratchpadStoreR(instr, ScratchpadL3, rax);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,18 +319,18 @@ namespace RandomX {
|
||||
}
|
||||
emit(uint16_t(0x280f)); //movaps
|
||||
emitByte(0xc0 + 8 * regc); // regc, xmm0
|
||||
if (instr.locc & 16) { //write to scratchpad
|
||||
if (instr.locc & 15) {
|
||||
if (instr.locc & 3) { //C.LOC.W
|
||||
if (instr.locc & 8) { //write to scratchpad
|
||||
//if (instr.locc & 7) {
|
||||
if (instr.locc & 1) { //C.LOC.W
|
||||
scratchpadStoreF(instr, regc, ScratchpadL1, (instr.locc & 128)); //first 16 KiB of scratchpad
|
||||
}
|
||||
else {
|
||||
scratchpadStoreF(instr, regc, ScratchpadL2, (instr.locc & 128)); //first 256 KiB of scratchpad
|
||||
}
|
||||
}
|
||||
else {
|
||||
//}
|
||||
/*else {
|
||||
scratchpadStoreF(instr, regc, ScratchpadL3, (instr.locc & 128)); //whole scratchpad
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user