mirror_qemu/target
Peter Maydell ccdb4cc209 target/arm: Fix A64 scalar SQSHRN and SQRSHRN
In commit 1b7bc9b5c8 we changed handle_vec_simd_sqshrn() so
that instead of starting with a 0 value and depositing in each new
element from the narrowing operation, it instead started with the raw
result of the narrowing operation of the first element.

This is fine in the vector case, because the deposit operations for
the second and subsequent elements will always overwrite any higher
bits that might have been in the first element's result value in
tcg_rd.  However in the scalar case we only go through this loop
once.  The effect is that for a signed narrowing operation, if the
result is negative then we will now return a value where the bits
above the first element are incorrectly 1 (because the narrowfn
returns a sign-extended result, not one that is truncated to the
element size).

Fix this by using an extract operation to get exactly the correct
bits of the output of the narrowfn for element 1, instead of a
plain move.

Cc: qemu-stable@nongnu.org
Fixes: 1b7bc9b5c8 ("target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2089
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240123153416.877308-1-peter.maydell@linaro.org
(cherry picked from commit 6fffc83785)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-01-27 18:10:41 +03:00
..
alpha other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
arm target/arm: Fix A64 scalar SQSHRN and SQRSHRN 2024-01-27 18:10:41 +03:00
avr hw/avr/atmega: Fix wrong initial value of stack pointer 2023-12-05 12:32:36 +03:00
cris other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
hexagon target/hexagon: avoid invalid escape in Python string 2023-10-19 14:52:59 +03:00
hppa target/hppa: Move iaoq registers and thus reduce generated code size 2023-08-04 00:02:56 +02:00
i386 target/i386: pcrel: store low bits of physical address in data[0] 2024-01-20 12:25:07 +03:00
loongarch other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
m68k target/m68k: Fix semihost lseek offset computation 2023-08-01 23:52:23 +02:00
microblaze other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
mips target/mips: Fix TX79 LQ/SQ opcodes 2023-11-19 21:15:06 +03:00
nios2 target/nios2: Fix semihost lseek offset computation 2023-08-01 23:52:23 +02:00
openrisc target/openrisc: Set EPCR to next PC on FPE exceptions 2023-07-31 22:01:03 +01:00
ppc target/ppc: Fix LQ, STQ register-pair order for big-endian 2023-09-21 19:35:19 +03:00
riscv target/riscv: Fix mcycle/minstret increment behavior 2024-01-08 19:24:38 +03:00
rx other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
s390x target/s390x: Fix LAE setting a wrong access register 2024-01-13 11:28:25 +03:00
sh4 target: Widen pc/cs_base in cpu_get_tb_cpu_state 2023-06-26 17:32:59 +02:00
sparc target/sparc: Clear may_lookup for npc == DYNAMIC_PC 2023-10-29 10:14:02 +03:00
tricore target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0 2023-10-03 02:05:55 +03:00
xtensa target/xtensa: fix OOB TLB entry access 2024-01-27 18:05:25 +03:00
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build target/loongarch: Add target build suport 2022-06-06 18:09:03 +00:00