diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 8 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 2 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index d6a1d8ec2..9b898e4e1 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1183,6 +1183,14 @@ U32 IREmitter::IMax(const U32& a, const U32& b, bool is_signed) { | |||
| 1183 | return is_signed ? SMax(a, b) : UMax(a, b); | 1183 | return is_signed ? SMax(a, b) : UMax(a, b); |
| 1184 | } | 1184 | } |
| 1185 | 1185 | ||
| 1186 | U32 IREmitter::SClamp(const U32& value, const U32& min, const U32& max) { | ||
| 1187 | return Inst<U32>(Opcode::SClamp32, value, min, max); | ||
| 1188 | } | ||
| 1189 | |||
| 1190 | U32 IREmitter::UClamp(const U32& value, const U32& min, const U32& max) { | ||
| 1191 | return Inst<U32>(Opcode::UClamp32, value, min, max); | ||
| 1192 | } | ||
| 1193 | |||
| 1186 | U1 IREmitter::ILessThan(const U32& lhs, const U32& rhs, bool is_signed) { | 1194 | U1 IREmitter::ILessThan(const U32& lhs, const U32& rhs, bool is_signed) { |
| 1187 | return Inst<U1>(is_signed ? Opcode::SLessThan : Opcode::ULessThan, lhs, rhs); | 1195 | return Inst<U1>(is_signed ? Opcode::SLessThan : Opcode::ULessThan, lhs, rhs); |
| 1188 | } | 1196 | } |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 842c2bdaf..269f367a4 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -206,6 +206,8 @@ public: | |||
| 206 | [[nodiscard]] U32 SMax(const U32& a, const U32& b); | 206 | [[nodiscard]] U32 SMax(const U32& a, const U32& b); |
| 207 | [[nodiscard]] U32 UMax(const U32& a, const U32& b); | 207 | [[nodiscard]] U32 UMax(const U32& a, const U32& b); |
| 208 | [[nodiscard]] U32 IMax(const U32& a, const U32& b, bool is_signed); | 208 | [[nodiscard]] U32 IMax(const U32& a, const U32& b, bool is_signed); |
| 209 | [[nodiscard]] U32 SClamp(const U32& value, const U32& min, const U32& max); | ||
| 210 | [[nodiscard]] U32 UClamp(const U32& value, const U32& min, const U32& max); | ||
| 209 | 211 | ||
| 210 | [[nodiscard]] U1 ILessThan(const U32& lhs, const U32& rhs, bool is_signed); | 212 | [[nodiscard]] U1 ILessThan(const U32& lhs, const U32& rhs, bool is_signed); |
| 211 | [[nodiscard]] U1 IEqual(const U32U64& lhs, const U32U64& rhs); | 213 | [[nodiscard]] U1 IEqual(const U32U64& lhs, const U32U64& rhs); |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index c75658328..9b050995b 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -299,6 +299,8 @@ OPCODE(SMin32, U32, U32, | |||
| 299 | OPCODE(UMin32, U32, U32, U32, ) | 299 | OPCODE(UMin32, U32, U32, U32, ) |
| 300 | OPCODE(SMax32, U32, U32, U32, ) | 300 | OPCODE(SMax32, U32, U32, U32, ) |
| 301 | OPCODE(UMax32, U32, U32, U32, ) | 301 | OPCODE(UMax32, U32, U32, U32, ) |
| 302 | OPCODE(SClamp32, U32, U32, U32, U32, ) | ||
| 303 | OPCODE(UClamp32, U32, U32, U32, U32, ) | ||
| 302 | OPCODE(SLessThan, U1, U32, U32, ) | 304 | OPCODE(SLessThan, U1, U32, U32, ) |
| 303 | OPCODE(ULessThan, U1, U32, U32, ) | 305 | OPCODE(ULessThan, U1, U32, U32, ) |
| 304 | OPCODE(IEqual, U1, U32, U32, ) | 306 | OPCODE(IEqual, U1, U32, U32, ) |