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
@@ -94,7 +94,6 @@ remove_unsupported_casts(no_16bit_conv, 16, 0xffff, 65535.0, -32768.0, 32767.0)
lower_x2b = [
(('b2b32', 'a'), ('b2i32', 'a')),
(('b2b1', 'a'), ('ine', ('b2i32', a), 0)),
(('f2b1', 'a'), ('fneu', a, 0)),
]
no_16bit_conv += [
-10
View File
@@ -2397,15 +2397,6 @@ emit_b2f64(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value
return emit_select(ctx, alu, val, c1, c0);
}
static bool
emit_f2b32(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value *val)
{
assert(val);
const struct dxil_value *zero = dxil_module_get_float_const(&ctx->mod, 0.0f);
return emit_cmp(ctx, alu, DXIL_FCMP_UNE, val, zero);
}
static bool
emit_f16tof32(struct ntd_context *ctx, nir_alu_instr *alu, const struct dxil_value *val, bool shift)
{
@@ -2716,7 +2707,6 @@ emit_alu(struct ntd_context *ctx, nir_alu_instr *alu)
case nir_op_u2u64:
return emit_cast(ctx, alu, src[0]);
case nir_op_f2b32: return emit_f2b32(ctx, alu, src[0]);
case nir_op_b2f16: return emit_b2f16(ctx, alu, src[0]);
case nir_op_b2f32: return emit_b2f32(ctx, alu, src[0]);
case nir_op_b2f64: return emit_b2f64(ctx, alu, src[0]);