Skip to content

Commit 901c96d

Browse files
agattidpgeorge
authored andcommitted
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 <[email protected]>
1 parent 84ad2c6 commit 901c96d

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

py/emitnative.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,12 +1567,6 @@ static void emit_native_load_subscr(emit_t *emit) {
15671567
#ifdef ASM_LOAD16_REG_REG_OFFSET
15681568
ASM_LOAD16_REG_REG_OFFSET(emit->as, REG_RET, reg_base, index_value);
15691569
#else
1570-
#if N_RV32
1571-
if (FIT_SIGNED(index_value, 11)) {
1572-
asm_rv32_opcode_lhu(emit->as, REG_RET, reg_base, index_value << 1);
1573-
break;
1574-
}
1575-
#endif
15761570
if (index_value != 0) {
15771571
// index is a non-zero immediate
15781572
need_reg_single(emit, reg_index, 0);
@@ -1589,12 +1583,6 @@ static void emit_native_load_subscr(emit_t *emit) {
15891583
#ifdef ASM_LOAD32_REG_REG_OFFSET
15901584
ASM_LOAD32_REG_REG_OFFSET(emit->as, REG_RET, reg_base, index_value);
15911585
#else
1592-
#if N_RV32
1593-
if (FIT_SIGNED(index_value, 10)) {
1594-
asm_rv32_opcode_lw(emit->as, REG_RET, reg_base, index_value << 2);
1595-
break;
1596-
}
1597-
#endif
15981586
if (index_value != 0) {
15991587
// index is a non-zero immediate
16001588
need_reg_single(emit, reg_index, 0);
@@ -1855,12 +1843,6 @@ static void emit_native_store_subscr(emit_t *emit) {
18551843
#ifdef ASM_STORE32_REG_REG_OFFSET
18561844
ASM_STORE32_REG_REG_OFFSET(emit->as, reg_value, reg_base, index_value);
18571845
#else
1858-
#if N_RV32
1859-
if (FIT_SIGNED(index_value, 10)) {
1860-
asm_rv32_opcode_sw(emit->as, reg_value, reg_base, index_value << 2);
1861-
break;
1862-
}
1863-
#endif
18641846
if (index_value != 0) {
18651847
// index is a non-zero immediate
18661848
#if N_ARM

0 commit comments

Comments
 (0)