summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp8
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h2
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc2
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
1186U32 IREmitter::SClamp(const U32& value, const U32& min, const U32& max) {
1187 return Inst<U32>(Opcode::SClamp32, value, min, max);
1188}
1189
1190U32 IREmitter::UClamp(const U32& value, const U32& min, const U32& max) {
1191 return Inst<U32>(Opcode::UClamp32, value, min, max);
1192}
1193
1186U1 IREmitter::ILessThan(const U32& lhs, const U32& rhs, bool is_signed) { 1194U1 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,
299OPCODE(UMin32, U32, U32, U32, ) 299OPCODE(UMin32, U32, U32, U32, )
300OPCODE(SMax32, U32, U32, U32, ) 300OPCODE(SMax32, U32, U32, U32, )
301OPCODE(UMax32, U32, U32, U32, ) 301OPCODE(UMax32, U32, U32, U32, )
302OPCODE(SClamp32, U32, U32, U32, U32, )
303OPCODE(UClamp32, U32, U32, U32, U32, )
302OPCODE(SLessThan, U1, U32, U32, ) 304OPCODE(SLessThan, U1, U32, U32, )
303OPCODE(ULessThan, U1, U32, U32, ) 305OPCODE(ULessThan, U1, U32, U32, )
304OPCODE(IEqual, U1, U32, U32, ) 306OPCODE(IEqual, U1, U32, U32, )