mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
LJ_GC64: Fix HREF for pointers.
Contributed by Peter Cawley.
This commit is contained in:
parent
6a25014c1c
commit
bdcaf4bfd9
@ -1246,7 +1246,18 @@ static void asm_href(ASMState *as, IRIns *ir, IROp merge)
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
emit_rr(as, XO_MOV, tmp, key);
|
emit_rr(as, XO_MOV, tmp, key);
|
||||||
|
#if LJ_GC64
|
||||||
|
emit_gri(as, XG_ARITHi(XOg_XOR), dest, irt_toitype(kt) << 15);
|
||||||
|
if ((as->flags & JIT_F_BMI2)) {
|
||||||
|
emit_i8(as, 32);
|
||||||
|
emit_mrm(as, XV_RORX|VEX_64, dest, key);
|
||||||
|
} else {
|
||||||
|
emit_shifti(as, XOg_SHR|REX_64, dest, 32);
|
||||||
|
emit_rr(as, XO_MOV, dest|REX_64, key|REX_64);
|
||||||
|
}
|
||||||
|
#else
|
||||||
emit_rmro(as, XO_LEA, dest, key, HASH_BIAS);
|
emit_rmro(as, XO_LEA, dest, key, HASH_BIAS);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ static LJ_AINLINE Node *hashmask(const GCtab *t, uint32_t hash)
|
|||||||
|
|
||||||
#define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi)))
|
#define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi)))
|
||||||
#define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1))
|
#define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1))
|
||||||
#define hashptr(t, p) hashlohi((t), u32ptr(p), u32ptr(p) + HASH_BIAS)
|
|
||||||
#if LJ_GC64
|
#if LJ_GC64
|
||||||
#define hashgcref(t, r) \
|
#define hashgcref(t, r) \
|
||||||
hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32))
|
hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32))
|
||||||
|
Loading…
Reference in New Issue
Block a user