Mesa (master): aco: fix 16-bit f2{u8,i8} on GFX6/7
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 12 16:44:38 UTC 2021
Module: Mesa
Branch: master
Commit: d8f12fd421f970bec962057ed53301cb913a79a1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8f12fd421f970bec962057ed53301cb913a79a1
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Wed Apr 7 18:14:36 2021 +0100
aco: fix 16-bit f2{u8,i8} on GFX6/7
Not really tested.
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka at gmx.de>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081>
---
src/amd/compiler/aco_instruction_selection.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 3a5b7367250..3472aa3968f 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -2602,7 +2602,8 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
Temp tmp = bld.tmp(v1);
emit_vop1_instruction(ctx, instr, aco_opcode::v_cvt_f32_f16, tmp);
tmp = bld.vop1(aco_opcode::v_cvt_i32_f32, bld.def(v1), tmp);
- tmp = convert_int(ctx, bld, tmp, 32, 16, false, (dst.type() == RegType::sgpr) ? Temp() : dst);
+ tmp = convert_int(ctx, bld, tmp, 32, instr->dest.dest.ssa.bit_size, false,
+ (dst.type() == RegType::sgpr) ? Temp() : dst);
if (dst.type() == RegType::sgpr) {
bld.pseudo(aco_opcode::p_as_uniform, Definition(dst), tmp);
}
@@ -2624,7 +2625,8 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
Temp tmp = bld.tmp(v1);
emit_vop1_instruction(ctx, instr, aco_opcode::v_cvt_f32_f16, tmp);
tmp = bld.vop1(aco_opcode::v_cvt_u32_f32, bld.def(v1), tmp);
- tmp = convert_int(ctx, bld, tmp, 32, 16, false, (dst.type() == RegType::sgpr) ? Temp() : dst);
+ tmp = convert_int(ctx, bld, tmp, 32, instr->dest.dest.ssa.bit_size, false,
+ (dst.type() == RegType::sgpr) ? Temp() : dst);
if (dst.type() == RegType::sgpr) {
bld.pseudo(aco_opcode::p_as_uniform, Definition(dst), tmp);
}
More information about the mesa-commit
mailing list