OSDN Git Service

Hexagon (target/hexagon) Fix predicated assignment to .tmp and .cur
authorTaylor Simpson <tsimpson@quicinc.com>
Tue, 8 Nov 2022 16:28:57 +0000 (08:28 -0800)
committerTaylor Simpson <tsimpson@quicinc.com>
Fri, 16 Dec 2022 18:10:28 +0000 (10:10 -0800)
commit83853ea0efee80f8c39a73753a048a769a02a2c7
treeafe2308fa30b2bad1190a513e5e148fb7a82aa8c
parent1e536334ccb0a1606f814a38a4996b3b818e9fab
Hexagon (target/hexagon) Fix predicated assignment to .tmp and .cur

Here are example instructions with a predicated .tmp/.cur assignment
    if (p1) v12.tmp = vmem(r7 + #0)
    if (p0) v12.cur = vmem(r9 + #0)
The .tmp/.cur indicates that references to v12 in the same packet
take the result of the load.  However, when the predicate is false,
the value at the start of the packet should be used.  After the packet
commits, the .tmp value is dropped, but the .cur value is maintained.

To fix this bug, we preload the original value from the HVX register
into the temporary used for the result.

Test cases added to tests/tcg/hexagon/hvx_misc.c

Acked-by: Richard Henderson <richard.henderson@linaro.org>
Co-authored-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <20221108162906.3166-3-tsimpson@quicinc.com>
target/hexagon/gen_tcg_funcs.py
target/hexagon/translate.h
tests/tcg/hexagon/hvx_misc.c