nir: Eliminate nir_op_f2b

Builds on the work of !15121.  This gets to delete even more code
because many drivers shared a lot of code for i2b and f2b.

No shader-db or fossil-db changes on any Intel platform.

v2: Rebase on 1a35acd8d9.

v3: Update a comment in nir_opcodes_c.py. Suggested by Konstantin.

v4: Another rebase. Remove f2b stuff from Midgard.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
This commit is contained in:
Ian Romanick
2022-02-22 10:22:12 -08:00
committed by Marge Bot
parent 024122c069
commit ea413e826b
30 changed files with 10 additions and 227 deletions

View File

@@ -129,11 +129,6 @@ nir_op_matches_search_op(nir_op nop, uint16_t sop)
nop == nir_op_##op##32 || \
nop == nir_op_##op##64;
#define MATCH_BCONV_CASE(op) \
case nir_search_op_##op: \
return nop == nir_op_##op##1 || \
nop == nir_op_##op##32;
switch (sop) {
MATCH_FCONV_CASE(i2f)
MATCH_FCONV_CASE(u2f)
@@ -144,14 +139,12 @@ nir_op_matches_search_op(nir_op nop, uint16_t sop)
MATCH_ICONV_CASE(i2i)
MATCH_FCONV_CASE(b2f)
MATCH_ICONV_CASE(b2i)
MATCH_BCONV_CASE(f2b)
default:
unreachable("Invalid nir_search_op");
}
#undef MATCH_FCONV_CASE
#undef MATCH_ICONV_CASE
#undef MATCH_BCONV_CASE
}
uint16_t
@@ -170,11 +163,6 @@ nir_search_op_for_nir_op(nir_op nop)
case nir_op_##op##64: \
return nir_search_op_##op;
#define MATCH_BCONV_CASE(op) \
case nir_op_##op##1: \
case nir_op_##op##32: \
return nir_search_op_##op;
switch (nop) {
MATCH_FCONV_CASE(i2f)
@@ -186,14 +174,12 @@ nir_search_op_for_nir_op(nir_op nop)
MATCH_ICONV_CASE(i2i)
MATCH_FCONV_CASE(b2f)
MATCH_ICONV_CASE(b2i)
MATCH_BCONV_CASE(f2b)
default:
return nop;
}
#undef MATCH_FCONV_CASE
#undef MATCH_ICONV_CASE
#undef MATCH_BCONV_CASE
}
static nir_op
@@ -221,14 +207,6 @@ nir_op_for_search_op(uint16_t sop, unsigned bit_size)
default: unreachable("Invalid bit size"); \
}
#define RET_BCONV_CASE(op) \
case nir_search_op_##op: \
switch (bit_size) { \
case 1: return nir_op_##op##1; \
case 32: return nir_op_##op##32; \
default: unreachable("Invalid bit size"); \
}
switch (sop) {
RET_FCONV_CASE(i2f)
RET_FCONV_CASE(u2f)
@@ -239,14 +217,12 @@ nir_op_for_search_op(uint16_t sop, unsigned bit_size)
RET_ICONV_CASE(i2i)
RET_FCONV_CASE(b2f)
RET_ICONV_CASE(b2i)
RET_BCONV_CASE(f2b)
default:
unreachable("Invalid nir_search_op");
}
#undef RET_FCONV_CASE
#undef RET_ICONV_CASE
#undef RET_BCONV_CASE
}
static bool
@@ -615,7 +591,6 @@ UNUSED static void dump_value(const nir_algebraic_table *table, const nir_search
switch (expr->opcode) {
#define CASE(n) \
case nir_search_op_##n: fprintf(stderr, #n); break;
CASE(f2b)
CASE(b2f)
CASE(b2i)
CASE(i2i)