Skip to content

Commit 76bccf3

Browse files
rth7680pm215
authored andcommitted
target/arm: Fix VCMLA Dd, Dn, Dm[idx]
The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: [email protected] Fixes: 18fc240 ("target/arm: Implement SVE fp complex multiply add (indexed)") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2376 Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Richard Henderson <[email protected]> Message-id: [email protected] Signed-off-by: Peter Maydell <[email protected]>
1 parent 6997020 commit 76bccf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

target/arm/tcg/vec_helper.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, void *va,
907907
intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2);
908908
uint32_t neg_real = flip ^ neg_imag;
909909
intptr_t elements = opr_sz / sizeof(float16);
910-
intptr_t eltspersegment = 16 / sizeof(float16);
910+
intptr_t eltspersegment = MIN(16 / sizeof(float16), elements);
911911
intptr_t i, j;
912912

913913
/* Shift boolean to the sign bit so we can xor to negate. */
@@ -969,7 +969,7 @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, void *va,
969969
intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2);
970970
uint32_t neg_real = flip ^ neg_imag;
971971
intptr_t elements = opr_sz / sizeof(float32);
972-
intptr_t eltspersegment = 16 / sizeof(float32);
972+
intptr_t eltspersegment = MIN(16 / sizeof(float32), elements);
973973
intptr_t i, j;
974974

975975
/* Shift boolean to the sign bit so we can xor to negate. */

0 commit comments

Comments
 (0)