diff options
author | Mike Pall <mike> | 2010-12-05 22:39:36 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-05 22:39:36 +0100 |
commit | c5f4f607c9d73b11ce151f677a06d3f0089be219 (patch) | |
tree | cad499711378661f58687424df44bc09cda909ba /src | |
parent | 5a13fa69d95993fa68b12be4091f48b80844bdcf (diff) | |
download | luajit-c5f4f607c9d73b11ce151f677a06d3f0089be219.tar.gz luajit-c5f4f607c9d73b11ce151f677a06d3f0089be219.tar.bz2 luajit-c5f4f607c9d73b11ce151f677a06d3f0089be219.zip |
Fix xmm spill/restore broken by b1fb71fb.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 4c31a3e9..d10cf643 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -680,7 +680,10 @@ static Reg ra_releasetmp(ASMState *as, IRRef ref) | |||
680 | /* Generic move between two regs. */ | 680 | /* Generic move between two regs. */ |
681 | static void ra_movrr(ASMState *as, IRIns *ir, Reg r1, Reg r2) | 681 | static void ra_movrr(ASMState *as, IRIns *ir, Reg r1, Reg r2) |
682 | { | 682 | { |
683 | emit_rr(as, r1 < RID_MAX_GPR ? XO_MOV : XMM_MOVRR(as), REX_64IR(ir, r1), r2); | 683 | if (r1 < RID_MAX_GPR) |
684 | emit_rr(as, XO_MOV, REX_64IR(ir, r1), r2); | ||
685 | else | ||
686 | emit_rr(as, XMM_MOVRR(as), r1, r2); | ||
684 | } | 687 | } |
685 | 688 | ||
686 | /* Restore a register (marked as free). Rematerialize or force a spill. */ | 689 | /* Restore a register (marked as free). Rematerialize or force a spill. */ |
@@ -698,8 +701,10 @@ static Reg ra_restore(ASMState *as, IRRef ref) | |||
698 | if (!rset_test(as->weakset, r)) { /* Only restore non-weak references. */ | 701 | if (!rset_test(as->weakset, r)) { /* Only restore non-weak references. */ |
699 | ra_modified(as, r); | 702 | ra_modified(as, r); |
700 | RA_DBGX((as, "restore $i $r", ir, r)); | 703 | RA_DBGX((as, "restore $i $r", ir, r)); |
701 | emit_rmro(as, r < RID_MAX_GPR ? XO_MOV : XMM_MOVRM(as), | 704 | if (r < RID_MAX_GPR) |
702 | REX_64IR(ir, r), RID_ESP, ofs); | 705 | emit_rmro(as, XO_MOV, REX_64IR(ir, r), RID_ESP, ofs); |
706 | else | ||
707 | emit_rmro(as, XMM_MOVRM(as), r, RID_ESP, ofs); | ||
703 | } | 708 | } |
704 | return r; | 709 | return r; |
705 | } | 710 | } |
@@ -709,8 +714,10 @@ static Reg ra_restore(ASMState *as, IRRef ref) | |||
709 | static void ra_save(ASMState *as, IRIns *ir, Reg r) | 714 | static void ra_save(ASMState *as, IRIns *ir, Reg r) |
710 | { | 715 | { |
711 | RA_DBGX((as, "save $i $r", ir, r)); | 716 | RA_DBGX((as, "save $i $r", ir, r)); |
712 | emit_rmro(as, r < RID_MAX_GPR ? XO_MOVto : XO_MOVSDto, | 717 | if (r < RID_MAX_GPR) |
713 | REX_64IR(ir, r), RID_ESP, sps_scale(ir->s)); | 718 | emit_rmro(as, XO_MOVto, REX_64IR(ir, r), RID_ESP, sps_scale(ir->s)); |
719 | else | ||
720 | emit_rmro(as, XO_MOVSDto, r, RID_ESP, sps_scale(ir->s)); | ||
714 | } | 721 | } |
715 | 722 | ||
716 | #define MINCOST(r) \ | 723 | #define MINCOST(r) \ |
@@ -3213,8 +3220,10 @@ static void asm_head_side(ASMState *as) | |||
3213 | if (ra_hasspill(regsp_spill(rs))) { | 3220 | if (ra_hasspill(regsp_spill(rs))) { |
3214 | int32_t ofs = sps_scale(regsp_spill(rs)); | 3221 | int32_t ofs = sps_scale(regsp_spill(rs)); |
3215 | ra_free(as, r); | 3222 | ra_free(as, r); |
3216 | emit_rmro(as, r < RID_MAX_GPR ? XO_MOV : XMM_MOVRM(as), | 3223 | if (r < RID_MAX_GPR) |
3217 | REX_64IR(ir, r), RID_ESP, ofs); | 3224 | emit_rmro(as, XO_MOV, REX_64IR(ir, r), RID_ESP, ofs); |
3225 | else | ||
3226 | emit_rmro(as, XMM_MOVRM(as), r, RID_ESP, ofs); | ||
3218 | checkmclim(as); | 3227 | checkmclim(as); |
3219 | } | 3228 | } |
3220 | } | 3229 | } |