#ifndef NDEBUG
#define ASSERT_TABLE_IS_COMMUTATIVE(t) \
do { \
+ _Pragma("GCC unroll 7") \
for (unsigned r = 0; r < ARRAY_SIZE(t); r++) { \
+ _Pragma("GCC unroll 7") \
for (unsigned c = 0; c < ARRAY_SIZE(t[0]); c++) \
assert(t[r][c] == t[c][r]); \
} \
#define ASSERT_TABLE_IS_DIAGONAL(t) \
do { \
+ _Pragma("GCC unroll 7") \
for (unsigned r = 0; r < ARRAY_SIZE(t); r++) \
assert(t[r][r] == r); \
} while (false)
*/
#define ASSERT_UNION_OF_OTHERS_MATCHES_UNKNOWN_2_SOURCE(t) \
do { \
+ _Pragma("GCC unroll 7") \
for (unsigned i = 0; i < last_range; i++) { \
enum ssa_ranges col_range = t[i][unknown + 1]; \
enum ssa_ranges row_range = t[unknown + 1][i]; \
\
+ _Pragma("GCC unroll 5") \
for (unsigned j = unknown + 2; j < last_range; j++) { \
col_range = union_ranges(col_range, t[i][j]); \
row_range = union_ranges(row_range, t[j][i]); \
#define ASSERT_UNION_OF_EQ_AND_STRICT_INEQ_MATCHES_NONSTRICT_2_SOURCE(t) \
do { \
+ _Pragma("GCC unroll 7") \
for (unsigned i = 0; i < last_range; i++) { \
assert(union_ranges(t[i][lt_zero], t[i][eq_zero]) == t[i][le_zero]); \
assert(union_ranges(t[i][gt_zero], t[i][eq_zero]) == t[i][ge_zero]); \
#define ASSERT_UNION_OF_DISJOINT_MATCHES_UNKNOWN_2_SOURCE(t) \
do { \
+ _Pragma("GCC unroll 7") \
for (unsigned i = 0; i < last_range; i++) { \
assert(union_ranges(t[i][lt_zero], t[i][ge_zero]) == \
t[i][unknown]); \
analyze_expression(const nir_alu_instr *instr, unsigned src,
struct hash_table *ht, nir_alu_type use_type)
{
+ /* Ensure that the _Pragma("GCC unroll 7") above are correct. */
+ STATIC_ASSERT(last_range + 1 == 7);
+
if (!instr->src[src].src.is_ssa)
return (struct ssa_result_range){unknown, false};