diff --git a/src/intel/compiler/elk/elk_compiler.c b/src/intel/compiler/elk/elk_compiler.c index d78372defe3..86dd0668fae 100644 --- a/src/intel/compiler/elk/elk_compiler.c +++ b/src/intel/compiler/elk/elk_compiler.c @@ -119,7 +119,6 @@ elk_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo) nir_options->lower_bitfield_reverse = devinfo->ver < 7; nir_options->lower_find_lsb = devinfo->ver < 7; nir_options->lower_ifind_msb = devinfo->ver < 7; - nir_options->has_iadd3 = devinfo->verx10 >= 125; nir_options->lower_int64_options = int64_options; nir_options->lower_doubles_options = fp64_options; diff --git a/src/intel/compiler/elk/elk_eu.c b/src/intel/compiler/elk/elk_eu.c index 00af3eed62f..98e69e74379 100644 --- a/src/intel/compiler/elk/elk_eu.c +++ b/src/intel/compiler/elk/elk_eu.c @@ -733,7 +733,6 @@ static const struct elk_opcode_desc opcode_descs[] = { { ELK_OPCODE_SUBB, 79, "subb", 2, 1, GFX_GE(GFX7) }, { ELK_OPCODE_SAD2, 80, "sad2", 2, 1, GFX_ALL }, { ELK_OPCODE_SADA2, 81, "sada2", 2, 1, GFX_ALL }, - { ELK_OPCODE_ADD3, 82, "add3", 3, 1, GFX_GE(GFX125) }, { ELK_OPCODE_DP4, 84, "dp4", 2, 1, GFX_LT(GFX11) }, { ELK_OPCODE_DPH, 85, "dph", 2, 1, GFX_LT(GFX11) }, { ELK_OPCODE_DP3, 86, "dp3", 2, 1, GFX_LT(GFX11) }, diff --git a/src/intel/compiler/elk/elk_eu.h b/src/intel/compiler/elk/elk_eu.h index 93ef92708b6..b92cf525222 100644 --- a/src/intel/compiler/elk/elk_eu.h +++ b/src/intel/compiler/elk/elk_eu.h @@ -241,7 +241,6 @@ ALU3(CSEL) ALU1(F32TO16) ALU1(F16TO32) ALU2(ADD) -ALU3(ADD3) ALU2(AVG) ALU2(MUL) ALU1(FRC) diff --git a/src/intel/compiler/elk/elk_eu_emit.c b/src/intel/compiler/elk/elk_eu_emit.c index 03e5dc618e8..f73418673bc 100644 --- a/src/intel/compiler/elk/elk_eu_emit.c +++ b/src/intel/compiler/elk/elk_eu_emit.c @@ -1076,7 +1076,6 @@ ALU1(FBL) ALU1(CBIT) ALU2(ADDC) ALU2(SUBB) -ALU3(ADD3) elk_inst * elk_MOV(struct elk_codegen *p, struct elk_reg dest, struct elk_reg src0) diff --git a/src/intel/compiler/elk/elk_eu_opcodes.h b/src/intel/compiler/elk/elk_eu_opcodes.h index 350acb0830d..c1b7b32158f 100644 --- a/src/intel/compiler/elk/elk_eu_opcodes.h +++ b/src/intel/compiler/elk/elk_eu_opcodes.h @@ -79,7 +79,6 @@ enum elk_opcode { ELK_OPCODE_SUBB, /**< Gfx7+ */ ELK_OPCODE_SAD2, ELK_OPCODE_SADA2, - ELK_OPCODE_ADD3, /* Gen12+ only */ ELK_OPCODE_DP4, ELK_OPCODE_DPH, ELK_OPCODE_DP3, diff --git a/src/intel/compiler/elk/elk_eu_validate.c b/src/intel/compiler/elk/elk_eu_validate.c index 34f443e4231..892dff3dbe3 100644 --- a/src/intel/compiler/elk/elk_eu_validate.c +++ b/src/intel/compiler/elk/elk_eu_validate.c @@ -2221,47 +2221,6 @@ instruction_restrictions(const struct elk_isa_info *isa, } } - if (elk_inst_opcode(isa, inst) == ELK_OPCODE_ADD3) { - const enum elk_reg_type dst_type = inst_dst_type(isa, inst); - - ERROR_IF(dst_type != ELK_REGISTER_TYPE_D && - dst_type != ELK_REGISTER_TYPE_UD && - dst_type != ELK_REGISTER_TYPE_W && - dst_type != ELK_REGISTER_TYPE_UW, - "Destination must be integer D, UD, W, or UW type."); - - for (unsigned i = 0; i < 3; i++) { - enum elk_reg_type src_type; - - switch (i) { - case 0: src_type = elk_inst_3src_a1_src0_type(devinfo, inst); break; - case 1: src_type = elk_inst_3src_a1_src1_type(devinfo, inst); break; - case 2: src_type = elk_inst_3src_a1_src2_type(devinfo, inst); break; - default: unreachable("invalid src"); - } - - ERROR_IF(src_type != ELK_REGISTER_TYPE_D && - src_type != ELK_REGISTER_TYPE_UD && - src_type != ELK_REGISTER_TYPE_W && - src_type != ELK_REGISTER_TYPE_UW, - "Source must be integer D, UD, W, or UW type."); - - if (i == 0) { - if (elk_inst_3src_a1_src0_is_imm(devinfo, inst)) { - ERROR_IF(src_type != ELK_REGISTER_TYPE_W && - src_type != ELK_REGISTER_TYPE_UW, - "Immediate source must be integer W or UW type."); - } - } else if (i == 2) { - if (elk_inst_3src_a1_src2_is_imm(devinfo, inst)) { - ERROR_IF(src_type != ELK_REGISTER_TYPE_W && - src_type != ELK_REGISTER_TYPE_UW, - "Immediate source must be integer W or UW type."); - } - } - } - } - if (elk_inst_opcode(isa, inst) == ELK_OPCODE_OR || elk_inst_opcode(isa, inst) == ELK_OPCODE_AND || elk_inst_opcode(isa, inst) == ELK_OPCODE_XOR || diff --git a/src/intel/compiler/elk/elk_fs.cpp b/src/intel/compiler/elk/elk_fs.cpp index dc4ccbe5011..32ba6cacadd 100644 --- a/src/intel/compiler/elk/elk_fs.cpp +++ b/src/intel/compiler/elk/elk_fs.cpp @@ -4723,7 +4723,6 @@ get_lowered_simd_width(const elk_fs_visitor *shader, const elk_fs_inst *inst) case ELK_OPCODE_SAD2: case ELK_OPCODE_MAD: case ELK_OPCODE_LRP: - case ELK_OPCODE_ADD3: case ELK_FS_OPCODE_PACK: case ELK_SHADER_OPCODE_SEL_EXEC: case ELK_SHADER_OPCODE_CLUSTER_BROADCAST: diff --git a/src/intel/compiler/elk/elk_fs_builder.h b/src/intel/compiler/elk/elk_fs_builder.h index cf005609acd..19c88a01fa1 100644 --- a/src/intel/compiler/elk/elk_fs_builder.h +++ b/src/intel/compiler/elk/elk_fs_builder.h @@ -617,7 +617,6 @@ namespace elk { } ALU2(ADD) - ALU3(ADD3) ALU2_ACC(ADDC) ALU2(AND) ALU2(ASR) diff --git a/src/intel/compiler/elk/elk_fs_combine_constants.cpp b/src/intel/compiler/elk/elk_fs_combine_constants.cpp index 860419fc6ee..b5c5b92ca92 100644 --- a/src/intel/compiler/elk/elk_fs_combine_constants.cpp +++ b/src/intel/compiler/elk/elk_fs_combine_constants.cpp @@ -1038,10 +1038,6 @@ supports_src_as_imm(const struct intel_device_info *devinfo, const elk_fs_inst * return false; switch (inst->opcode) { - case ELK_OPCODE_ADD3: - /* ADD3 only exists on Gfx12.5+. */ - return true; - case ELK_OPCODE_MAD: /* Integer types can always mix sizes. Floating point types can mix * sizes on Gfx12. On Gfx12.5, floating point sources must all be HF or @@ -1357,7 +1353,6 @@ elk_fs_visitor::opt_combine_constants() break; - case ELK_OPCODE_ADD3: case ELK_OPCODE_MAD: { for (int i = 0; i < inst->sources; i++) { if (inst->src[i].file != IMM) diff --git a/src/intel/compiler/elk/elk_fs_copy_propagation.cpp b/src/intel/compiler/elk/elk_fs_copy_propagation.cpp index 2cb32417565..498222473c1 100644 --- a/src/intel/compiler/elk/elk_fs_copy_propagation.cpp +++ b/src/intel/compiler/elk/elk_fs_copy_propagation.cpp @@ -1104,30 +1104,6 @@ try_constant_propagate(const elk_compiler *compiler, elk_fs_inst *inst, } break; - case ELK_OPCODE_ADD3: - /* add3 can have a single imm16 source. Proceed if the source type is - * already W or UW or the value can be coerced to one of those types. - */ - if (val.type == ELK_REGISTER_TYPE_W || val.type == ELK_REGISTER_TYPE_UW) - ; /* Nothing to do. */ - else if (val.ud <= 0xffff) - val = elk_imm_uw(val.ud); - else if (val.d >= -0x8000 && val.d <= 0x7fff) - val = elk_imm_w(val.d); - else - break; - - if (arg == 2) { - inst->src[arg] = val; - progress = true; - } else if (inst->src[2].file != IMM) { - inst->src[arg] = inst->src[2]; - inst->src[2] = val; - progress = true; - } - - break; - case ELK_OPCODE_CMP: case ELK_OPCODE_IF: if (arg == 1) { @@ -1307,15 +1283,6 @@ opt_copy_propagation_local(const elk_compiler *compiler, linear_ctx *lin_ctx, if (instruction_progress) { progress = true; - /* ADD3 can only have the immediate as src0. */ - if (inst->opcode == ELK_OPCODE_ADD3) { - if (inst->src[2].file == IMM) { - const auto src0 = inst->src[0]; - inst->src[0] = inst->src[2]; - inst->src[2] = src0; - } - } - /* If only one of the sources of a 2-source, commutative instruction (e.g., * AND) is immediate, it must be src1. If both are immediate, opt_algebraic * should fold it away. diff --git a/src/intel/compiler/elk/elk_fs_generator.cpp b/src/intel/compiler/elk/elk_fs_generator.cpp index d1608903b45..b9b78d37ee8 100644 --- a/src/intel/compiler/elk/elk_fs_generator.cpp +++ b/src/intel/compiler/elk/elk_fs_generator.cpp @@ -1816,11 +1816,6 @@ elk_fs_generator::generate_code(const elk_cfg_t *cfg, int dispatch_width, elk_LRP(p, dst, src[0], src[1], src[2]); break; - case ELK_OPCODE_ADD3: - assert(devinfo->verx10 >= 125); - elk_ADD3(p, dst, src[0], src[1], src[2]); - break; - case ELK_OPCODE_FRC: elk_FRC(p, dst, src[0]); break; diff --git a/src/intel/compiler/elk/elk_fs_nir.cpp b/src/intel/compiler/elk/elk_fs_nir.cpp index 84d07d49c18..b2e2e604b03 100644 --- a/src/intel/compiler/elk/elk_fs_nir.cpp +++ b/src/intel/compiler/elk/elk_fs_nir.cpp @@ -1278,10 +1278,6 @@ fs_nir_emit_alu(nir_to_elk_state &ntb, nir_alu_instr *instr, inst = bld.ADD(result, op[0], op[1]); break; - case nir_op_iadd3: - inst = bld.ADD3(result, op[0], op[1], op[2]); - break; - case nir_op_iadd_sat: case nir_op_uadd_sat: inst = bld.ADD(result, op[0], op[1]); @@ -4682,20 +4678,6 @@ try_rebuild_resource(nir_to_elk_state &ntb, const elk::fs_builder &bld, nir_def src0.file != IMM ? src1 : src0); break; } - case nir_op_iadd3: { - elk_fs_reg dst = ubld8.vgrf(ELK_REGISTER_TYPE_UD); - elk_fs_reg src0 = ntb.resource_insts[alu->src[0].src.ssa->index]->dst; - elk_fs_reg src1 = ntb.resource_insts[alu->src[1].src.ssa->index]->dst; - elk_fs_reg src2 = ntb.resource_insts[alu->src[2].src.ssa->index]->dst; - assert(src0.file != BAD_FILE && src1.file != BAD_FILE && src2.file != BAD_FILE); - assert(src0.type == ELK_REGISTER_TYPE_UD); - ntb.resource_insts[def->index] = - ubld8.ADD3(dst, - src1.file == IMM ? src1 : src0, - src1.file == IMM ? src0 : src1, - src2); - break; - } case nir_op_ushr: { elk_fs_reg dst = ubld8.vgrf(ELK_REGISTER_TYPE_UD); elk_fs_reg src0 = ntb.resource_insts[alu->src[0].src.ssa->index]->dst; diff --git a/src/intel/compiler/elk/elk_gram.y b/src/intel/compiler/elk/elk_gram.y index f93600e7649..179b758686a 100644 --- a/src/intel/compiler/elk/elk_gram.y +++ b/src/intel/compiler/elk/elk_gram.y @@ -273,9 +273,6 @@ i965_asm_ternary_instruction(int opcode, case ELK_OPCODE_BFI2: elk_BFI2(p, dest, src0, src1, src2); break; - case ELK_OPCODE_ADD3: - elk_ADD3(p, dest, src0, src1, src2); - break; default: fprintf(stderr, "Unsupported ternary opcode\n"); } @@ -388,7 +385,7 @@ add_label(struct elk_codegen *p, const char* label_name, enum instr_label_type t %token JUMP_LABEL_TARGET /* opcodes */ -%token ADD ADD3 ADDC AND ASR AVG +%token ADD ADDC AND ASR AVG %token BFE BFI1 BFI2 BFB BFREV BRC BRD BREAK %token CALL CALLA CASE CBIT CMP CMPN CONT CSEL %token DIM DO DP2 DP3 DP4 DPH @@ -951,7 +948,6 @@ ternaryopcodes: | BFI2 | LRP | MAD - | ADD3 ; /* Wait instruction */ diff --git a/src/intel/compiler/elk/elk_ir_performance.cpp b/src/intel/compiler/elk/elk_ir_performance.cpp index 58a1c7efc98..4fb6b7b3455 100644 --- a/src/intel/compiler/elk/elk_ir_performance.cpp +++ b/src/intel/compiler/elk/elk_ir_performance.cpp @@ -379,7 +379,6 @@ namespace { case ELK_OPCODE_MOV: case ELK_OPCODE_CMP: case ELK_OPCODE_ADD: - case ELK_OPCODE_ADD3: case ELK_OPCODE_MUL: case ELK_SHADER_OPCODE_MOV_RELOC_IMM: case ELK_VEC4_OPCODE_MOV_FOR_SCRATCH: diff --git a/src/intel/compiler/elk/elk_lex.l b/src/intel/compiler/elk/elk_lex.l index 4459edd02c0..a83e4bd9457 100644 --- a/src/intel/compiler/elk/elk_lex.l +++ b/src/intel/compiler/elk/elk_lex.l @@ -52,7 +52,6 @@ null { BEGIN(REG); return NULL_TOKEN; } /* Opcodes */ add { yylval.integer = ELK_OPCODE_ADD; return ADD; } -add3 { yylval.integer = ELK_OPCODE_ADD3; return ADD3; } addc { yylval.integer = ELK_OPCODE_ADDC; return ADDC; } and { yylval.integer = ELK_OPCODE_AND; return AND; } asr { yylval.integer = ELK_OPCODE_ASR; return ASR; } diff --git a/src/intel/compiler/elk/elk_shader.cpp b/src/intel/compiler/elk/elk_shader.cpp index a203ec50c0a..38b84362ef0 100644 --- a/src/intel/compiler/elk/elk_shader.cpp +++ b/src/intel/compiler/elk/elk_shader.cpp @@ -821,7 +821,6 @@ elk_backend_instruction::is_commutative() const case ELK_OPCODE_OR: case ELK_OPCODE_XOR: case ELK_OPCODE_ADD: - case ELK_OPCODE_ADD3: case ELK_OPCODE_MUL: case ELK_SHADER_OPCODE_MULH: return true; @@ -944,7 +943,6 @@ elk_backend_instruction::can_do_saturate() const { switch (opcode) { case ELK_OPCODE_ADD: - case ELK_OPCODE_ADD3: case ELK_OPCODE_ASR: case ELK_OPCODE_AVG: case ELK_OPCODE_CSEL: @@ -990,7 +988,6 @@ elk_backend_instruction::can_do_cmod() const { switch (opcode) { case ELK_OPCODE_ADD: - case ELK_OPCODE_ADD3: case ELK_OPCODE_ADDC: case ELK_OPCODE_AND: case ELK_OPCODE_ASR: