diff options
| author | 2021-05-09 17:57:57 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:30 -0400 | |
| commit | 3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f (patch) | |
| tree | 2ff037f85f9661b6f0cb94b416974520099748bb /src/shader_recompiler | |
| parent | glasm: Initial GLASM fp64 support (diff) | |
| download | yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.tar.gz yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.tar.xz yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.zip | |
glasm: Reimplement bitwise ops and BFI/BFE
Diffstat (limited to 'src/shader_recompiler')
4 files changed, 108 insertions, 88 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index ab1e08215..aef5f7663 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -185,10 +185,12 @@ void EmitCompositeInsertF64x4(EmitContext& ctx, Register composite, Register obj | |||
| 185 | void EmitSelectU1(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); | 185 | void EmitSelectU1(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 186 | void EmitSelectU8(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); | 186 | void EmitSelectU8(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 187 | void EmitSelectU16(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); | 187 | void EmitSelectU16(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 188 | void EmitSelectU32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); | 188 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, |
| 189 | ScalarS32 false_value); | ||
| 189 | void EmitSelectU64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); | 190 | void EmitSelectU64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 190 | void EmitSelectF16(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); | 191 | void EmitSelectF16(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 191 | void EmitSelectF32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); | 192 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, |
| 193 | ScalarS32 false_value); | ||
| 192 | void EmitSelectF64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); | 194 | void EmitSelectF64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 193 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 195 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 194 | void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 196 | void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| @@ -313,15 +315,15 @@ void EmitShiftRightArithmetic64(EmitContext& ctx, Register base, Register shift) | |||
| 313 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); | 315 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 314 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); | 316 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 315 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); | 317 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 316 | void EmitBitFieldInsert(EmitContext& ctx, ScalarS32 base, ScalarS32 insert, ScalarS32 offset, | 318 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 insert, |
| 317 | ScalarS32 count); | 319 | ScalarS32 offset, ScalarS32 count); |
| 318 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 offset, | 320 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 offset, |
| 319 | ScalarS32 count); | 321 | ScalarS32 count); |
| 320 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 offset, | 322 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 offset, |
| 321 | ScalarU32 count); | 323 | ScalarU32 count); |
| 322 | void EmitBitReverse32(EmitContext& ctx, ScalarS32 value); | 324 | void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value); |
| 323 | void EmitBitCount32(EmitContext& ctx, ScalarS32 value); | 325 | void EmitBitCount32(EmitContext& ctx, ScalarS32 value); |
| 324 | void EmitBitwiseNot32(EmitContext& ctx, ScalarS32 value); | 326 | void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value); |
| 325 | void EmitFindSMsb32(EmitContext& ctx, ScalarS32 value); | 327 | void EmitFindSMsb32(EmitContext& ctx, ScalarS32 value); |
| 326 | void EmitFindUMsb32(EmitContext& ctx, ScalarU32 value); | 328 | void EmitFindUMsb32(EmitContext& ctx, ScalarU32 value); |
| 327 | void EmitSMin32(EmitContext& ctx, ScalarS32 a, ScalarS32 b); | 329 | void EmitSMin32(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| @@ -330,16 +332,16 @@ void EmitSMax32(EmitContext& ctx, ScalarS32 a, ScalarS32 b); | |||
| 330 | void EmitUMax32(EmitContext& ctx, ScalarU32 a, ScalarU32 b); | 332 | void EmitUMax32(EmitContext& ctx, ScalarU32 a, ScalarU32 b); |
| 331 | void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value, ScalarS32 min, ScalarS32 max); | 333 | void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value, ScalarS32 min, ScalarS32 max); |
| 332 | void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 min, ScalarU32 max); | 334 | void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 min, ScalarU32 max); |
| 333 | void EmitSLessThan(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 335 | void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 334 | void EmitULessThan(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); | 336 | void EmitULessThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs); |
| 335 | void EmitIEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 337 | void EmitIEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 336 | void EmitSLessThanEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 338 | void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 337 | void EmitULessThanEqual(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); | 339 | void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs); |
| 338 | void EmitSGreaterThan(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 340 | void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 339 | void EmitUGreaterThan(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); | 341 | void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs); |
| 340 | void EmitINotEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 342 | void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 341 | void EmitSGreaterThanEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); | 343 | void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs); |
| 342 | void EmitUGreaterThanEqual(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); | 344 | void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs); |
| 343 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); | 345 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 344 | void EmitSharedAtomicSMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value); | 346 | void EmitSharedAtomicSMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value); |
| 345 | void EmitSharedAtomicUMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); | 347 | void EmitSharedAtomicUMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp index 7b88d6f02..2db05e62d 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |||
| @@ -87,34 +87,34 @@ void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b | |||
| 87 | ctx.Add("XOR.S {}.x,{},{};", inst, a, b); | 87 | ctx.Add("XOR.S {}.x,{},{};", inst, a, b); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 base, | 90 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 insert, |
| 91 | [[maybe_unused]] ScalarS32 insert, [[maybe_unused]] ScalarS32 offset, | 91 | ScalarS32 offset, ScalarS32 count) { |
| 92 | [[maybe_unused]] ScalarS32 count) { | 92 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 93 | throw NotImplementedException("GLASM instruction"); | 93 | ctx.Add("BFI.S {},RC,{},{};", inst, insert, base); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 96 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 offset, |
| 97 | [[maybe_unused]] ScalarS32 base, [[maybe_unused]] ScalarS32 offset, | 97 | ScalarS32 count) { |
| 98 | [[maybe_unused]] ScalarS32 count) { | 98 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 99 | throw NotImplementedException("GLASM instruction"); | 99 | ctx.Add("BFE.S {},RC,{};", inst, base); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 102 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 offset, |
| 103 | [[maybe_unused]] ScalarU32 base, [[maybe_unused]] ScalarU32 offset, | 103 | ScalarU32 count) { |
| 104 | [[maybe_unused]] ScalarU32 count) { | 104 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 105 | throw NotImplementedException("GLASM instruction"); | 105 | ctx.Add("BFE.U {},RC,{};", inst, base); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 108 | void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value) { |
| 109 | throw NotImplementedException("GLASM instruction"); | 109 | ctx.Add("BFR {},{};", inst, value); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 112 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 113 | throw NotImplementedException("GLASM instruction"); | 113 | throw NotImplementedException("GLASM instruction"); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 116 | void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value) { |
| 117 | throw NotImplementedException("GLASM instruction"); | 117 | ctx.Add("NOT.S {},{};", inst, value); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 120 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| @@ -157,54 +157,44 @@ void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& | |||
| 157 | throw NotImplementedException("GLASM instruction"); | 157 | throw NotImplementedException("GLASM instruction"); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 160 | void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 161 | [[maybe_unused]] ScalarS32 rhs) { | 161 | ctx.Add("SLT.S {},{},{};", inst, lhs, rhs); |
| 162 | throw NotImplementedException("GLASM instruction"); | ||
| 163 | } | 162 | } |
| 164 | 163 | ||
| 165 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 164 | void EmitULessThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 166 | [[maybe_unused]] ScalarU32 rhs) { | 165 | ctx.Add("SLT.U {},{},{};", inst, lhs, rhs); |
| 167 | throw NotImplementedException("GLASM instruction"); | ||
| 168 | } | 166 | } |
| 169 | 167 | ||
| 170 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 168 | void EmitIEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 171 | [[maybe_unused]] ScalarS32 rhs) { | 169 | ctx.Add("SEQ.S {},{},{};", inst, lhs, rhs); |
| 172 | throw NotImplementedException("GLASM instruction"); | ||
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 172 | void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 176 | [[maybe_unused]] ScalarS32 rhs) { | 173 | ctx.Add("SLE.S {},{},{};", inst, lhs, rhs); |
| 177 | throw NotImplementedException("GLASM instruction"); | ||
| 178 | } | 174 | } |
| 179 | 175 | ||
| 180 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 176 | void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 181 | [[maybe_unused]] ScalarU32 rhs) { | 177 | ctx.Add("SLE.U {},{},{};", inst, lhs, rhs); |
| 182 | throw NotImplementedException("GLASM instruction"); | ||
| 183 | } | 178 | } |
| 184 | 179 | ||
| 185 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 180 | void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 186 | [[maybe_unused]] ScalarS32 rhs) { | 181 | ctx.Add("SGT.S {},{},{};", inst, lhs, rhs); |
| 187 | throw NotImplementedException("GLASM instruction"); | ||
| 188 | } | 182 | } |
| 189 | 183 | ||
| 190 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 184 | void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 191 | [[maybe_unused]] ScalarU32 rhs) { | 185 | ctx.Add("SGT.U {},{},{};", inst, lhs, rhs); |
| 192 | throw NotImplementedException("GLASM instruction"); | ||
| 193 | } | 186 | } |
| 194 | 187 | ||
| 195 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 188 | void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 196 | [[maybe_unused]] ScalarS32 rhs) { | 189 | ctx.Add("SNE.U {},{},{};", inst, lhs, rhs); |
| 197 | throw NotImplementedException("GLASM instruction"); | ||
| 198 | } | 190 | } |
| 199 | 191 | ||
| 200 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 192 | void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 201 | [[maybe_unused]] ScalarS32 rhs) { | 193 | ctx.Add("SGE.S {},{},{};", inst, lhs, rhs); |
| 202 | throw NotImplementedException("GLASM instruction"); | ||
| 203 | } | 194 | } |
| 204 | 195 | ||
| 205 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 196 | void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 206 | [[maybe_unused]] ScalarU32 rhs) { | 197 | ctx.Add("SGE.U {},{},{};", inst, lhs, rhs); |
| 207 | throw NotImplementedException("GLASM instruction"); | ||
| 208 | } | 198 | } |
| 209 | 199 | ||
| 210 | } // namespace Shader::Backend::GLASM | 200 | } // namespace Shader::Backend::GLASM |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp index f3baf33af..e94571f2d 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -249,35 +249,11 @@ void EmitWriteSharedU128(EmitContext& ctx, ScalarU32 offset, Register value) { | |||
| 249 | NotImplemented(); | 249 | NotImplemented(); |
| 250 | } | 250 | } |
| 251 | 251 | ||
| 252 | void EmitSelectU1(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { | 252 | void EmitPackDouble2x32(EmitContext& ctx, Register value) { |
| 253 | NotImplemented(); | 253 | NotImplemented(); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | void EmitSelectU8(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { | 256 | void EmitUnpackDouble2x32(EmitContext& ctx, Register value) { |
| 257 | NotImplemented(); | ||
| 258 | } | ||
| 259 | |||
| 260 | void EmitSelectU16(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { | ||
| 261 | NotImplemented(); | ||
| 262 | } | ||
| 263 | |||
| 264 | void EmitSelectU32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { | ||
| 265 | NotImplemented(); | ||
| 266 | } | ||
| 267 | |||
| 268 | void EmitSelectU64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { | ||
| 269 | NotImplemented(); | ||
| 270 | } | ||
| 271 | |||
| 272 | void EmitSelectF16(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { | ||
| 273 | NotImplemented(); | ||
| 274 | } | ||
| 275 | |||
| 276 | void EmitSelectF32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { | ||
| 277 | NotImplemented(); | ||
| 278 | } | ||
| 279 | |||
| 280 | void EmitSelectF64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { | ||
| 281 | NotImplemented(); | 257 | NotImplemented(); |
| 282 | } | 258 | } |
| 283 | 259 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp index e69de29bb..8f9df8e23 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | |||
| 2 | // Copyright 2021 yuzu Emulator Project | ||
| 3 | // Licensed under GPLv2 or any later version | ||
| 4 | // Refer to the license.txt file included. | ||
| 5 | |||
| 6 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 7 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 8 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 9 | |||
| 10 | namespace Shader::Backend::GLASM { | ||
| 11 | |||
| 12 | void EmitSelectU1([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 13 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 14 | throw NotImplementedException("GLASM instruction"); | ||
| 15 | } | ||
| 16 | |||
| 17 | void EmitSelectU8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 18 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 19 | throw NotImplementedException("GLASM instruction"); | ||
| 20 | } | ||
| 21 | |||
| 22 | void EmitSelectU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 23 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 24 | throw NotImplementedException("GLASM instruction"); | ||
| 25 | } | ||
| 26 | |||
| 27 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, | ||
| 28 | ScalarS32 false_value) { | ||
| 29 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 30 | } | ||
| 31 | |||
| 32 | void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 33 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 34 | throw NotImplementedException("GLASM instruction"); | ||
| 35 | } | ||
| 36 | |||
| 37 | void EmitSelectF16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 38 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 39 | throw NotImplementedException("GLASM instruction"); | ||
| 40 | } | ||
| 41 | |||
| 42 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, | ||
| 43 | ScalarS32 false_value) { | ||
| 44 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 45 | } | ||
| 46 | |||
| 47 | void EmitSelectF64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 48 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 49 | throw NotImplementedException("GLASM instruction"); | ||
| 50 | } | ||
| 51 | |||
| 52 | } // namespace Shader::Backend::GLASM | ||