diff --git a/src/machine/asm/execute_aarch64.S b/src/machine/asm/execute_aarch64.S index 62ae0c1f..0cba0725 100644 --- a/src/machine/asm/execute_aarch64.S +++ b/src/machine/asm/execute_aarch64.S @@ -601,7 +601,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 1) - ldrsb RS1, [RS1, MEMORY_PTR] + ldrsb RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LB_VERSION1: @@ -609,7 +609,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 1) - ldrsb RS1, [RS1, MEMORY_PTR] + ldrsb RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LBU_VERSION0: @@ -617,7 +617,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 1) - ldrb RS1w, [RS1, MEMORY_PTR] + ldrb RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LBU_VERSION1: @@ -625,7 +625,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 1) - ldrb RS1w, [RS1, MEMORY_PTR] + ldrb RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LD_VERSION0: @@ -633,7 +633,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 8) - ldr RS1, [RS1, MEMORY_PTR] + ldr RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LD_VERSION1: @@ -641,7 +641,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 8) - ldr RS1, [RS1, MEMORY_PTR] + ldr RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LH_VERSION0: @@ -649,7 +649,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 2) - ldrsh RS1, [RS1, MEMORY_PTR] + ldrsh RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LH_VERSION1: @@ -657,7 +657,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 2) - ldrsh RS1, [RS1, MEMORY_PTR] + ldrsh RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LHU_VERSION0: @@ -665,7 +665,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 2) - ldrh RS1w, [RS1, MEMORY_PTR] + ldrh RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LHU_VERSION1: @@ -673,7 +673,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 2) - ldrh RS1w, [RS1, MEMORY_PTR] + ldrh RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LUI: @@ -691,7 +691,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 4) - ldrsw RS1, [RS1, MEMORY_PTR] + ldrsw RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LW_VERSION1: @@ -699,7 +699,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 4) - ldrsw RS1, [RS1, MEMORY_PTR] + ldrsw RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LWU_VERSION0: @@ -707,7 +707,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION0(RS1, 4) - ldr RS1w, [RS1, MEMORY_PTR] + ldr RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_LWU_VERSION1: @@ -715,7 +715,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) add RS1, RS1, IMMEDIATE CHECK_READ_VERSION1(RS1, 4) - ldr RS1w, [RS1, MEMORY_PTR] + ldr RS1w, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_MUL: @@ -847,7 +847,7 @@ ckb_vm_x64_execute: add RS1, RS1, IMMEDIATE CHECK_WRITE(RS1, 1) ldr RS2, REGISTER_ADDRESS(RS2) - strb RS2w, [RS1, MEMORY_PTR] + strb RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_SD: DECODE_S @@ -855,7 +855,7 @@ ckb_vm_x64_execute: add RS1, RS1, IMMEDIATE CHECK_WRITE(RS1, 8) ldr RS2, REGISTER_ADDRESS(RS2) - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_SH: DECODE_S @@ -863,7 +863,7 @@ ckb_vm_x64_execute: add RS1, RS1, IMMEDIATE CHECK_WRITE(RS1, 2) ldr RS2, REGISTER_ADDRESS(RS2) - strh RS2w, [RS1, MEMORY_PTR] + strh RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_SLL: DECODE_R @@ -1003,7 +1003,7 @@ ckb_vm_x64_execute: add RS1, RS1, IMMEDIATE CHECK_WRITE(RS1, 4) ldr RS2, REGISTER_ADDRESS(RS2) - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_XOR: DECODE_R @@ -1023,7 +1023,7 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) CHECK_READ_VERSION1(RS1, 4) str RS1, LOAD_RESERVATION_ADDRESS - ldrsw RS1, [RS1, MEMORY_PTR] + ldrsw RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_SC_W: @@ -1034,10 +1034,10 @@ ckb_vm_x64_execute: ldr TEMP1, LOAD_RESERVATION_ADDRESS mov TEMP2, UINT64_MAX str TEMP2, LOAD_RESERVATION_ADDRESS - ldr TEMP2w, [RS1, MEMORY_PTR] + ldr TEMP2w, [MEMORY_PTR, RS1] cmp RS1, TEMP1 csel RS2w, RS2w, TEMP2w, eq - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] mov TEMP2, #1 csel TEMP1, XZR, TEMP2, eq WRITE_RD(TEMP1) @@ -1047,100 +1047,100 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOADD_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) add RS2, RS2, TEMP1 - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOXOR_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) eor RS2, RS2, TEMP1 - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOAND_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) and RS2, RS2, TEMP1 - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOOR_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) orr RS2, RS2, TEMP1 - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMIN_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2w, TEMP1w csel RS2w, RS2w, TEMP1w, le - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMAX_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2w, TEMP1w csel RS2w, RS2w, TEMP1w, ge - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMINU_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2w, TEMP1w csel RS2w, RS2w, TEMP1w, ls - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMAXU_W: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 4) - ldrsw TEMP1, [RS1, MEMORY_PTR] + ldrsw TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2w, TEMP1w csel RS2w, RS2w, TEMP1w, hs - str RS2w, [RS1, MEMORY_PTR] + str RS2w, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_LR_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) CHECK_READ_VERSION1(RS1, 8) str RS1, LOAD_RESERVATION_ADDRESS - ldr RS1, [RS1, MEMORY_PTR] + ldr RS1, [MEMORY_PTR, RS1] WRITE_RD(RS1) NEXT_INST .CKB_VM_ASM_LABEL_OP_SC_D: @@ -1151,10 +1151,10 @@ ckb_vm_x64_execute: ldr TEMP1, LOAD_RESERVATION_ADDRESS mov TEMP2, UINT64_MAX str TEMP2, LOAD_RESERVATION_ADDRESS - ldr TEMP2, [RS1, MEMORY_PTR] + ldr TEMP2, [MEMORY_PTR, RS1] cmp RS1, TEMP1 csel RS2, RS2, TEMP2, eq - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] mov TEMP2, #1 csel TEMP1, XZR, TEMP2, eq WRITE_RD(TEMP1) @@ -1164,93 +1164,93 @@ ckb_vm_x64_execute: ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOADD_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) add RS2, RS2, TEMP1 - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOXOR_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) eor RS2, RS2, TEMP1 - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOAND_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) and RS2, RS2, TEMP1 - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOOR_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) orr RS2, RS2, TEMP1 - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMIN_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2, TEMP1 csel RS2, RS2, TEMP1, le - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMAX_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2, TEMP1 csel RS2, RS2, TEMP1, ge - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMINU_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2, TEMP1 csel RS2, RS2, TEMP1, ls - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_AMOMAXU_D: DECODE_R ldr RS1, REGISTER_ADDRESS(RS1) ldr RS2, REGISTER_ADDRESS(RS2) CHECK_WRITE(RS1, 8) - ldr TEMP1, [RS1, MEMORY_PTR] + ldr TEMP1, [MEMORY_PTR, RS1] WRITE_RD(TEMP1) cmp RS2, TEMP1 csel RS2, RS2, TEMP1, hs - str RS2, [RS1, MEMORY_PTR] + str RS2, [MEMORY_PTR, RS1] NEXT_INST .CKB_VM_ASM_LABEL_OP_ADDUW: DECODE_R