diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-02 15:25:02 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-02 16:48:54 -0700 |
commit | d4bcca19dacfac53ffbad0dddd8f5919adb508c3 (patch) | |
tree | c12e370bd6b98520d271e2e8bdd121537d3ca83e /src/panfrost/midgard/compiler.h | |
parent | 513d02cfeb9cd42d8ed41a6999bcab08bb5e239d (diff) |
pan/midgard: Switch sources to an array for trinary sources
We need three independent sources to support indirect SSBO writes (as
well as textures with both LOD/bias and offsets). Now is a good time to
make sources just an array so we don't have to rewrite a ton of code if
we ever needed a fourth source for some reason.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/compiler.h')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index e35789fcfcd..7a07bb847bf 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -71,12 +71,9 @@ typedef struct midgard_branch { * registers. Negative values mean unused. */ typedef struct { - int src0; - int src1; + int src[3]; int dest; - /* src1 is -not- SSA but instead a 16-bit inline constant to be smudged - * in. Only valid for ALU ops. */ bool inline_constant; } ssa_args; @@ -472,8 +469,7 @@ v_mov(unsigned src, midgard_vector_alu_src mod, unsigned dest) .type = TAG_ALU_4, .mask = 0xF, .ssa_args = { - .src0 = SSA_UNUSED_1, - .src1 = src, + .src = { SSA_UNUSED_1, src, -1 }, .dest = dest, }, .alu = { @@ -492,11 +488,10 @@ v_mov(unsigned src, midgard_vector_alu_src mod, unsigned dest) static inline bool mir_has_arg(midgard_instruction *ins, unsigned arg) { - if (ins->ssa_args.src0 == arg) - return true; - - if (ins->ssa_args.src1 == arg && !ins->ssa_args.inline_constant) - return true; + for (unsigned i = 0; i < ARRAY_SIZE(ins->ssa_args.src); ++i) { + if (ins->ssa_args.src[i] == arg) + return true; + } return false; } |