aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 563abcd4..d2ba4bfc 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -1290,8 +1290,8 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow)
1290 } else if (mayfuse(as, ref)) { 1290 } else if (mayfuse(as, ref)) {
1291 RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR; 1291 RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR;
1292 if (ir->o == IR_SLOAD) { 1292 if (ir->o == IR_SLOAD) {
1293 if ((!irt_isint(ir->t) || (ir->op2 & IRSLOAD_FRAME)) && 1293 if (!(ir->op2 & (IRSLOAD_PARENT|IRSLOAD_CONVERT)) &&
1294 !(ir->op2 & IRSLOAD_PARENT) && noconflict(as, ref, IR_RETF)) { 1294 noconflict(as, ref, IR_RETF)) {
1295 as->mrm.base = (uint8_t)ra_alloc1(as, REF_BASE, xallow); 1295 as->mrm.base = (uint8_t)ra_alloc1(as, REF_BASE, xallow);
1296 as->mrm.ofs = 8*((int32_t)ir->op1-1) + ((ir->op2&IRSLOAD_FRAME)?4:0); 1296 as->mrm.ofs = 8*((int32_t)ir->op1-1) + ((ir->op2&IRSLOAD_FRAME)?4:0);
1297 as->mrm.idx = RID_NONE; 1297 as->mrm.idx = RID_NONE;
@@ -2061,8 +2061,9 @@ static void asm_sload(ASMState *as, IRIns *ir)
2061 IRType1 t = ir->t; 2061 IRType1 t = ir->t;
2062 Reg base; 2062 Reg base;
2063 lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ 2063 lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */
2064 lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK)); 2064 lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));
2065 if (irt_isint(t) && irt_isguard(t)) { 2065 lua_assert(!irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));
2066 if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t)) {
2066 Reg left = ra_scratch(as, RSET_FPR); 2067 Reg left = ra_scratch(as, RSET_FPR);
2067 asm_tointg(as, ir, left); /* Frees dest reg. Do this before base alloc. */ 2068 asm_tointg(as, ir, left); /* Frees dest reg. Do this before base alloc. */
2068 base = ra_alloc1(as, REF_BASE, RSET_GPR); 2069 base = ra_alloc1(as, REF_BASE, RSET_GPR);
@@ -2078,11 +2079,11 @@ static void asm_sload(ASMState *as, IRIns *ir)
2078 return; 2079 return;
2079#endif 2080#endif
2080 } else if (ra_used(ir)) { 2081 } else if (ra_used(ir)) {
2081 RegSet allow = irt_isnum(ir->t) ? RSET_FPR : RSET_GPR; 2082 RegSet allow = irt_isnum(t) ? RSET_FPR : RSET_GPR;
2082 Reg dest = ra_dest(as, ir, allow); 2083 Reg dest = ra_dest(as, ir, allow);
2083 base = ra_alloc1(as, REF_BASE, RSET_GPR); 2084 base = ra_alloc1(as, REF_BASE, RSET_GPR);
2084 lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); 2085 lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
2085 if (irt_isint(t) && !(ir->op2 & IRSLOAD_FRAME)) 2086 if ((ir->op2 & IRSLOAD_CONVERT))
2086 emit_rmro(as, XO_CVTSD2SI, dest, base, ofs); 2087 emit_rmro(as, XO_CVTSD2SI, dest, base, ofs);
2087 else if (irt_isnum(t)) 2088 else if (irt_isnum(t))
2088 emit_rmro(as, XMM_MOVRM(as), dest, base, ofs); 2089 emit_rmro(as, XMM_MOVRM(as), dest, base, ofs);