On 8/12/25 10:53, Philippe Mathieu-Daudé wrote:
From: WANG Xuerui <[email protected]>

Support for TCGCond's in loongarch64 cmp_vec codegen is not uniform: NE
is not supported at all and will trip over assertions, and legalization
(currently just operand-swapping) is not done for reg-imm comparisons.
Since the TCG middle-end will not legalize the comparison conditions for
us, we have to do it ourselves like other targets.

Because EQ/LT/LTU/LE/LEU are natively supported, we only have to keep
the current operand swapping treatment for GT/GTU/GE/GEU but ensure it
is done for both reg-reg and reg-imm cases, and use a bitwise NOT to
help legalize NE.

Fixes: d8b6fa593d2d ("tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3237
Cc: Richard Henderson <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Reported-by: Bingwu Zhang <[email protected]>
Signed-off-by: WANG Xuerui <[email protected]>
Message-ID: <[email protected]>
[PMD: Split of bigger patch, part 2/2]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  tcg/loongarch64/tcg-target.c.inc | 45 +++++++++++++++++++++++++-------
  1 file changed, 35 insertions(+), 10 deletions(-)

Tested-by: Philippe Mathieu-Daudé <[email protected]>

Reply via email to