A packet containing HLX instructions currently defers all stores to the
end of the packet, this breaks scalar :mem_noshuf ordering.  Only
reorder HLX stores.

Fixes: a6fae6da070d66b9 ("target/hexagon: translate packets with HLX 
instructions")
Signed-off-by: Anton Johansson <[email protected]>
---
 target/hexagon/translate.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index 8ab28d40d3..f9d4c3fb66 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -1525,8 +1525,10 @@ static void decode_and_translate_packet(CPUHexagonState 
*env, DisasContext *ctx)
             for (int pass = 0; pass < 3; pass++) {
                 for (i = 0; i < ctx->pkt.num_insns; i++) {
                     Insn *insn = &ctx->pkt.insn[i];
+                    bool hlx = GET_ATTRIB(insn->opcode, A_HLX);
                     bool tmp = GET_ATTRIB(insn->opcode, A_HLX_TMP);
-                    bool store = !tmp && GET_ATTRIB(insn->opcode, A_STORE);
+                    bool store = !tmp && hlx &&
+                                 GET_ATTRIB(insn->opcode, A_STORE);
                     if (pass != (tmp ? 0 : store ? 2 : 1)) {
                         continue;
                     }
@@ -1534,8 +1536,7 @@ static void decode_and_translate_packet(CPUHexagonState 
*env, DisasContext *ctx)
                     if (insn->hlx_new_zero) {
                         gen_hlx_new_zero(insn);
                     }
-                    if (GET_ATTRIB(insn->opcode, A_HLX) &&
-                        trace_event_get_state_backends(
+                    if (hlx && trace_event_get_state_backends(
                             TRACE_HEXAGON_HLX_OP)) {
                         gen_helper_hlx_trace_op(tcg_env,
                             tcg_constant_i32(insn->opcode));
-- 
2.52.0


Reply via email to