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.cpp4
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h1
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc2
3 files changed, 7 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 9ae5da2a1..3dfba8e71 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1145,6 +1145,10 @@ U32 IREmitter::IMul(const U32& a, const U32& b) {
1145 return Inst<U32>(Opcode::IMul32, a, b); 1145 return Inst<U32>(Opcode::IMul32, a, b);
1146} 1146}
1147 1147
1148U32 IREmitter::IDiv(const U32& a, const U32& b, bool is_signed) {
1149 return Inst<U32>(is_signed ? Opcode::SDiv32 : Opcode::UDiv32, a, b);
1150}
1151
1148U32U64 IREmitter::INeg(const U32U64& value) { 1152U32U64 IREmitter::INeg(const U32U64& value) {
1149 switch (value.Type()) { 1153 switch (value.Type()) {
1150 case Type::U32: 1154 case Type::U32:
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 0c664d2fe..1959be42e 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -209,6 +209,7 @@ public:
209 [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b); 209 [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b);
210 [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b); 210 [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b);
211 [[nodiscard]] U32 IMul(const U32& a, const U32& b); 211 [[nodiscard]] U32 IMul(const U32& a, const U32& b);
212 [[nodiscard]] U32 IDiv(const U32& a, const U32& b, bool is_signed = false);
212 [[nodiscard]] U32U64 INeg(const U32U64& value); 213 [[nodiscard]] U32U64 INeg(const U32U64& value);
213 [[nodiscard]] U32 IAbs(const U32& value); 214 [[nodiscard]] U32 IAbs(const U32& value);
214 [[nodiscard]] U32U64 ShiftLeftLogical(const U32U64& base, const U32& shift); 215 [[nodiscard]] U32U64 ShiftLeftLogical(const U32U64& base, const U32& shift);
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index 72751c5a0..c05e6d312 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -287,6 +287,8 @@ OPCODE(IAdd64, U64, U64,
287OPCODE(ISub32, U32, U32, U32, ) 287OPCODE(ISub32, U32, U32, U32, )
288OPCODE(ISub64, U64, U64, U64, ) 288OPCODE(ISub64, U64, U64, U64, )
289OPCODE(IMul32, U32, U32, U32, ) 289OPCODE(IMul32, U32, U32, U32, )
290OPCODE(SDiv32, U32, U32, U32, )
291OPCODE(UDiv32, U32, U32, U32, )
290OPCODE(INeg32, U32, U32, ) 292OPCODE(INeg32, U32, U32, )
291OPCODE(INeg64, U64, U64, ) 293OPCODE(INeg64, U64, U64, )
292OPCODE(IAbs32, U32, U32, ) 294OPCODE(IAbs32, U32, U32, )