aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-12-30 00:36:33 +0100
committerMike Pall <mike>2010-12-30 00:36:33 +0100
commit8bcc5ed021b9c683d7e254dc9e0937eaa40f6d64 (patch)
tree655ce19a65e3beb0bc9657c643e3a2be2aa0145b /src
parent2ca2de7f0ec03a388ec86728847949ed495bdbf4 (diff)
downloadluajit-8bcc5ed021b9c683d7e254dc9e0937eaa40f6d64.tar.gz
luajit-8bcc5ed021b9c683d7e254dc9e0937eaa40f6d64.tar.bz2
luajit-8bcc5ed021b9c683d7e254dc9e0937eaa40f6d64.zip
Add support for IRT_FLOAT to XLOAD/XSTORE.
Diffstat (limited to 'src')
-rw-r--r--src/lj_asm.c7
-rw-r--r--src/lj_target_x86.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index d75858f8..eb6f00e7 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -2130,6 +2130,7 @@ static void asm_fxload(ASMState *as, IRIns *ir)
2130 case IRT_I16: xo = XO_MOVSXw; break; 2130 case IRT_I16: xo = XO_MOVSXw; break;
2131 case IRT_U16: xo = XO_MOVZXw; break; 2131 case IRT_U16: xo = XO_MOVZXw; break;
2132 case IRT_NUM: xo = XMM_MOVRM(as); break; 2132 case IRT_NUM: xo = XMM_MOVRM(as); break;
2133 case IRT_FLOAT: xo = XO_MOVSS; break;
2133 default: 2134 default:
2134 if (LJ_64 && irt_is64(ir->t)) 2135 if (LJ_64 && irt_is64(ir->t))
2135 dest |= REX_64; 2136 dest |= REX_64;
@@ -2149,9 +2150,10 @@ static void asm_fxstore(ASMState *as, IRIns *ir)
2149 /* The IRT_I16/IRT_U16 stores should never be simplified for constant 2150 /* The IRT_I16/IRT_U16 stores should never be simplified for constant
2150 ** values since mov word [mem], imm16 has a length-changing prefix. 2151 ** values since mov word [mem], imm16 has a length-changing prefix.
2151 */ 2152 */
2152 if (irt_isi16(ir->t) || irt_isu16(ir->t) || irt_isnum(ir->t) || 2153 if (irt_isi16(ir->t) || irt_isu16(ir->t) ||
2154 irt_isnum(ir->t) || irt_isfloat(ir->t) ||
2153 !asm_isk32(as, ir->op2, &k)) { 2155 !asm_isk32(as, ir->op2, &k)) {
2154 RegSet allow8 = irt_isnum(ir->t) ? RSET_FPR : 2156 RegSet allow8 = (irt_isnum(ir->t) || irt_isfloat(ir->t)) ? RSET_FPR :
2155 (irt_isi8(ir->t) || irt_isu8(ir->t)) ? RSET_GPR8 : RSET_GPR; 2157 (irt_isi8(ir->t) || irt_isu8(ir->t)) ? RSET_GPR8 : RSET_GPR;
2156 src = osrc = ra_alloc1(as, ir->op2, allow8); 2158 src = osrc = ra_alloc1(as, ir->op2, allow8);
2157 if (!LJ_64 && !rset_test(allow8, src)) { /* Already in wrong register. */ 2159 if (!LJ_64 && !rset_test(allow8, src)) { /* Already in wrong register. */
@@ -2171,6 +2173,7 @@ static void asm_fxstore(ASMState *as, IRIns *ir)
2171 case IRT_I8: case IRT_U8: xo = XO_MOVtob; src |= FORCE_REX; break; 2173 case IRT_I8: case IRT_U8: xo = XO_MOVtob; src |= FORCE_REX; break;
2172 case IRT_I16: case IRT_U16: xo = XO_MOVtow; break; 2174 case IRT_I16: case IRT_U16: xo = XO_MOVtow; break;
2173 case IRT_NUM: xo = XO_MOVSDto; break; 2175 case IRT_NUM: xo = XO_MOVSDto; break;
2176 case IRT_FLOAT: xo = XO_MOVSSto; break;
2174#if LJ_64 2177#if LJ_64
2175 case IRT_LIGHTUD: lua_assert(0); /* NYI: mask 64 bit lightuserdata. */ 2178 case IRT_LIGHTUD: lua_assert(0); /* NYI: mask 64 bit lightuserdata. */
2176#endif 2179#endif
diff --git a/src/lj_target_x86.h b/src/lj_target_x86.h
index 67590eb3..eb287f03 100644
--- a/src/lj_target_x86.h
+++ b/src/lj_target_x86.h
@@ -235,6 +235,8 @@ typedef enum {
235 235
236 XO_MOVSD = XO_f20f(10), 236 XO_MOVSD = XO_f20f(10),
237 XO_MOVSDto = XO_f20f(11), 237 XO_MOVSDto = XO_f20f(11),
238 XO_MOVSS = XO_f30f(10),
239 XO_MOVSSto = XO_f30f(11),
238 XO_MOVLPD = XO_660f(12), 240 XO_MOVLPD = XO_660f(12),
239 XO_MOVAPS = XO_0f(28), 241 XO_MOVAPS = XO_0f(28),
240 XO_XORPS = XO_0f(57), 242 XO_XORPS = XO_0f(57),