mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-22 11:56:58 +02:00
shader: build the V_MBCNT lanes-below mask with the shared right-mask helper
This commit is contained in:
@@ -327,8 +327,7 @@ void Translator::V_BCNT_U32_B32(const Decoder::Instruction& inst) {
|
|||||||
void Translator::V_MBCNT_U32_B32(const Decoder::Instruction& inst, bool low) {
|
void Translator::V_MBCNT_U32_B32(const Decoder::Instruction& inst, bool low) {
|
||||||
const auto lane = IR::U32(ir.Emit(IR::ValueOpcode::LaneId));
|
const auto lane = IR::U32(ir.Emit(IR::ValueOpcode::LaneId));
|
||||||
const auto local = ir.BitwiseAnd(lane, IR::U32(IR::Value(31u)));
|
const auto local = ir.BitwiseAnd(lane, IR::U32(IR::Value(31u)));
|
||||||
const auto below =
|
const auto below = RightMask32(local);
|
||||||
ir.ISub(ir.ShiftLeftLogical(IR::U32(IR::Value(1u)), local), IR::U32(IR::Value(1u)));
|
|
||||||
const auto high_lane =
|
const auto high_lane =
|
||||||
IR::U1(ir.Emit(IR::ValueOpcode::UGreaterThanEqual32, {lane, IR::Value(32u)}));
|
IR::U1(ir.Emit(IR::ValueOpcode::UGreaterThanEqual32, {lane, IR::Value(32u)}));
|
||||||
const auto thread_mask = low ? ir.Select(high_lane, IR::U32(IR::Value(0xffffffffu)), below)
|
const auto thread_mask = low ? ir.Select(high_lane, IR::U32(IR::Value(0xffffffffu)), below)
|
||||||
|
|||||||
Reference in New Issue
Block a user