summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2019-03-29 21:40:45 +0100
committerAlyssa Rosenzweig <[email protected]>2019-04-07 15:56:10 +0000
commit1aabb79bdcec36b1f7704a1a30e41558b4cde584 (patch)
tree5333c47a7f59c385ccf34a0907095e96bebe2670 /src
parent10a2fdacfa3f96a57fec304cf54d1c298e4f0943 (diff)
panfrost/midgard: use nir_src_is_const and nir_src_as_uint
Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_compile.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index c68067d50a5..81e2a626c54 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1314,7 +1314,6 @@ emit_sysval_read(compiler_context *ctx, nir_intrinsic_instr *instr)
static void
emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
{
- nir_const_value *const_offset;
unsigned offset, reg;
switch (instr->intrinsic) {
@@ -1335,10 +1334,9 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
case nir_intrinsic_load_uniform:
case nir_intrinsic_load_input:
- const_offset = nir_src_as_const_value(instr->src[0]);
- assert (const_offset && "no indirect inputs");
+ assert(nir_src_is_const(instr->src[0]) && "no indirect inputs");
- offset = nir_intrinsic_base(instr) + const_offset->u32[0];
+ offset = nir_intrinsic_base(instr) + nir_src_as_uint(instr->src[0]);
reg = nir_dest_index(ctx, &instr->dest);
@@ -1473,10 +1471,9 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
break;
case nir_intrinsic_store_output:
- const_offset = nir_src_as_const_value(instr->src[1]);
- assert(const_offset && "no indirect outputs");
+ assert(nir_src_is_const(instr->src[1]) && "no indirect outputs");
- offset = nir_intrinsic_base(instr) + const_offset->u32[0];
+ offset = nir_intrinsic_base(instr) + nir_src_as_uint(instr->src[1]);
reg = nir_src_index(ctx, &instr->src[0]);