aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2016-10-19 09:48:38 +0200
committerMike Pall <mike>2016-10-19 09:48:38 +0200
commitbdcaf4bfd97d61461a5bc892d5fed3b0ac7ff256 (patch)
tree2ff2803ccaefc5c238704adb4114f8aea59d80e2
parent6a25014c1c33448cabdc013ccb9e5c4fc98a0238 (diff)
downloadluajit-bdcaf4bfd97d61461a5bc892d5fed3b0ac7ff256.tar.gz
luajit-bdcaf4bfd97d61461a5bc892d5fed3b0ac7ff256.tar.bz2
luajit-bdcaf4bfd97d61461a5bc892d5fed3b0ac7ff256.zip
LJ_GC64: Fix HREF for pointers.
Contributed by Peter Cawley.
-rw-r--r--src/lj_asm_x86.h11
-rw-r--r--src/lj_tab.c1
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 50784daa..7931ffb5 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -1246,7 +1246,18 @@ static void asm_href(ASMState *as, IRIns *ir, IROp merge)
1246#endif 1246#endif
1247 } else { 1247 } else {
1248 emit_rr(as, XO_MOV, tmp, key); 1248 emit_rr(as, XO_MOV, tmp, key);
1249#if LJ_GC64
1250 emit_gri(as, XG_ARITHi(XOg_XOR), dest, irt_toitype(kt) << 15);
1251 if ((as->flags & JIT_F_BMI2)) {
1252 emit_i8(as, 32);
1253 emit_mrm(as, XV_RORX|VEX_64, dest, key);
1254 } else {
1255 emit_shifti(as, XOg_SHR|REX_64, dest, 32);
1256 emit_rr(as, XO_MOV, dest|REX_64, key|REX_64);
1257 }
1258#else
1249 emit_rmro(as, XO_LEA, dest, key, HASH_BIAS); 1259 emit_rmro(as, XO_LEA, dest, key, HASH_BIAS);
1260#endif
1250 } 1261 }
1251 } 1262 }
1252 } 1263 }
diff --git a/src/lj_tab.c b/src/lj_tab.c
index 8011212f..71be0a90 100644
--- a/src/lj_tab.c
+++ b/src/lj_tab.c
@@ -28,7 +28,6 @@ static LJ_AINLINE Node *hashmask(const GCtab *t, uint32_t hash)
28 28
29#define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi))) 29#define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi)))
30#define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1)) 30#define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1))
31#define hashptr(t, p) hashlohi((t), u32ptr(p), u32ptr(p) + HASH_BIAS)
32#if LJ_GC64 31#if LJ_GC64
33#define hashgcref(t, r) \ 32#define hashgcref(t, r) \
34 hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32)) 33 hashlohi((t), (uint32_t)gcrefu(r), (uint32_t)(gcrefu(r) >> 32))