- fix 8 and 16 bit store

This commit is contained in:
Magnus Norddahl 2018-08-18 18:21:52 +02:00
parent e557e8fac0
commit b159b5667a

View file

@ -569,19 +569,19 @@ JitFuncPtr JitCompile(VMScriptFunction *sfunc)
// Store instructions. *(rA + rkC) = rB // Store instructions. *(rA + rkC) = rB
case OP_SB: // store byte case OP_SB: // store byte
NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL); NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL);
cc.mov(x86::byte_ptr(PA, KC), regD[B]); cc.mov(x86::byte_ptr(PA, KC), regD[B].r8Lo());
break; break;
case OP_SB_R: case OP_SB_R:
NULL_POINTER_CHECK(PA, RC, X_WRITE_NIL); NULL_POINTER_CHECK(PA, RC, X_WRITE_NIL);
cc.mov(x86::byte_ptr(PA, RC), regD[B]); cc.mov(x86::byte_ptr(PA, RC), regD[B].r8Lo());
break; break;
case OP_SH: // store halfword case OP_SH: // store halfword
NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL); NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL);
cc.mov(x86::word_ptr(PA, KC), regD[B]); cc.mov(x86::word_ptr(PA, KC), regD[B].r16());
break; break;
case OP_SH_R: case OP_SH_R:
NULL_POINTER_CHECK(PA, RC, X_WRITE_NIL); NULL_POINTER_CHECK(PA, RC, X_WRITE_NIL);
cc.mov(x86::word_ptr(PA, RC), regD[B]); cc.mov(x86::word_ptr(PA, RC), regD[B].r16());
break; break;
case OP_SW: // store word case OP_SW: // store word
NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL); NULL_POINTER_CHECK(PA, KC, X_WRITE_NIL);