mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-03 16:25:39 +00: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. Backports c7c778b5b9b7865a3e7200805ac561c5d334b8d0
This commit is contained in:
parent
daafb0ba17
commit
ea25434061
|
@ -270,13 +270,13 @@ static const char *target_parse_constraint(TCGArgConstraint *ct,
|
|||
break;
|
||||
|
||||
case 'e':
|
||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_S32);
|
||||
ct->ct |= TCG_CT_CONST_S32;
|
||||
break;
|
||||
case 'Z':
|
||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_U32);
|
||||
ct->ct |= TCG_CT_CONST_U32;
|
||||
break;
|
||||
case 'I':
|
||||
ct->ct |= (type == TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONST_I32);
|
||||
ct->ct |= TCG_CT_CONST_I32;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -293,6 +293,11 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type,
|
|||
if (ct & TCG_CT_CONST) {
|
||||
return 1;
|
||||
}
|
||||
if (type == TCG_TYPE_I32) {
|
||||
if (ct & (TCG_CT_CONST_S32 | TCG_CT_CONST_U32 | TCG_CT_CONST_I32)) {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if ((ct & TCG_CT_CONST_S32) && val == (int32_t)val) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -302,6 +307,7 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type,
|
|||
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)) {
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue