summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
index 758a0230a..9bae89c10 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
@@ -21,6 +21,13 @@ IR::U32 TranslatorVisitor::X(IR::Reg reg) {
21 return ir.GetReg(reg); 21 return ir.GetReg(reg);
22} 22}
23 23
24IR::U64 TranslatorVisitor::L(IR::Reg reg) {
25 if (!IR::IsAligned(reg, 2)) {
26 throw NotImplementedException("Unaligned source register {}", reg);
27 }
28 return IR::U64{ir.PackUint2x32(ir.CompositeConstruct(X(reg), X(reg + 1)))};
29}
30
24IR::F32 TranslatorVisitor::F(IR::Reg reg) { 31IR::F32 TranslatorVisitor::F(IR::Reg reg) {
25 return ir.BitCast<IR::F32>(X(reg)); 32 return ir.BitCast<IR::F32>(X(reg));
26} 33}
@@ -36,6 +43,16 @@ void TranslatorVisitor::X(IR::Reg dest_reg, const IR::U32& value) {
36 ir.SetReg(dest_reg, value); 43 ir.SetReg(dest_reg, value);
37} 44}
38 45
46void TranslatorVisitor::L(IR::Reg dest_reg, const IR::U64& value) {
47 if (!IR::IsAligned(dest_reg, 2)) {
48 throw NotImplementedException("Unaligned destination register {}", dest_reg);
49 }
50 const IR::Value result{ir.UnpackUint2x32(value)};
51 for (int i = 0; i < 2; i++) {
52 X(dest_reg + i, IR::U32{ir.CompositeExtract(result, i)});
53 }
54}
55
39void TranslatorVisitor::F(IR::Reg dest_reg, const IR::F32& value) { 56void TranslatorVisitor::F(IR::Reg dest_reg, const IR::F32& value) {
40 X(dest_reg, ir.BitCast<IR::U32>(value)); 57 X(dest_reg, ir.BitCast<IR::U32>(value));
41} 58}