diff options
Diffstat (limited to 'src/lj_emit_x86.h')
-rw-r--r-- | src/lj_emit_x86.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/lj_emit_x86.h b/src/lj_emit_x86.h index 8cfb654f..0c7fa148 100644 --- a/src/lj_emit_x86.h +++ b/src/lj_emit_x86.h | |||
@@ -241,10 +241,6 @@ static void emit_gmrmi(ASMState *as, x86Group xg, Reg rb, int32_t i) | |||
241 | 241 | ||
242 | /* -- Emit loads/stores --------------------------------------------------- */ | 242 | /* -- Emit loads/stores --------------------------------------------------- */ |
243 | 243 | ||
244 | /* Instruction selection for XMM moves. */ | ||
245 | #define XMM_MOVRR(as) ((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVSD : XO_MOVAPS) | ||
246 | #define XMM_MOVRM(as) ((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVLPD : XO_MOVSD) | ||
247 | |||
248 | /* mov [base+ofs], i */ | 244 | /* mov [base+ofs], i */ |
249 | static void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i) | 245 | static void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i) |
250 | { | 246 | { |
@@ -314,7 +310,7 @@ static void emit_loadn(ASMState *as, Reg r, cTValue *tv) | |||
314 | if (tvispzero(tv)) /* Use xor only for +0. */ | 310 | if (tvispzero(tv)) /* Use xor only for +0. */ |
315 | emit_rr(as, XO_XORPS, r, r); | 311 | emit_rr(as, XO_XORPS, r, r); |
316 | else | 312 | else |
317 | emit_rma(as, XMM_MOVRM(as), r, &tv->n); | 313 | emit_rma(as, XO_MOVSD, r, &tv->n); |
318 | } | 314 | } |
319 | 315 | ||
320 | /* -- Emit control-flow instructions -------------------------------------- */ | 316 | /* -- Emit control-flow instructions -------------------------------------- */ |
@@ -427,25 +423,25 @@ static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) | |||
427 | if (dst < RID_MAX_GPR) | 423 | if (dst < RID_MAX_GPR) |
428 | emit_rr(as, XO_MOV, REX_64IR(ir, dst), src); | 424 | emit_rr(as, XO_MOV, REX_64IR(ir, dst), src); |
429 | else | 425 | else |
430 | emit_rr(as, XMM_MOVRR(as), dst, src); | 426 | emit_rr(as, XO_MOVAPS, dst, src); |
431 | } | 427 | } |
432 | 428 | ||
433 | /* Generic load of register from stack slot. */ | 429 | /* Generic load of register with base and (small) offset address. */ |
434 | static void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs) | 430 | static void emit_loadofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) |
435 | { | 431 | { |
436 | if (r < RID_MAX_GPR) | 432 | if (r < RID_MAX_GPR) |
437 | emit_rmro(as, XO_MOV, REX_64IR(ir, r), RID_ESP, ofs); | 433 | emit_rmro(as, XO_MOV, REX_64IR(ir, r), base, ofs); |
438 | else | 434 | else |
439 | emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS, r, RID_ESP, ofs); | 435 | emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSD : XO_MOVSS, r, base, ofs); |
440 | } | 436 | } |
441 | 437 | ||
442 | /* Generic store of register to stack slot. */ | 438 | /* Generic store of register with base and (small) offset address. */ |
443 | static void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs) | 439 | static void emit_storeofs(ASMState *as, IRIns *ir, Reg r, Reg base, int32_t ofs) |
444 | { | 440 | { |
445 | if (r < RID_MAX_GPR) | 441 | if (r < RID_MAX_GPR) |
446 | emit_rmro(as, XO_MOVto, REX_64IR(ir, r), RID_ESP, ofs); | 442 | emit_rmro(as, XO_MOVto, REX_64IR(ir, r), base, ofs); |
447 | else | 443 | else |
448 | emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, r, RID_ESP, ofs); | 444 | emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, r, base, ofs); |
449 | } | 445 | } |
450 | 446 | ||
451 | /* Add offset to pointer. */ | 447 | /* Add offset to pointer. */ |