shader_recompiler: Implement S_ABS_I32 (#1713)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

This commit is contained in:
squidbus 2024-12-09 03:12:33 -08:00 committed by GitHub
parent f347d3df18
commit 0b59ebb22f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -102,6 +102,8 @@ void Translator::EmitScalarAlu(const GcnInst& inst) {
return S_SAVEEXEC_B64(NegateMode::None, false, inst); return S_SAVEEXEC_B64(NegateMode::None, false, inst);
case Opcode::S_ORN2_SAVEEXEC_B64: case Opcode::S_ORN2_SAVEEXEC_B64:
return S_SAVEEXEC_B64(NegateMode::Src1, true, inst); return S_SAVEEXEC_B64(NegateMode::Src1, true, inst);
case Opcode::S_ABS_I32:
return S_ABS_I32(inst);
default: default:
LogMissingOpcode(inst); LogMissingOpcode(inst);
} }
@ -620,6 +622,12 @@ void Translator::S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& in
ir.SetScc(result); ir.SetScc(result);
} }
void Translator::S_ABS_I32(const GcnInst& inst) {
const auto result = ir.IAbs(GetSrc(inst.src[0]));
SetDst(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
}
// SOPC // SOPC
void Translator::S_CMP(ConditionOp cond, bool is_signed, const GcnInst& inst) { void Translator::S_CMP(ConditionOp cond, bool is_signed, const GcnInst& inst) {

View file

@ -113,6 +113,7 @@ public:
void S_FF1_I32_B32(const GcnInst& inst); void S_FF1_I32_B32(const GcnInst& inst);
void S_GETPC_B64(u32 pc, const GcnInst& inst); void S_GETPC_B64(u32 pc, const GcnInst& inst);
void S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& inst); void S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& inst);
void S_ABS_I32(const GcnInst& inst);
// SOPC // SOPC
void S_CMP(ConditionOp cond, bool is_signed, const GcnInst& inst); void S_CMP(ConditionOp cond, bool is_signed, const GcnInst& inst);