Skip to content

Commit

Permalink
tcg: Fix iteration step in 32-bit gvec operation
Browse files Browse the repository at this point in the history
The loop in the 32-bit case of the vector compare operation
was incorrectly incrementing by 8 bytes per iteration instead
of 4 bytes. This caused the function to process only half of
the intended elements.

Cc: [email protected]
Fixes: 9622c69 (tcg: Add gvec compare with immediate and scalar operand)
Signed-off-by: TANG Tiancheng <[email protected]>
Reviewed-by: Liu Zhiwei <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
(cherry picked from commit 9d8d5a5)
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
TANG Tiancheng authored and Michael Tokarev committed Sep 28, 2024
1 parent 51c9439 commit 4c7c0d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcg/tcg-op-gvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3939,7 +3939,7 @@ void tcg_gen_gvec_cmps(TCGCond cond, unsigned vece, uint32_t dofs,
uint32_t i;

tcg_gen_extrl_i64_i32(t1, c);
for (i = 0; i < oprsz; i += 8) {
for (i = 0; i < oprsz; i += 4) {
tcg_gen_ld_i32(t0, tcg_env, aofs + i);
tcg_gen_negsetcond_i32(cond, t0, t0, t1);
tcg_gen_st_i32(t0, tcg_env, dofs + i);
Expand Down

0 comments on commit 4c7c0d2

Please sign in to comment.