target/arm: Fix sve_zcr_len_for_el

Off by one error in the EL2 and EL3 tests. Remove the test
against EL3 entirely, since it must always be true.

Backports commit 6a02a73211c5bc634fccd652777230954b83ccba from qemu
This commit is contained in:
Richard Henderson 2019-08-08 19:20:27 -04:00 committed by Lioncash
parent 9f2ff9a66f
commit c687259bf6
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -5095,10 +5095,10 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el)
if (el <= 1) {
zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]);
}
if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) {
if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) {
zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]);
}
if (el < 3 && arm_feature(env, ARM_FEATURE_EL3)) {
if (arm_feature(env, ARM_FEATURE_EL3)) {
zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]);
}
return zcr_len;