summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/ir_emitter.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-03-05 01:15:16 -0500
committerGravatar ameerj2021-07-22 21:51:23 -0400
commit5465cb156107a27df525dfedbfd4e920b7f71253 (patch)
tree3bc5940f90e31e09820af69cd845eef92a7d7201 /src/shader_recompiler/frontend/ir/ir_emitter.cpp
parentshader: Deduplicate HADD2 code (diff)
downloadyuzu-5465cb156107a27df525dfedbfd4e920b7f71253.tar.gz
yuzu-5465cb156107a27df525dfedbfd4e920b7f71253.tar.xz
yuzu-5465cb156107a27df525dfedbfd4e920b7f71253.zip
shader: Implement LEA
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 186920d8f..01f52183c 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -798,8 +798,15 @@ U32 IREmitter::IMul(const U32& a, const U32& b) {
798 return Inst<U32>(Opcode::IMul32, a, b); 798 return Inst<U32>(Opcode::IMul32, a, b);
799} 799}
800 800
801U32 IREmitter::INeg(const U32& value) { 801U32U64 IREmitter::INeg(const U32U64& value) {
802 return Inst<U32>(Opcode::INeg32, value); 802 switch (value.Type()) {
803 case Type::U32:
804 return Inst<U32>(Opcode::INeg32, value);
805 case Type::U64:
806 return Inst<U64>(Opcode::INeg64, value);
807 default:
808 ThrowInvalidType(value.Type());
809 }
803} 810}
804 811
805U32 IREmitter::IAbs(const U32& value) { 812U32 IREmitter::IAbs(const U32& value) {
@@ -810,8 +817,15 @@ U32 IREmitter::ShiftLeftLogical(const U32& base, const U32& shift) {
810 return Inst<U32>(Opcode::ShiftLeftLogical32, base, shift); 817 return Inst<U32>(Opcode::ShiftLeftLogical32, base, shift);
811} 818}
812 819
813U32 IREmitter::ShiftRightLogical(const U32& base, const U32& shift) { 820U32U64 IREmitter::ShiftRightLogical(const U32U64& base, const U32& shift) {
814 return Inst<U32>(Opcode::ShiftRightLogical32, base, shift); 821 switch (base.Type()) {
822 case Type::U32:
823 return Inst<U32>(Opcode::ShiftRightLogical32, base, shift);
824 case Type::U64:
825 return Inst<U64>(Opcode::ShiftRightLogical64, base, shift);
826 default:
827 ThrowInvalidType(base.Type());
828 }
815} 829}
816 830
817U32 IREmitter::ShiftRightArithmetic(const U32& base, const U32& shift) { 831U32 IREmitter::ShiftRightArithmetic(const U32& base, const U32& shift) {