diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-09 23:03:01 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:30 +0200 |
commit | 4502595bc2518eecf934110e9393b11bf0c2f75a (patch) | |
tree | 3e75e200936bce393152792b9ba90413ea83482c /src/shader_recompiler/backend/glasm/emit_glasm.cpp | |
parent | glasm: Implement GLASM fp16 packing and move bitwise insns (diff) | |
download | yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar.gz yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar.bz2 yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar.lz yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar.xz yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.tar.zst yuzu-4502595bc2518eecf934110e9393b11bf0c2f75a.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 842ec157d..9db6eb4a0 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp @@ -42,7 +42,11 @@ template <bool scalar> struct RegWrapper { RegWrapper(EmitContext& ctx, Value value) : reg_alloc{ctx.reg_alloc}, allocated{value.type != Type::Register} { - reg = allocated ? reg_alloc.AllocReg() : Register{value}; + if (allocated) { + reg = value.type == Type::F64 ? reg_alloc.AllocLongReg() : reg_alloc.AllocReg(); + } else { + reg = Register{value}; + } switch (value.type) { case Type::Register: break; @@ -55,6 +59,9 @@ struct RegWrapper { case Type::F32: ctx.Add("MOV.F {}.x,{};", reg, value.imm_f32); break; + case Type::F64: + ctx.Add("MOV.F64 {}.x,{};", reg, value.imm_f64); + break; } } ~RegWrapper() { @@ -162,10 +169,12 @@ std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { for (size_t index = 0; index < ctx.reg_alloc.NumUsedRegisters(); ++index) { header += fmt::format("R{},", index); } - header += "RC;"; - if (!program.info.storage_buffers_descriptors.empty()) { - header += "LONG TEMP LC;"; + header += "RC;" + "LONG TEMP "; + for (size_t index = 0; index < ctx.reg_alloc.NumUsedLongRegisters(); ++index) { + header += fmt::format("D{},", index); } + header += "DC;"; ctx.code.insert(0, header); ctx.code += "END"; return ctx.code; |