Skip to content

Commit a1d4a9e

Browse files
authored
Merge pull request #465 from quake/quake/next-inst-opt
perf: Optimize NEXT_INST macro by reordering memory loads for better performance
2 parents f2f03d0 + 79cc5e7 commit a1d4a9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/machine/asm/execute_x64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,11 @@
374374
*/
375375
#define NEXT_INST \
376376
movq (INST_ARGS), %rcx; \
377+
movq (INST_PC), TEMP1; \
377378
addq $16, INST_ARGS; \
379+
addq $16, INST_PC; \
378380
movzbl %ch, RDd_RS2sd; \
379381
sar $32, %rcx; \
380-
movq (INST_PC), TEMP1; \
381-
addq $16, INST_PC; \
382382
jmp *TEMP1
383383

384384
#define NEXT_INST_V2 \

0 commit comments

Comments
 (0)