@@ -103,13 +103,11 @@ namespace randomx {
103
103
; xmm11 -> "a3"
104
104
; xmm12 -> temporary
105
105
; xmm13 -> mantissa mask = 0x000fffffffffffff000fffffffffffff
106
- ; xmm14 -> exponent 2**-240 = 0x30f000000000000030f0000000000000
106
+ ; xmm14 -> exponent 2**-240 = 0x30f00000000xxxxx30f00000000xxxxx
107
107
; xmm15 -> scale mask = 0x81f000000000000081f0000000000000
108
108
109
109
*/
110
110
111
- #define NOP_TEST true
112
-
113
111
const uint8_t * codePrologue = (uint8_t *)&randomx_program_prologue;
114
112
const uint8_t * codeLoopBegin = (uint8_t *)&randomx_program_loop_begin;
115
113
const uint8_t * codeLoopLoad = (uint8_t *)&randomx_program_loop_load;
@@ -254,18 +252,10 @@ namespace randomx {
254
252
255
253
void JitCompilerX86::generateProgramLight (Program& prog, ProgramConfiguration& pcfg) {
256
254
generateProgramPrologue (prog, pcfg);
257
- // if (superscalar) {
258
255
emit (codeReadDatasetLightSshInit, readDatasetLightInitSize);
259
256
emitByte (CALL);
260
257
emit32 (superScalarHashOffset - (codePos + 4 ));
261
258
emit (codeReadDatasetLightSshFin, readDatasetLightFinSize);
262
- /* }
263
- else {
264
- memcpy(code + codePos, codeReadDatasetLight, readDatasetLightSize);
265
- codePos += readDatasetLightSize;
266
- emitByte(CALL);
267
- emit32(readDatasetLightSubOffset - (codePos + 4));
268
- }*/
269
259
generateProgramEpilogue (prog);
270
260
}
271
261
@@ -483,10 +473,6 @@ namespace randomx {
483
473
emitByte(0xc0 + instr.dst);
484
474
emit32(instr.getImm32());
485
475
}*/
486
- if (false && NOP_TEST) {
487
- emit (NOP4);
488
- return ;
489
- }
490
476
emit (REX_LEA);
491
477
if (instr.dst == RegisterNeedsDisplacement)
492
478
emitByte (0xac );
@@ -527,18 +513,10 @@ namespace randomx {
527
513
void JitCompilerX86::h_ISUB_R (Instruction& instr, int i) {
528
514
registerUsage[instr.dst ] = i;
529
515
if (instr.src != instr.dst ) {
530
- if (false && NOP_TEST) {
531
- emit (NOP3);
532
- return ;
533
- }
534
516
emit (REX_SUB_RR);
535
517
emitByte (0xc0 + 8 * instr.dst + instr.src );
536
518
}
537
519
else {
538
- if (false && NOP_TEST) {
539
- emit (NOP7);
540
- return ;
541
- }
542
520
emit (REX_81);
543
521
emitByte (0xe8 + instr.dst );
544
522
emit32 (instr.getImm32 ());
@@ -571,18 +549,10 @@ namespace randomx {
571
549
void JitCompilerX86::h_IMUL_R (Instruction& instr, int i) {
572
550
registerUsage[instr.dst ] = i;
573
551
if (instr.src != instr.dst ) {
574
- if (false && NOP_TEST) {
575
- emit (NOP4);
576
- return ;
577
- }
578
552
emit (REX_IMUL_RR);
579
553
emitByte (0xc0 + 8 * instr.dst + instr.src );
580
554
}
581
555
else {
582
- if (false && NOP_TEST) {
583
- emit (NOP7);
584
- return ;
585
- }
586
556
emit (REX_IMUL_RRI);
587
557
emitByte (0xc0 + 9 * instr.dst );
588
558
emit32 (instr.getImm32 ());
@@ -606,12 +576,6 @@ namespace randomx {
606
576
607
577
void JitCompilerX86::h_IMULH_R (Instruction& instr, int i) {
608
578
registerUsage[instr.dst ] = i;
609
- if (false && NOP_TEST) {
610
- emit (NOP3);
611
- emit (NOP3);
612
- emit (NOP3);
613
- return ;
614
- }
615
579
emit (REX_MOV_RR64);
616
580
emitByte (0xc0 + instr.dst );
617
581
emit (REX_MUL_R);
@@ -641,12 +605,6 @@ namespace randomx {
641
605
642
606
void JitCompilerX86::h_ISMULH_R (Instruction& instr, int i) {
643
607
registerUsage[instr.dst ] = i;
644
- if (false && NOP_TEST) {
645
- emit (NOP3);
646
- emit (NOP3);
647
- emit (NOP3);
648
- return ;
649
- }
650
608
emit (REX_MOV_RR64);
651
609
emitByte (0xc0 + instr.dst );
652
610
emit (REX_MUL_R);
@@ -676,13 +634,6 @@ namespace randomx {
676
634
677
635
void JitCompilerX86::h_IMUL_RCP (Instruction& instr, int i) {
678
636
if (instr.getImm32 () != 0 ) {
679
- if (false && NOP_TEST) {
680
- emitByte (0x66 );
681
- emitByte (0x66 );
682
- emit (NOP8);
683
- emit (NOP4);
684
- return ;
685
- }
686
637
registerUsage[instr.dst ] = i;
687
638
emit (MOV_RAX_I);
688
639
emit64 (randomx_reciprocal (instr.getImm32 ()));
@@ -704,18 +655,10 @@ namespace randomx {
704
655
void JitCompilerX86::h_IXOR_R (Instruction& instr, int i) {
705
656
registerUsage[instr.dst ] = i;
706
657
if (instr.src != instr.dst ) {
707
- if (false && NOP_TEST) {
708
- emit (NOP3);
709
- return ;
710
- }
711
658
emit (REX_XOR_RR);
712
659
emitByte (0xc0 + 8 * instr.dst + instr.src );
713
660
}
714
661
else {
715
- if (false && NOP_TEST) {
716
- emit (NOP7);
717
- return ;
718
- }
719
662
emit (REX_XOR_RI);
720
663
emitByte (0xf0 + instr.dst );
721
664
emit32 (instr.getImm32 ());
@@ -740,21 +683,12 @@ namespace randomx {
740
683
void JitCompilerX86::h_IROR_R (Instruction& instr, int i) {
741
684
registerUsage[instr.dst ] = i;
742
685
if (instr.src != instr.dst ) {
743
- if (false && NOP_TEST) {
744
- emit (NOP3);
745
- emit (NOP3);
746
- return ;
747
- }
748
686
emit (REX_MOV_RR);
749
687
emitByte (0xc8 + instr.src );
750
688
emit (REX_ROT_CL);
751
689
emitByte (0xc8 + instr.dst );
752
690
}
753
691
else {
754
- if (false && NOP_TEST) {
755
- emit (NOP4);
756
- return ;
757
- }
758
692
emit (REX_ROT_I8);
759
693
emitByte (0xc8 + instr.dst );
760
694
emitByte (instr.getImm32 () & 63 );
@@ -949,21 +883,14 @@ namespace randomx {
949
883
const int conditionMask = ((1 << RANDOMX_CONDITION_BITS) - 1 ) << shift;
950
884
int reg = getConditionRegister ();
951
885
int target = registerUsage[reg] + 1 ;
952
- if (false && NOP_TEST) {
953
- emit (NOP7);
954
- emit (NOP7);
955
- emit (NOP6);
956
- }
957
- else {
958
- emit (REX_ADD_I);
959
- emitByte (0xc0 + reg);
960
- emit32 (1 << shift);
961
- emit (REX_TEST);
962
- emitByte (0xc0 + reg);
963
- emit32 (conditionMask);
964
- emit (JZ);
965
- emit32 (instructionOffsets[target] - (codePos + 4 ));
966
- }
886
+ emit (REX_ADD_I);
887
+ emitByte (0xc0 + reg);
888
+ emit32 (1 << shift);
889
+ emit (REX_TEST);
890
+ emitByte (0xc0 + reg);
891
+ emit32 (conditionMask);
892
+ emit (JZ);
893
+ emit32 (instructionOffsets[target] - (codePos + 4 ));
967
894
for (unsigned j = 0 ; j < 8 ; ++j) { // mark all registers as used
968
895
registerUsage[j] = i;
969
896
}
@@ -973,13 +900,6 @@ namespace randomx {
973
900
#ifdef RANDOMX_JUMP
974
901
handleCondition (instr, i);
975
902
#endif
976
- if (false && NOP_TEST) {
977
- emit (NOP3);
978
- emit (NOP7);
979
- emit (NOP3);
980
- emit (NOP3);
981
- return ;
982
- }
983
903
emit (XOR_ECX_ECX);
984
904
emit (REX_CMP_R32I);
985
905
emitByte (0xf8 + instr.src );
0 commit comments