Skip to content

Commit 79cc5e7

Browse files
committed
perf: Optimize NEXT_INST macro by reordering memory loads for better performance
1 parent 8f0277d commit 79cc5e7

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)