Hexagon (target/hexagon) fix store w/mem_noshuf & predicated load
PATCH 1/1 Hexagon (target/hexagon) fix store w/mem_noshuf & predicated load
Call the CHECK_NOSHUF macro multiple times: once in the fGEN_TCG_PRED_LOAD() and again in fLOAD().
Before this commit, a packet with a store and a predicated load with mem_noshuf that gets encoded like this:
{ P0 = cmp.eq(R17,#0x0)
memw(R18+#0x0) = R2
if (!P0.new) R3 = memw(R17+#0x4) }... would end up generating a branch over both the load and the store like so:
...
brcond_i32 loc17,$0x0,eq,$L1
mov_i32 loc18,store_addr_1
qemu_st_i32 store_val32_1,store_addr_1,leul,0
qemu_ld_i32 loc16,loc7,leul,0
set_label $L1
...Test cases added to tests/tcg/hexagon/mem_noshuf.c
Co-authored-by Taylor Simpson <[email protected]>
Signed-off-by Brian Cain <[email protected]>
Signed-off-by Taylor Simpson <[email protected]>
--- target/hexagon/gen_tcg.h | 2 + tests/tcg/hexagon/mem_noshuf.c | 122 +++++++++++++++++++++++++++++++-- 2 files changed, 119 insertions(+), 5 deletions(-)
target/hexagon/gen_tcg.h +2 -0
@@ -343,6 +343,7 @@PRED ; \PRED_LOAD_CANCEL (LSB ,EA ); \tcg_gen_movi_tl (RdV,0 ); \ +CHECK_NOSHUF ; \tcg_gen_brcondi_tl (TCG_COND_EQ ,LSB ,0 , label); \fLOAD (1 ,SIZE ,SIGN ,EA , RdV); \gen_set_label (label); \
@@ -402,6 +403,7 @@PRED ; \PRED_LOAD_CANCEL (LSB ,EA ); \tcg_gen_movi_i64 (RddV,0 ); \ +CHECK_NOSHUF ; \tcg_gen_brcondi_tl (TCG_COND_EQ ,LSB ,0 , label); \fLOAD (1 ,8 , u,EA , RddV); \gen_set_label (label); \
tests/tcg/hexagon/mem_noshuf.c +117 -5
152 lines not on this page · raw message
Signature · 1 line
2.17.1