ARM64: Consolidate 32/64-bit constant handling in assembler.

Thanks to Peter Cawley. #1065
This commit is contained in:
Mike Pall
2023-09-09 16:30:14 +02:00
parent dfc122e45c
commit 5149b0a3a2
2 changed files with 42 additions and 37 deletions

View File

@@ -606,7 +606,11 @@ static Reg ra_allock(ASMState *as, intptr_t k, RegSet allow)
IRIns *ir = IR(ref);
if ((ir->o == IR_KINT64 && k == (int64_t)ir_kint64(ir)->u64) ||
#if LJ_GC64
#if LJ_TARGET_ARM64
(ir->o == IR_KINT && (uint64_t)k == (uint32_t)ir->i) ||
#else
(ir->o == IR_KINT && k == ir->i) ||
#endif
(ir->o == IR_KGC && k == (intptr_t)ir_kgc(ir)) ||
((ir->o == IR_KPTR || ir->o == IR_KKPTR) &&
k == (intptr_t)ir_kptr(ir))