diff options
| author | 2021-05-10 04:05:31 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | decda4a2c7e5dc6cce16f359f30bcf320c9dcf00 (patch) | |
| tree | 8a0756153a06403409bf0aeefacb10a11171210e | |
| parent | glasm: Implement IAbs64 and INeg64 on GLASM (diff) | |
| download | yuzu-decda4a2c7e5dc6cce16f359f30bcf320c9dcf00.tar.gz yuzu-decda4a2c7e5dc6cce16f359f30bcf320c9dcf00.tar.xz yuzu-decda4a2c7e5dc6cce16f359f30bcf320c9dcf00.zip | |
glasm: Add MUFU instructions to GLASM
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp | 29 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | 14 |
2 files changed, 22 insertions, 21 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp index 84028e01a..15db6618f 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp | |||
| @@ -125,40 +125,41 @@ void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value) { | |||
| 125 | ctx.LongAdd("MOV.F64 {}.x,-{};", inst, value); | 125 | ctx.LongAdd("MOV.F64 {}.x,-{};", inst, value); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | void EmitFPSin([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 128 | void EmitFPSin(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 129 | throw NotImplementedException("GLASM instruction"); | 129 | ctx.Add("SIN {}.x,{};", inst, value); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | void EmitFPCos([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 132 | void EmitFPCos(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 133 | throw NotImplementedException("GLASM instruction"); | 133 | ctx.Add("COS {}.x,{};", inst, value); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | void EmitFPExp2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 136 | void EmitFPExp2(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 137 | throw NotImplementedException("GLASM instruction"); | 137 | ctx.Add("EX2 {}.x,{};", inst, value); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | void EmitFPLog2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 140 | void EmitFPLog2(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 141 | throw NotImplementedException("GLASM instruction"); | 141 | ctx.Add("LG2 {}.x,{};", inst, value); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | void EmitFPRecip32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 144 | void EmitFPRecip32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 145 | throw NotImplementedException("GLASM instruction"); | 145 | ctx.Add("RCP {}.x,{};", inst, value); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { | 148 | void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 149 | throw NotImplementedException("GLASM instruction"); | 149 | throw NotImplementedException("GLASM instruction"); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void EmitFPRecipSqrt32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 152 | void EmitFPRecipSqrt32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 153 | throw NotImplementedException("GLASM instruction"); | 153 | ctx.Add("RSQ {}.x,{};", inst, value); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { | 156 | void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 157 | throw NotImplementedException("GLASM instruction"); | 157 | throw NotImplementedException("GLASM instruction"); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void EmitFPSqrt([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { | 160 | void EmitFPSqrt(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 161 | throw NotImplementedException("GLASM instruction"); | 161 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 162 | ctx.Add("RSQ {}.x,{};RCP {}.x,{}.x;", ret, value, ret, ret); | ||
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { | 165 | void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index d65a474f2..1bbd02022 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -232,15 +232,15 @@ void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); | |||
| 232 | void EmitFPNeg16(EmitContext& ctx, Register value); | 232 | void EmitFPNeg16(EmitContext& ctx, Register value); |
| 233 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value); | 233 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value); |
| 234 | void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value); | 234 | void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value); |
| 235 | void EmitFPSin(EmitContext& ctx, ScalarF32 value); | 235 | void EmitFPSin(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 236 | void EmitFPCos(EmitContext& ctx, ScalarF32 value); | 236 | void EmitFPCos(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 237 | void EmitFPExp2(EmitContext& ctx, ScalarF32 value); | 237 | void EmitFPExp2(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 238 | void EmitFPLog2(EmitContext& ctx, ScalarF32 value); | 238 | void EmitFPLog2(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 239 | void EmitFPRecip32(EmitContext& ctx, ScalarF32 value); | 239 | void EmitFPRecip32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 240 | void EmitFPRecip64(EmitContext& ctx, Register value); | 240 | void EmitFPRecip64(EmitContext& ctx, Register value); |
| 241 | void EmitFPRecipSqrt32(EmitContext& ctx, ScalarF32 value); | 241 | void EmitFPRecipSqrt32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 242 | void EmitFPRecipSqrt64(EmitContext& ctx, Register value); | 242 | void EmitFPRecipSqrt64(EmitContext& ctx, Register value); |
| 243 | void EmitFPSqrt(EmitContext& ctx, ScalarF32 value); | 243 | void EmitFPSqrt(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 244 | void EmitFPSaturate16(EmitContext& ctx, Register value); | 244 | void EmitFPSaturate16(EmitContext& ctx, Register value); |
| 245 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); | 245 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 246 | void EmitFPSaturate64(EmitContext& ctx, Register value); | 246 | void EmitFPSaturate64(EmitContext& ctx, Register value); |