From fb193ac190ea6b37f412d0181665af279f5cb4ac Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 10 Jun 2025 18:57:00 -0700 Subject: [PATCH] brw/builder: Add BFN Reviewed-by: Matt Turner Part-of: --- src/intel/compiler/brw/brw_builder.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/intel/compiler/brw/brw_builder.h b/src/intel/compiler/brw/brw_builder.h index a28c237a58e..b9c973f6dee 100644 --- a/src/intel/compiler/brw/brw_builder.h +++ b/src/intel/compiler/brw/brw_builder.h @@ -667,6 +667,32 @@ public: return alu2(BRW_OPCODE_ADD, src0, src1, out); } + brw_inst * + BFN(const brw_reg &dst, const brw_reg &src0, const brw_reg &src1, + const brw_reg &src2, unsigned table_byte) const + { + brw_inst *inst = brw_new_inst(*shader, BRW_OPCODE_BFN, dispatch_width(), + dst, 4); + + inst->src[0] = fix_3src_operand(src0); + inst->src[1] = fix_3src_operand(src1); + inst->src[2] = fix_3src_operand(src2); + inst->src[3] = brw_imm_ud(table_byte); + + return emit(inst); + } + + brw_reg + BFN(const brw_reg &src0, const brw_reg &src1, const brw_reg &src2, + unsigned table_byte, brw_inst **out = NULL) const + { + brw_reg dst = vgrf(src0.type); + emit_undef_for_partial_reg(dst); + brw_inst *inst = BFN(dst, src0, src1, src2, table_byte); + if (out) *out = inst; + return inst->dst; + } + /** * CMP: Sets the low bit of the destination channels with the result * of the comparison, while the upper bits are undefined, and updates