fprintf(fp, "%s", bir_passthrough_name(index.value));
else if (index.type == BI_INDEX_REGISTER)
fprintf(fp, "r%u", index.value);
- else if (index.type == BI_INDEX_NORMAL && index.reg)
- fprintf(fp, "nr%u", index.value);
else if (index.type == BI_INDEX_NORMAL)
fprintf(fp, "%u", index.value);
else
bi_foreach_src(ins, i) {
if (bi_is_equiv(ins->src[i], old)) {
ins->src[i].type = new.type;
- ins->src[i].reg = new.reg;
ins->src[i].value = new.value;
}
}
bi_foreach_instr_global(ctx, I) {
bi_foreach_dest(I, d) {
I->dest[d].value = find_or_allocate_temp(map, bi_get_node(I->dest[d]), &ctx->ssa_alloc);
- I->dest[d].reg = false;
}
bi_foreach_src(I, s) {
if (I->src[s].type == BI_INDEX_NORMAL)
I->src[s].value = find_or_allocate_temp(map, bi_get_node(I->src[s]), &ctx->ssa_alloc);
- I->src[s].reg = false;
}
}
* the lower half, other values unused. */
enum bi_swizzle swizzle : 4;
uint32_t offset : 3;
- bool reg : 1;
enum bi_index_type type : 3;
/* Must be zeroed so we can hash the whole 64-bits at a time */
- unsigned padding : (32 - 14);
+ unsigned padding : (32 - 13);
} bi_index;
static inline bi_index
.value = value,
.swizzle = BI_SWIZZLE_H01,
.offset = offset,
- .reg = is_reg,
.type = BI_INDEX_NORMAL,
};
}
static inline bool
bi_is_ssa(bi_index idx)
{
- return idx.type == BI_INDEX_NORMAL && !idx.reg;
+ return idx.type == BI_INDEX_NORMAL;
}
/* Compares equivalence as references. Does not compare offsets, swizzles, or
bi_is_equiv(bi_index left, bi_index right)
{
return (left.type == right.type) &&
- (left.reg == right.reg) &&
(left.value == right.value);
}
(left.neg == right.neg) &&
(left.swizzle == right.swizzle) &&
(left.offset == right.offset) &&
- (left.reg == right.reg) &&
(left.type == right.type);
}
}
return bi_get_index(ctx->ssa_alloc++, false, 0);
}
-static inline bi_index
-bi_temp_reg(bi_context *ctx)
-{
- return bi_get_index(ctx->reg_alloc++, true, 0);
-}
-
/* Inline constants automatically, will be lowered out by bi_lower_fau where a
* constant is not allowed. load_const_to_scalar gaurantees that this makes
* sense */
if (bi_is_null(index) || index.type != BI_INDEX_NORMAL)
return ~0;
else
- return (index.value << 1) | index.reg;
+ return index.value;
}
static inline bi_index
assert(node < node_count);
assert(node_count < ~0u);
- return bi_get_index(node >> 1, node & PAN_IS_REG, 0);
+ return bi_get_index(node, false, 0);
}
/* Iterators for Bifrost IR */