mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 12:32:05 -06:00
tcg/i386: Move constraint type check to tcg_target_const_match
Rather than check the type when filling in the constraint, check it when matching the constant. This removes the only use of the type argument to target_parse_constraint. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2366c858f9
commit
c7c778b5b9
1 changed files with 17 additions and 11 deletions
|
@ -263,13 +263,13 @@ static const char *target_parse_constraint(TCGArgConstraint *ct,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_S32);
|
ct->ct |= TCG_CT_CONST_S32;
|
||||||
break;
|
break;
|
||||||
case 'Z':
|
case 'Z':
|
||||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_U32);
|
ct->ct |= TCG_CT_CONST_U32;
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_I32);
|
ct->ct |= TCG_CT_CONST_I32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -286,14 +286,20 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type,
|
||||||
if (ct & TCG_CT_CONST) {
|
if (ct & TCG_CT_CONST) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if ((ct & TCG_CT_CONST_S32) && val == (int32_t)val) {
|
if (type == TCG_TYPE_I32) {
|
||||||
return 1;
|
if (ct & (TCG_CT_CONST_S32 | TCG_CT_CONST_U32 | TCG_CT_CONST_I32)) {
|
||||||
}
|
return 1;
|
||||||
if ((ct & TCG_CT_CONST_U32) && val == (uint32_t)val) {
|
}
|
||||||
return 1;
|
} else {
|
||||||
}
|
if ((ct & TCG_CT_CONST_S32) && val == (int32_t)val) {
|
||||||
if ((ct & TCG_CT_CONST_I32) && ~val == (int32_t)~val) {
|
return 1;
|
||||||
return 1;
|
}
|
||||||
|
if ((ct & TCG_CT_CONST_U32) && val == (uint32_t)val) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ((ct & TCG_CT_CONST_I32) && ~val == (int32_t)~val) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue