Re: [PATCH] target/hexagon: don't let an idef-parser dest clobber its own source

Pierrick Bouvier <[email protected]> Wed, 5 Aug 2026 09:24:33 -0700
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
On 8/5/2026 7:02 AM, Brian Cain wrote:
> The idef-parser emitters write the destination in place, so when a packet
> is short-circuited and get_result_gpr() returns hex_gpr[] itself, an
> instruction naming one register as both source and destination reads back
> a value it already overwrote.
> 
> `Rd32=cmpy(Rs32,Rt32):<<1:rnd:sat` with Rs == Rd is an example.
> 
> Give a source reg that aliases a destination its own copy of the
> register value.
> 
> Signed-off-by: Brian Cain <[email protected]>
> ---
>  target/hexagon/genptr.h                |  1 +
>  target/hexagon/genptr.c                | 11 ++++++
>  tests/tcg/hexagon/read_write_overlap.c | 47 ++++++++++++++++++++++++++
>  target/hexagon/gen_tcg_funcs.py        | 15 ++++++++
>  target/hexagon/hex_common.py           | 12 +++++++
>  5 files changed, 86 insertions(+)
> 

Reviewed-by: Pierrick Bouvier <[email protected]>