aco: fix vadd32() when b is neither a constant nor temporary
This will be useful for compiling vertex shader prologs, where we basically use ACO as an assembler. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11717>
This commit is contained in:
@@ -432,7 +432,7 @@ public:
|
||||
}
|
||||
|
||||
Result vadd32(Definition dst, Op a, Op b, bool carry_out=false, Op carry_in=Op(Operand(s2)), bool post_ra=false) {
|
||||
if (!b.op.isTemp() || b.op.regClass().type() != RegType::vgpr)
|
||||
if (b.op.isConstant() || b.op.regClass().type() != RegType::vgpr)
|
||||
std::swap(a, b);
|
||||
if (!post_ra && (!b.op.hasRegClass() || b.op.regClass().type() == RegType::sgpr))
|
||||
b = copy(def(v1), b);
|
||||
|
Reference in New Issue
Block a user