From 901c96dc554100513523cc9136161126e8cda436 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Thu, 22 May 2025 14:03:53 +0200 Subject: [PATCH] py/emitnative: Remove redundant RV32 Viper int-indexed code. This commit removes redundant RV32 implementations of certain int-indexed code generation operations (32-bit load/store and 16-bit load). Those operations were already available as part of the native emitter API but were not exposed to the Viper code generator. As part of the introduction of more specialised load and store API calls to int-indexed Viper load/store generator bits, the existing native emitter implementations are reused, thus making the Viper implementations redundant. Signed-off-by: Alessandro Gatti --- py/emitnative.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/py/emitnative.c b/py/emitnative.c index dba9c7169b..8ac9810c8f 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1567,12 +1567,6 @@ static void emit_native_load_subscr(emit_t *emit) { #ifdef ASM_LOAD16_REG_REG_OFFSET ASM_LOAD16_REG_REG_OFFSET(emit->as, REG_RET, reg_base, index_value); #else - #if N_RV32 - if (FIT_SIGNED(index_value, 11)) { - asm_rv32_opcode_lhu(emit->as, REG_RET, reg_base, index_value << 1); - break; - } - #endif if (index_value != 0) { // index is a non-zero immediate need_reg_single(emit, reg_index, 0); @@ -1589,12 +1583,6 @@ static void emit_native_load_subscr(emit_t *emit) { #ifdef ASM_LOAD32_REG_REG_OFFSET ASM_LOAD32_REG_REG_OFFSET(emit->as, REG_RET, reg_base, index_value); #else - #if N_RV32 - if (FIT_SIGNED(index_value, 10)) { - asm_rv32_opcode_lw(emit->as, REG_RET, reg_base, index_value << 2); - break; - } - #endif if (index_value != 0) { // index is a non-zero immediate need_reg_single(emit, reg_index, 0); @@ -1855,12 +1843,6 @@ static void emit_native_store_subscr(emit_t *emit) { #ifdef ASM_STORE32_REG_REG_OFFSET ASM_STORE32_REG_REG_OFFSET(emit->as, reg_value, reg_base, index_value); #else - #if N_RV32 - if (FIT_SIGNED(index_value, 10)) { - asm_rv32_opcode_sw(emit->as, reg_value, reg_base, index_value << 2); - break; - } - #endif if (index_value != 0) { // index is a non-zero immediate #if N_ARM