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.cpp22
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h4
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc2
3 files changed, 22 insertions, 6 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 01f52183c..1659b7f3b 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -813,8 +813,15 @@ U32 IREmitter::IAbs(const U32& value) {
813 return Inst<U32>(Opcode::IAbs32, value); 813 return Inst<U32>(Opcode::IAbs32, value);
814} 814}
815 815
816U32 IREmitter::ShiftLeftLogical(const U32& base, const U32& shift) { 816U32U64 IREmitter::ShiftLeftLogical(const U32U64& base, const U32& shift) {
817 return Inst<U32>(Opcode::ShiftLeftLogical32, base, shift); 817 switch (base.Type()) {
818 case Type::U32:
819 return Inst<U32>(Opcode::ShiftLeftLogical32, base, shift);
820 case Type::U64:
821 return Inst<U64>(Opcode::ShiftLeftLogical64, base, shift);
822 default:
823 ThrowInvalidType(base.Type());
824 }
818} 825}
819 826
820U32U64 IREmitter::ShiftRightLogical(const U32U64& base, const U32& shift) { 827U32U64 IREmitter::ShiftRightLogical(const U32U64& base, const U32& shift) {
@@ -828,8 +835,15 @@ U32U64 IREmitter::ShiftRightLogical(const U32U64& base, const U32& shift) {
828 } 835 }
829} 836}
830 837
831U32 IREmitter::ShiftRightArithmetic(const U32& base, const U32& shift) { 838U32U64 IREmitter::ShiftRightArithmetic(const U32U64& base, const U32& shift) {
832 return Inst<U32>(Opcode::ShiftRightArithmetic32, base, shift); 839 switch (base.Type()) {
840 case Type::U32:
841 return Inst<U32>(Opcode::ShiftRightArithmetic32, base, shift);
842 case Type::U64:
843 return Inst<U64>(Opcode::ShiftRightArithmetic64, base, shift);
844 default:
845 ThrowInvalidType(base.Type());
846 }
833} 847}
834 848
835U32 IREmitter::BitwiseAnd(const U32& a, const U32& b) { 849U32 IREmitter::BitwiseAnd(const U32& a, const U32& b) {
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 33bf2a7d0..6e29bf0e2 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -150,9 +150,9 @@ public:
150 [[nodiscard]] U32 IMul(const U32& a, const U32& b); 150 [[nodiscard]] U32 IMul(const U32& a, const U32& b);
151 [[nodiscard]] U32U64 INeg(const U32U64& value); 151 [[nodiscard]] U32U64 INeg(const U32U64& value);
152 [[nodiscard]] U32 IAbs(const U32& value); 152 [[nodiscard]] U32 IAbs(const U32& value);
153 [[nodiscard]] U32 ShiftLeftLogical(const U32& base, const U32& shift); 153 [[nodiscard]] U32U64 ShiftLeftLogical(const U32U64& base, const U32& shift);
154 [[nodiscard]] U32U64 ShiftRightLogical(const U32U64& base, const U32& shift); 154 [[nodiscard]] U32U64 ShiftRightLogical(const U32U64& base, const U32& shift);
155 [[nodiscard]] U32 ShiftRightArithmetic(const U32& base, const U32& shift); 155 [[nodiscard]] U32U64 ShiftRightArithmetic(const U32U64& base, const U32& shift);
156 [[nodiscard]] U32 BitwiseAnd(const U32& a, const U32& b); 156 [[nodiscard]] U32 BitwiseAnd(const U32& a, const U32& b);
157 [[nodiscard]] U32 BitwiseOr(const U32& a, const U32& b); 157 [[nodiscard]] U32 BitwiseOr(const U32& a, const U32& b);
158 [[nodiscard]] U32 BitwiseXor(const U32& a, const U32& b); 158 [[nodiscard]] U32 BitwiseXor(const U32& a, const U32& b);
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index b51aaaef5..75f09ebfc 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -236,9 +236,11 @@ OPCODE(INeg32, U32, U32,
236OPCODE(INeg64, U64, U64, ) 236OPCODE(INeg64, U64, U64, )
237OPCODE(IAbs32, U32, U32, ) 237OPCODE(IAbs32, U32, U32, )
238OPCODE(ShiftLeftLogical32, U32, U32, U32, ) 238OPCODE(ShiftLeftLogical32, U32, U32, U32, )
239OPCODE(ShiftLeftLogical64, U64, U64, U32, )
239OPCODE(ShiftRightLogical32, U32, U32, U32, ) 240OPCODE(ShiftRightLogical32, U32, U32, U32, )
240OPCODE(ShiftRightLogical64, U64, U64, U32, ) 241OPCODE(ShiftRightLogical64, U64, U64, U32, )
241OPCODE(ShiftRightArithmetic32, U32, U32, U32, ) 242OPCODE(ShiftRightArithmetic32, U32, U32, U32, )
243OPCODE(ShiftRightArithmetic64, U64, U64, U32, )
242OPCODE(BitwiseAnd32, U32, U32, U32, ) 244OPCODE(BitwiseAnd32, U32, U32, U32, )
243OPCODE(BitwiseOr32, U32, U32, U32, ) 245OPCODE(BitwiseOr32, U32, U32, U32, )
244OPCODE(BitwiseXor32, U32, U32, U32, ) 246OPCODE(BitwiseXor32, U32, U32, U32, )