py/emitnative: Fix x86-64 emitter to generate correct 8/16-bit stores.

Fixes issue #6643.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2020-11-24 23:37:58 +11:00
parent f49d47c167
commit 5176a2d732
3 changed files with 24 additions and 2 deletions

View File

@@ -1769,7 +1769,7 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
int reg_index = REG_ARG_2;
int reg_value = REG_ARG_3;
emit_pre_pop_reg_flexible(emit, &vtype_base, &reg_base, reg_index, reg_value);
#if N_X86
#if N_X64 || N_X86
// special case: x86 needs byte stores to be from lower 4 regs (REG_ARG_3 is EDX)
emit_pre_pop_reg(emit, &vtype_value, reg_value);
#else
@@ -1856,7 +1856,7 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
EMIT_NATIVE_VIPER_TYPE_ERROR(emit,
MP_ERROR_TEXT("can't store with '%q' index"), vtype_to_qstr(vtype_index));
}
#if N_X86
#if N_X64 || N_X86
// special case: x86 needs byte stores to be from lower 4 regs (REG_ARG_3 is EDX)
emit_pre_pop_reg(emit, &vtype_value, reg_value);
#else