summaryrefslogtreecommitdiff
path: root/py/asmx64.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/asmx64.c')
-rw-r--r--py/asmx64.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/py/asmx64.c b/py/asmx64.c
index 9a3d5fb0d..9cd2fc64c 100644
--- a/py/asmx64.c
+++ b/py/asmx64.c
@@ -621,21 +621,10 @@ void asm_x64_call_i1(asm_x64_t *as, void* func, int i1) {
}
*/
-void asm_x64_call_ind(asm_x64_t *as, void *ptr, int temp_r64) {
+void asm_x64_call_ind(asm_x64_t *as, size_t fun_id, int temp_r64) {
assert(temp_r64 < 8);
-#ifdef __LP64__
- asm_x64_mov_i64_to_r64_optimised(as, (int64_t)ptr, temp_r64);
-#else
- // If we get here, sizeof(int) == sizeof(void*).
- asm_x64_mov_i64_to_r64_optimised(as, (int64_t)(unsigned int)ptr, temp_r64);
-#endif
+ asm_x64_mov_mem64_to_r64(as, ASM_X64_REG_RBP, fun_id * WORD_SIZE, temp_r64);
asm_x64_write_byte_2(as, OPCODE_CALL_RM32, MODRM_R64(2) | MODRM_RM_REG | MODRM_RM_R64(temp_r64));
- // this reduces code size by 2 bytes per call, but doesn't seem to speed it up at all
- // doesn't work anymore because calls are 64 bits away
- /*
- asm_x64_write_byte_1(as, OPCODE_CALL_REL32);
- asm_x64_write_word32(as, ptr - (void*)(as->code_base + as->code_offset + 4));
- */
}
#endif // MICROPY_EMIT_X64