diff options
author | Georg Lehmann <dadschoorse@gmail.com> | 2023-09-26 18:29:31 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2023-10-05 09:35:04 -0700 |
commit | 7200f83b9a01a8ede996e5578e0537627e05b450 (patch) | |
tree | d232075f85cdff3021e0bb0e6d8c4305d7073cb6 | |
parent | e950f1708722ac0a0e4bc9c07513c763e17bd1c6 (diff) |
aco: implement 64bit div find_lsb
This can be selected for divergent subgroupBallotFindLSB.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25407>
(cherry picked from commit b91616e80049d8de911cda06874d1d26255bafe8)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json index 5e753438241..756bdcac728 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3024,7 +3024,7 @@ "description": "aco: implement 64bit div find_lsb", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index fc5d5699c44..c443fed5819 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -1765,6 +1765,13 @@ visit_alu_instr(isel_context* ctx, nir_alu_instr* instr) emit_vop1_instruction(ctx, instr, aco_opcode::v_ffbl_b32, dst); } else if (src.regClass() == s2) { bld.sop1(aco_opcode::s_ff1_i32_b64, Definition(dst), src); + } else if (src.regClass() == v2) { + Temp lo = bld.tmp(v1), hi = bld.tmp(v1); + bld.pseudo(aco_opcode::p_split_vector, Definition(lo), Definition(hi), src); + lo = bld.vop1(aco_opcode::v_ffbl_b32, bld.def(v1), lo); + hi = bld.vop1(aco_opcode::v_ffbl_b32, bld.def(v1), hi); + hi = uadd32_sat(bld, bld.def(v1), bld.copy(bld.def(s1), Operand::c32(32u)), hi); + bld.vop2(aco_opcode::v_min_u32, Definition(dst), lo, hi); } else { isel_err(&instr->instr, "Unimplemented NIR instr bit size"); } |