aco: don't use 32-bit fp inline constants for fp16 vop3p literals
If we're applying the literal 0x3f800000 to a fp16 vop3p instruction, we shouldn't use the 1.0 inline constant, because the hardware will use the 16-bit 1.0: 0x00003c00. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16296>
This commit is contained in:
@@ -88,7 +88,7 @@ emit_instruction(asm_context& ctx, std::vector<uint32_t>& out, Instruction* inst
|
||||
instr->operands.pop_back();
|
||||
assert(instr->operands[1].isConstant());
|
||||
/* in case it's an inline constant, make it a literal */
|
||||
instr->operands[1].setFixed(PhysReg(255));
|
||||
instr->operands[1] = Operand::literal32(instr->operands[1].constantValue());
|
||||
}
|
||||
|
||||
uint32_t opcode = ctx.opcode[(int)instr->opcode];
|
||||
@@ -912,8 +912,8 @@ emit_long_jump(asm_context& ctx, SOPP_instruction* branch, bool backwards,
|
||||
instr.reset(bld.sop1(aco_opcode::s_getpc_b64, branch->definitions[0]).instr);
|
||||
emit_instruction(ctx, out, instr.get());
|
||||
|
||||
instr.reset(bld.sop2(aco_opcode::s_addc_u32, def_tmp_lo, op_tmp_lo, Operand::zero()).instr);
|
||||
instr->operands[1].setFixed(PhysReg{255}); /* this operand has to be a literal */
|
||||
instr.reset(
|
||||
bld.sop2(aco_opcode::s_addc_u32, def_tmp_lo, op_tmp_lo, Operand::literal32(0)).instr);
|
||||
emit_instruction(ctx, out, instr.get());
|
||||
branch->pass_flags = out.size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user