diff options
| author | 2021-02-28 23:33:53 -0500 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | 20390c0548d6eef2af67a363ee120a630267b741 (patch) | |
| tree | 0df880552f80d79c769403f04df5c364397396d1 /src/shader_recompiler/frontend/ir | |
| parent | shader: Implement BFI (diff) | |
| download | yuzu-20390c0548d6eef2af67a363ee120a630267b741.tar.gz yuzu-20390c0548d6eef2af67a363ee120a630267b741.tar.xz yuzu-20390c0548d6eef2af67a363ee120a630267b741.zip | |
shader: Implement IMNMX
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 16 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 5 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 4 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 54fdf9559..04edcdfd8 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -816,6 +816,22 @@ U32 IREmitter::BitwiseNot(const U32& a) { | |||
| 816 | return Inst<U32>(Opcode::BitwiseNot32, a); | 816 | return Inst<U32>(Opcode::BitwiseNot32, a); |
| 817 | } | 817 | } |
| 818 | 818 | ||
| 819 | U32 IREmitter::SMin(const U32& a, const U32& b) { | ||
| 820 | return Inst<U32>(Opcode::SMin32, a, b); | ||
| 821 | } | ||
| 822 | |||
| 823 | U32 IREmitter::UMin(const U32& a, const U32& b) { | ||
| 824 | return Inst<U32>(Opcode::UMin32, a, b); | ||
| 825 | } | ||
| 826 | |||
| 827 | U32 IREmitter::SMax(const U32& a, const U32& b) { | ||
| 828 | return Inst<U32>(Opcode::SMax32, a, b); | ||
| 829 | } | ||
| 830 | |||
| 831 | U32 IREmitter::UMax(const U32& a, const U32& b) { | ||
| 832 | return Inst<U32>(Opcode::UMax32, a, b); | ||
| 833 | } | ||
| 834 | |||
| 819 | U1 IREmitter::ILessThan(const U32& lhs, const U32& rhs, bool is_signed) { | 835 | U1 IREmitter::ILessThan(const U32& lhs, const U32& rhs, bool is_signed) { |
| 820 | return Inst<U1>(is_signed ? Opcode::SLessThan : Opcode::ULessThan, lhs, rhs); | 836 | return Inst<U1>(is_signed ? Opcode::SLessThan : Opcode::ULessThan, lhs, rhs); |
| 821 | } | 837 | } |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 9dec22145..00ba2e4cd 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -163,6 +163,11 @@ public: | |||
| 163 | [[nodiscard]] U32 BitCount(const U32& value); | 163 | [[nodiscard]] U32 BitCount(const U32& value); |
| 164 | [[nodiscard]] U32 BitwiseNot(const U32& a); | 164 | [[nodiscard]] U32 BitwiseNot(const U32& a); |
| 165 | 165 | ||
| 166 | [[nodiscard]] U32 SMin(const U32& a, const U32& b); | ||
| 167 | [[nodiscard]] U32 UMin(const U32& a, const U32& b); | ||
| 168 | [[nodiscard]] U32 SMax(const U32& a, const U32& b); | ||
| 169 | [[nodiscard]] U32 UMax(const U32& a, const U32& b); | ||
| 170 | |||
| 166 | [[nodiscard]] U1 ILessThan(const U32& lhs, const U32& rhs, bool is_signed); | 171 | [[nodiscard]] U1 ILessThan(const U32& lhs, const U32& rhs, bool is_signed); |
| 167 | [[nodiscard]] U1 IEqual(const U32& lhs, const U32& rhs); | 172 | [[nodiscard]] U1 IEqual(const U32& lhs, const U32& rhs); |
| 168 | [[nodiscard]] U1 ILessThanEqual(const U32& lhs, const U32& rhs, bool is_signed); | 173 | [[nodiscard]] U1 ILessThanEqual(const U32& lhs, const U32& rhs, bool is_signed); |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index 59a13e911..2c4a997dc 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -235,6 +235,10 @@ OPCODE(BitReverse32, U32, U32, | |||
| 235 | OPCODE(BitCount32, U32, U32, ) | 235 | OPCODE(BitCount32, U32, U32, ) |
| 236 | OPCODE(BitwiseNot32, U32, U32, ) | 236 | OPCODE(BitwiseNot32, U32, U32, ) |
| 237 | 237 | ||
| 238 | OPCODE(SMin32, U32, U32, U32, ) | ||
| 239 | OPCODE(UMin32, U32, U32, U32, ) | ||
| 240 | OPCODE(SMax32, U32, U32, U32, ) | ||
| 241 | OPCODE(UMax32, U32, U32, U32, ) | ||
| 238 | OPCODE(SLessThan, U1, U32, U32, ) | 242 | OPCODE(SLessThan, U1, U32, U32, ) |
| 239 | OPCODE(ULessThan, U1, U32, U32, ) | 243 | OPCODE(ULessThan, U1, U32, U32, ) |
| 240 | OPCODE(IEqual, U1, U32, U32, ) | 244 | OPCODE(IEqual, U1, U32, U32, ) |