mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
tcg/loongarch64: Fix vec_val computation in tcg_target_const_match
Only use vece for a vector constant. This avoids an assertion failure in sextract64 when vece contains garbage. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
73d29ea241
commit
a079836005
1 changed files with 8 additions and 6 deletions
|
@ -211,12 +211,14 @@ static bool tcg_target_const_match(int64_t val, int ct,
|
||||||
if ((ct & TCG_CT_CONST_WSZ) && val == (type == TCG_TYPE_I32 ? 32 : 64)) {
|
if ((ct & TCG_CT_CONST_WSZ) && val == (type == TCG_TYPE_I32 ? 32 : 64)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int64_t vec_val = sextract64(val, 0, 8 << vece);
|
if (ct & (TCG_CT_CONST_VCMP | TCG_CT_CONST_VADD)) {
|
||||||
if ((ct & TCG_CT_CONST_VCMP) && -0x10 <= vec_val && vec_val <= 0x1f) {
|
int64_t vec_val = sextract64(val, 0, 8 << vece);
|
||||||
return true;
|
if ((ct & TCG_CT_CONST_VCMP) && -0x10 <= vec_val && vec_val <= 0x1f) {
|
||||||
}
|
return true;
|
||||||
if ((ct & TCG_CT_CONST_VADD) && -0x1f <= vec_val && vec_val <= 0x1f) {
|
}
|
||||||
return true;
|
if ((ct & TCG_CT_CONST_VADD) && -0x1f <= vec_val && vec_val <= 0x1f) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue