From 78bf53904e85b4578fbd5371efdf57c95ea523e1 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 7 Mar 2023 20:42:43 -0800 Subject: [PATCH] intel/fs: Delete a TODO about using brw_F32TO16. We can just use the new builder helpers to get the optimization advantages of a MOV on Gfx8+ while also getting the necessary F32TO16 on Gfx7.x and yet not worry too hard about it. Reviewed-by: Lionel Landwerlin Reviewed-by: Sagar Ghuge Part-of: --- src/intel/compiler/brw_fs_nir.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index c1b168f..50f2087 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -1070,17 +1070,8 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr, if (BRW_RND_MODE_UNSPECIFIED != rnd) bld.emit(SHADER_OPCODE_RND_MODE, bld.null_reg_ud(), brw_imm_d(rnd)); - /* In theory, it would be better to use BRW_OPCODE_F32TO16. Depending - * on the HW gen, it is a special hw opcode or just a MOV, and - * brw_F32TO16 (at brw_eu_emit) would do the work to chose. - * - * But if we want to use that opcode, we need to provide support on - * different optimizations and lowerings. As right now HF support is - * only for gfx8+, it will be better to use directly the MOV, and use - * BRW_OPCODE_F32TO16 when/if we work for HF support on gfx7. - */ assert(type_sz(op[0].type) < 8); /* brw_nir_lower_conversions */ - inst = bld.MOV(result, op[0]); + inst = bld.F32TO16(result, op[0]); break; } -- 2.7.4