diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 2 |
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 | ||
| 1148 | U32 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 | |||
| 1148 | U32U64 IREmitter::INeg(const U32U64& value) { | 1152 | U32U64 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, | |||
| 287 | OPCODE(ISub32, U32, U32, U32, ) | 287 | OPCODE(ISub32, U32, U32, U32, ) |
| 288 | OPCODE(ISub64, U64, U64, U64, ) | 288 | OPCODE(ISub64, U64, U64, U64, ) |
| 289 | OPCODE(IMul32, U32, U32, U32, ) | 289 | OPCODE(IMul32, U32, U32, U32, ) |
| 290 | OPCODE(SDiv32, U32, U32, U32, ) | ||
| 291 | OPCODE(UDiv32, U32, U32, U32, ) | ||
| 290 | OPCODE(INeg32, U32, U32, ) | 292 | OPCODE(INeg32, U32, U32, ) |
| 291 | OPCODE(INeg64, U64, U64, ) | 293 | OPCODE(INeg64, U64, U64, ) |
| 292 | OPCODE(IAbs32, U32, U32, ) | 294 | OPCODE(IAbs32, U32, U32, ) |