Skip to content

Commit

Permalink
target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13
Browse files Browse the repository at this point in the history
Type 13 is reserved, so using it should result in specification
exception. Due to an off-by-1 error the code triggers an assertion at a
later point in time instead.

Cc: qemu-stable@nongnu.org
Fixes: da48075 ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)")
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230724082032.66864-8-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit ff537b0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
iii-i authored and Michael Tokarev committed Jul 25, 2023
1 parent 50bda71 commit e7d47bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/s390x/tcg/translate_vx.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@ static DisasJumpType op_vfmax(DisasContext *s, DisasOps *o)
const uint8_t m5 = get_field(s, m5);
gen_helper_gvec_3_ptr *fn;

if (m6 == 5 || m6 == 6 || m6 == 7 || m6 > 13) {
if (m6 == 5 || m6 == 6 || m6 == 7 || m6 >= 13) {
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
}
Expand Down

0 comments on commit e7d47bf

Please sign in to comment.