From: Georg Lehmann Date: Tue, 21 Mar 2023 11:27:28 +0000 (+0100) Subject: aco/to_hw_instr: use VOP1 opsel for v_mov_b16 X-Git-Tag: upstream/23.3.3~10837 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ee1519ceecd9105855b3c9aad85e729565b6c6c;p=platform%2Fupstream%2Fmesa.git aco/to_hw_instr: use VOP1 opsel for v_mov_b16 Foz-DB GFX1100: Totals from 4661 (3.46% of 134864) affected shaders: CodeSize: 36500568 -> 36391704 (-0.30%) Reviewed-by: Rhys Perry Part-of: --- diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index 2d92b63..dc8dba5 100644 --- a/src/amd/compiler/aco_lower_to_hw_instr.cpp +++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp @@ -1109,23 +1109,15 @@ emit_v_mov_b16(Builder& bld, Definition dst, Operand op) if (!op.isLiteral() && op.physReg() >= 240) { /* v_add_f16 is smaller because it can use 16bit fp inline constants. */ Instruction* instr = bld.vop2_e64(aco_opcode::v_add_f16, dst, op, Operand::zero()); - if (dst.physReg().byte() == 2) - instr->valu().opsel = 0x8; + instr->valu().opsel[3] = dst.physReg().byte() == 2; return; } op = Operand::c32((int32_t)(int16_t)op.constantValue()); } - if (!dst.physReg().byte() && !op.physReg().byte()) { - bld.vop1(aco_opcode::v_mov_b16, dst, op); - } else { - // TODO: this can use VOP1 for vgpr0-127 with assembler support - Instruction* instr = bld.vop1_e64(aco_opcode::v_mov_b16, dst, op); - if (op.physReg().byte() == 2) - instr->valu().opsel |= 0x1; - if (dst.physReg().byte() == 2) - instr->valu().opsel |= 0x8; - } + Instruction* instr = bld.vop1(aco_opcode::v_mov_b16, dst, op); + instr->valu().opsel[0] = op.physReg().byte() == 2; + instr->valu().opsel[3] = dst.physReg().byte() == 2; } void