panfrost: Fix remaining release-build warnings.
authorEric Anholt <eric@anholt.net>
Tue, 25 Aug 2020 17:15:27 +0000 (10:15 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 22:45:08 +0000 (22:45 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/disassemble.c
src/panfrost/lib/gen_pack.py
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_emit.c
src/panfrost/midgard/midgard_ra.c

index d4a61a2671bf61e7e921bcff09ffb3bd44ca3c4a..2c30017d9e2ad09d0bafe075a6e8a42b7189222b 100644 (file)
@@ -1476,7 +1476,7 @@ bi_pack_add_tex_compact(bi_clause *clause, bi_instruction *ins, bi_registers *re
 static unsigned
 bi_pack_add_select(bi_instruction *ins, bi_registers *regs)
 {
 static unsigned
 bi_pack_add_select(bi_instruction *ins, bi_registers *regs)
 {
-        unsigned size = nir_alu_type_get_type_size(ins->src_types[0]);
+        ASSERTED unsigned size = nir_alu_type_get_type_size(ins->src_types[0]);
         assert(size == 16);
 
         unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
         assert(size == 16);
 
         unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
@@ -1591,7 +1591,7 @@ static unsigned
 bi_pack_add_cmp(bi_instruction *ins, bi_registers *regs)
 {
         nir_alu_type Tl = ins->src_types[0];
 bi_pack_add_cmp(bi_instruction *ins, bi_registers *regs)
 {
         nir_alu_type Tl = ins->src_types[0];
-        nir_alu_type Tr = ins->src_types[1];
+        ASSERTED nir_alu_type Tr = ins->src_types[1];
         nir_alu_type Bl = nir_alu_type_get_base_type(Tl);
 
         if (Bl == nir_type_uint || Bl == nir_type_int) {      
         nir_alu_type Bl = nir_alu_type_get_base_type(Tl);
 
         if (Bl == nir_type_uint || Bl == nir_type_int) {      
@@ -1827,7 +1827,7 @@ bi_pack_constants(bi_context *ctx, bi_clause *clause,
 {
         /* After these two, are we done? Determines tag */
         bool done = clause->constant_count <= (index + 2);
 {
         /* After these two, are we done? Determines tag */
         bool done = clause->constant_count <= (index + 2);
-        bool only = clause->constant_count <= (index + 1);
+        ASSERTED bool only = clause->constant_count <= (index + 1);
 
         /* Is the constant we're packing for a branch? */
         bool branches = clause->branch_constant && done;
 
         /* Is the constant we're packing for a branch? */
         bool branches = clause->branch_constant && done;
index 7b231c39b65ee0850e16f4baf19fcae5da3e586f..dcb22df057177305f9c89472bfbbfee63aa0e34d 100644 (file)
@@ -285,7 +285,7 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                 fprintf(fp, "%s", bi_round_mode_name(ins->roundmode));
 
         fprintf(fp, " ");
                 fprintf(fp, "%s", bi_round_mode_name(ins->roundmode));
 
         fprintf(fp, " ");
-        bool succ = bi_print_dest_index(fp, ins, ins->dest);
+        ASSERTED bool succ = bi_print_dest_index(fp, ins, ins->dest);
         assert(succ);
 
         if (ins->dest_offset)
         assert(succ);
 
         if (ins->dest_offset)
index 248d9d80a9e001d836fca63af93f51578a12c69c..066d345860863f624780cb252b5bb25c29ae215b 100644 (file)
@@ -188,7 +188,7 @@ bi_schedule(bi_context *ctx)
                         /* Check for scheduling restrictions */
 
                         bool can_fma = props & BI_SCHED_FMA;
                         /* Check for scheduling restrictions */
 
                         bool can_fma = props & BI_SCHED_FMA;
-                        bool can_add = props & BI_SCHED_ADD;
+                        ASSERTED bool can_add = props & BI_SCHED_ADD;
 
                         can_fma &= !bi_ambiguous_abs(ins);
                         can_fma &= !bi_icmp(ins);
 
                         can_fma &= !bi_ambiguous_abs(ins);
                         can_fma &= !bi_icmp(ins);
index 7169df85108859f0518af2ece1d0283f90f18900..20a047ec4b54797146ab285168fb394a328f7aa0 100644 (file)
@@ -342,8 +342,7 @@ static uint64_t get_const(uint64_t *consts, struct bifrost_regs srcs)
                 imm = consts[5];
                 break;
         default:
                 imm = consts[5];
                 break;
         default:
-                assert(0);
-                break;
+                unreachable("bad imm");
         }
         return imm | low_bits;
 }
         }
         return imm | low_bits;
 }
index 3fdef5c981ee001697048856b69e444d35bb1ff5..cf3e0feee2224874c4cda9c336d927fabc0090b6 100644 (file)
@@ -68,9 +68,8 @@ __gen_uint(uint64_t v, uint32_t start, uint32_t end)
 static inline uint32_t
 __gen_sint(int32_t v, uint32_t start, uint32_t end)
 {
 static inline uint32_t
 __gen_sint(int32_t v, uint32_t start, uint32_t end)
 {
-   const int width = end - start + 1;
-
 #ifndef NDEBUG
 #ifndef NDEBUG
+   const int width = end - start + 1;
    if (width < 64) {
       const int64_t max = (1ll << (width - 1)) - 1;
       const int64_t min = -(1ll << (width - 1));
    if (width < 64) {
       const int64_t max = (1ll << (width - 1)) - 1;
       const int64_t min = -(1ll << (width - 1));
index 2ffdee3f16267ace149f53b409d4f62cce94b6c6..7ab8cd46c1c7b821e61e37ed0a791a6d242d5100 100644 (file)
@@ -858,8 +858,8 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
         /* Should we swap arguments? */
         bool flip_src12 = false;
 
         /* Should we swap arguments? */
         bool flip_src12 = false;
 
-        unsigned src_bitsize = nir_src_bit_size(instr->src[0].src);
-        unsigned dst_bitsize = nir_dest_bit_size(*dest);
+        ASSERTED unsigned src_bitsize = nir_src_bit_size(instr->src[0].src);
+        ASSERTED unsigned dst_bitsize = nir_dest_bit_size(*dest);
 
         enum midgard_roundmode roundmode = MIDGARD_RTE;
 
 
         enum midgard_roundmode roundmode = MIDGARD_RTE;
 
@@ -1836,7 +1836,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
                         else if (combined)
                                 rt = MIDGARD_ZS_RT;
                         else
                         else if (combined)
                                 rt = MIDGARD_ZS_RT;
                         else
-                                assert(0);
+                                unreachable("bad rt");
 
                         unsigned reg_z = ~0, reg_s = ~0;
                         if (combined) {
 
                         unsigned reg_z = ~0, reg_s = ~0;
                         if (combined) {
index 77f2e3b7bf2c7a3da7ea59c2e4704ac45300de69..2ad48c8ea74eb772c814b15cfe201ab29a7864df 100644 (file)
@@ -240,7 +240,7 @@ mir_pack_swizzle(unsigned mask, unsigned *swizzle,
                 for (unsigned c = (dest_up ? 4 : 0); c < (dest_up ? 8 : 4); ++c) {
                         unsigned v = swizzle[c];
 
                 for (unsigned c = (dest_up ? 4 : 0); c < (dest_up ? 8 : 4); ++c) {
                         unsigned v = swizzle[c];
 
-                        bool t_upper = v > 3;
+                        ASSERTED bool t_upper = v > 3;
 
                         /* Ensure we're doing something sane */
 
 
                         /* Ensure we're doing something sane */
 
@@ -419,7 +419,7 @@ mir_pack_ldst_mask(midgard_instruction *ins)
                 for (unsigned i = 0; i < 4; ++i) {
                         /* Make sure we're duplicated */
                         bool u = (ins->mask & (1 << (2*i + 0))) != 0;
                 for (unsigned i = 0; i < 4; ++i) {
                         /* Make sure we're duplicated */
                         bool u = (ins->mask & (1 << (2*i + 0))) != 0;
-                        bool v = (ins->mask & (1 << (2*i + 1))) != 0;
+                        ASSERTED bool v = (ins->mask & (1 << (2*i + 1))) != 0;
                         assert(u == v);
 
                         packed |= (u << i);
                         assert(u == v);
 
                         packed |= (u << i);
index bb95d3854298f9277df3aa815a385eb8f2c650ab..c2b5c0701ac933a021d058150cc02d7294526ebd 100644 (file)
@@ -116,7 +116,7 @@ set_class(unsigned *classes, unsigned node, unsigned class)
 /* Special register classes impose special constraints on who can read their
  * values, so check that */
 
 /* Special register classes impose special constraints on who can read their
  * values, so check that */
 
-static bool
+static bool ASSERTED
 check_read_class(unsigned *classes, unsigned tag, unsigned node)
 {
         /* Non-nodes are implicitly ok */
 check_read_class(unsigned *classes, unsigned tag, unsigned node)
 {
         /* Non-nodes are implicitly ok */
@@ -137,7 +137,7 @@ check_read_class(unsigned *classes, unsigned tag, unsigned node)
         }
 }
 
         }
 }
 
-static bool
+static bool ASSERTED
 check_write_class(unsigned *classes, unsigned tag, unsigned node)
 {
         /* Non-nodes are implicitly ok */
 check_write_class(unsigned *classes, unsigned tag, unsigned node)
 {
         /* Non-nodes are implicitly ok */