lima/gpir: Support branch instructions
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 28 Aug 2019 08:57:35 +0000 (10:57 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 24 Sep 2019 06:35:47 +0000 (08:35 +0200)
commit7594ef6eb0c2c6bcaa5945030d1ad40f4b1c56b1
treeb3b506bfeb939965edabad7a0c92c30036387a01
parent2df2e081fde5ff84ce87fe4763e8e6a3372694e8
lima/gpir: Support branch instructions

Because branch conditions have to be in the pass slot, there is no
unconditional branch, and realistically the pass slot has to contain a
move when branching (there's nothing it does that would be useful for
operating on booleans, so we can't use it for anything when computing
the branch condition), we put the branch instruction in the pass slot
and at codegen time turn it into a move of the branch condition. This
means that it doesn't have to be special-cased like store instructions
are in the scheduler. Because of this decision we can remove the
half-implemented BRANCH codegen slot. Finally, we (ab)use the existing
schedule_first mechanism to make sure that branches are always last in
the basic block.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/ir/gp/codegen.c
src/gallium/drivers/lima/ir/gp/gpir.h
src/gallium/drivers/lima/ir/gp/instr.c
src/gallium/drivers/lima/ir/gp/lower.c
src/gallium/drivers/lima/ir/gp/nir.c
src/gallium/drivers/lima/ir/gp/node.c