tcg: Consolidate 3 bits into enum TCGTempKind

The temp_fixed, temp_global, temp_local bits are all related.
Combine them into a single enumeration.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2020-03-29 10:11:56 -07:00
parent 4e18617555
commit ee17db83d2
3 changed files with 92 additions and 62 deletions

View file

@ -116,21 +116,21 @@ static TCGTemp *find_better_copy(TCGContext *s, TCGTemp *ts)
TCGTemp *i;
/* If this is already a global, we can't do better. */
if (ts->temp_global) {
if (ts->kind >= TEMP_GLOBAL) {
return ts;
}
/* Search for a global first. */
for (i = ts_info(ts)->next_copy; i != ts; i = ts_info(i)->next_copy) {
if (i->temp_global) {
if (i->kind >= TEMP_GLOBAL) {
return i;
}
}
/* If it is a temp, search for a temp local. */
if (!ts->temp_local) {
if (ts->kind == TEMP_NORMAL) {
for (i = ts_info(ts)->next_copy; i != ts; i = ts_info(i)->next_copy) {
if (ts->temp_local) {
if (i->kind >= TEMP_LOCAL) {
return i;
}
}