diff options
Diffstat (limited to 'src/shader_recompiler')
3 files changed, 116 insertions, 120 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 2b9a210aa..1139a22bd 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp | |||
| @@ -10,6 +10,31 @@ | |||
| 10 | 10 | ||
| 11 | namespace Shader::Backend::GLASM { | 11 | namespace Shader::Backend::GLASM { |
| 12 | 12 | ||
| 13 | template <typename InputType> | ||
| 14 | static void Compare(EmitContext& ctx, IR::Inst& inst, InputType lhs, InputType rhs, | ||
| 15 | std::string_view op, std::string_view type, bool ordered, | ||
| 16 | bool inequality = false) { | ||
| 17 | const Register ret{ctx.reg_alloc.Define(inst)}; | ||
| 18 | ctx.Add("{}.{} RC.x,{},{};", op, type, lhs, rhs); | ||
| 19 | if (ordered && inequality) { | ||
| 20 | ctx.Add("SEQ.{} RC.y,{},{};" | ||
| 21 | "SEQ.{} RC.z,{},{};" | ||
| 22 | "AND.U RC.x,RC.x,RC.y;" | ||
| 23 | "AND.U RC.x,RC.x,RC.z;" | ||
| 24 | "SNE.S {}.x,RC.x,0;", | ||
| 25 | type, lhs, lhs, type, rhs, rhs, ret); | ||
| 26 | } else if (ordered) { | ||
| 27 | ctx.Add("SNE.S {}.x,RC.x,0;", ret); | ||
| 28 | } else { | ||
| 29 | ctx.Add("SNE.{} RC.y,{},{};" | ||
| 30 | "SNE.{} RC.z,{},{};" | ||
| 31 | "OR.U RC.x,RC.x,RC.y;" | ||
| 32 | "OR.U RC.x,RC.x,RC.z;" | ||
| 33 | "SNE.S {}.x,RC.x,0;", | ||
| 34 | type, lhs, lhs, type, rhs, rhs, ret); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 13 | void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 38 | void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 14 | [[maybe_unused]] Register value) { | 39 | [[maybe_unused]] Register value) { |
| 15 | throw NotImplementedException("GLASM instruction"); | 40 | throw NotImplementedException("GLASM instruction"); |
| @@ -46,10 +71,8 @@ void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, Sca | |||
| 46 | ctx.Add("MAD.F {}.x,{},{},{};", inst, a, b, c); | 71 | ctx.Add("MAD.F {}.x,{},{},{};", inst, a, b, c); |
| 47 | } | 72 | } |
| 48 | 73 | ||
| 49 | void EmitFPFma64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 74 | void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b, ScalarF64 c) { |
| 50 | [[maybe_unused]] Register a, [[maybe_unused]] Register b, | 75 | ctx.LongAdd("MAD.F64 {}.x,{},{},{};", inst, a, b, c); |
| 51 | [[maybe_unused]] Register c) { | ||
| 52 | throw NotImplementedException("GLASM instruction"); | ||
| 53 | } | 76 | } |
| 54 | 77 | ||
| 55 | void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, | 78 | void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, |
| @@ -57,9 +80,8 @@ void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a | |||
| 57 | throw NotImplementedException("GLASM instruction"); | 80 | throw NotImplementedException("GLASM instruction"); |
| 58 | } | 81 | } |
| 59 | 82 | ||
| 60 | void EmitFPMax64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, | 83 | void EmitFPMax64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) { |
| 61 | [[maybe_unused]] Register b) { | 84 | ctx.LongAdd("MAX.F64 {},{},{};", inst, a, b); |
| 62 | throw NotImplementedException("GLASM instruction"); | ||
| 63 | } | 85 | } |
| 64 | 86 | ||
| 65 | void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, | 87 | void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, |
| @@ -67,9 +89,8 @@ void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a | |||
| 67 | throw NotImplementedException("GLASM instruction"); | 89 | throw NotImplementedException("GLASM instruction"); |
| 68 | } | 90 | } |
| 69 | 91 | ||
| 70 | void EmitFPMin64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, | 92 | void EmitFPMin64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) { |
| 71 | [[maybe_unused]] Register b) { | 93 | ctx.LongAdd("MIN.F64 {},{},{};", inst, a, b); |
| 72 | throw NotImplementedException("GLASM instruction"); | ||
| 73 | } | 94 | } |
| 74 | 95 | ||
| 75 | void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 96 | void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| @@ -81,9 +102,8 @@ void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) { | |||
| 81 | ctx.Add("MUL.F {}.x,{},{};", inst, a, b); | 102 | ctx.Add("MUL.F {}.x,{},{};", inst, a, b); |
| 82 | } | 103 | } |
| 83 | 104 | ||
| 84 | void EmitFPMul64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 105 | void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) { |
| 85 | [[maybe_unused]] Register a, [[maybe_unused]] Register b) { | 106 | ctx.LongAdd("MUL.F64 {}.x,{},{};", inst, a, b); |
| 86 | throw NotImplementedException("GLASM instruction"); | ||
| 87 | } | 107 | } |
| 88 | 108 | ||
| 89 | void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { | 109 | void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| @@ -215,13 +235,11 @@ void EmitFPOrdEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Regist | |||
| 215 | } | 235 | } |
| 216 | 236 | ||
| 217 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { | 237 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 218 | const Register ret{ctx.reg_alloc.Define(inst)}; | 238 | Compare(ctx, inst, lhs, rhs, "SEQ", "F", true); |
| 219 | ctx.Add("SEQ.F {}.x,{},{};SNE.S {}.x,{},0;", ret, lhs, rhs, ret, ret); | ||
| 220 | } | 239 | } |
| 221 | 240 | ||
| 222 | void EmitFPOrdEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 241 | void EmitFPOrdEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 223 | [[maybe_unused]] Register rhs) { | 242 | Compare(ctx, inst, lhs, rhs, "SEQ", "F64", true); |
| 224 | throw NotImplementedException("GLASM instruction"); | ||
| 225 | } | 243 | } |
| 226 | 244 | ||
| 227 | void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 245 | void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -229,14 +247,12 @@ void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Regi | |||
| 229 | throw NotImplementedException("GLASM instruction"); | 247 | throw NotImplementedException("GLASM instruction"); |
| 230 | } | 248 | } |
| 231 | 249 | ||
| 232 | void EmitFPUnordEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 250 | void EmitFPUnordEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 233 | [[maybe_unused]] ScalarF32 rhs) { | 251 | Compare(ctx, inst, lhs, rhs, "SEQ", "F", false); |
| 234 | throw NotImplementedException("GLASM instruction"); | ||
| 235 | } | 252 | } |
| 236 | 253 | ||
| 237 | void EmitFPUnordEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 254 | void EmitFPUnordEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 238 | [[maybe_unused]] Register rhs) { | 255 | Compare(ctx, inst, lhs, rhs, "SEQ", "F64", false); |
| 239 | throw NotImplementedException("GLASM instruction"); | ||
| 240 | } | 256 | } |
| 241 | 257 | ||
| 242 | void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 258 | void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -244,14 +260,12 @@ void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Reg | |||
| 244 | throw NotImplementedException("GLASM instruction"); | 260 | throw NotImplementedException("GLASM instruction"); |
| 245 | } | 261 | } |
| 246 | 262 | ||
| 247 | void EmitFPOrdNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 263 | void EmitFPOrdNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 248 | [[maybe_unused]] ScalarF32 rhs) { | 264 | Compare(ctx, inst, lhs, rhs, "SNE", "F", true, true); |
| 249 | throw NotImplementedException("GLASM instruction"); | ||
| 250 | } | 265 | } |
| 251 | 266 | ||
| 252 | void EmitFPOrdNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 267 | void EmitFPOrdNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 253 | [[maybe_unused]] Register rhs) { | 268 | Compare(ctx, inst, lhs, rhs, "SNE", "F64", true, true); |
| 254 | throw NotImplementedException("GLASM instruction"); | ||
| 255 | } | 269 | } |
| 256 | 270 | ||
| 257 | void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 271 | void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -259,14 +273,12 @@ void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] R | |||
| 259 | throw NotImplementedException("GLASM instruction"); | 273 | throw NotImplementedException("GLASM instruction"); |
| 260 | } | 274 | } |
| 261 | 275 | ||
| 262 | void EmitFPUnordNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 276 | void EmitFPUnordNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 263 | [[maybe_unused]] ScalarF32 rhs) { | 277 | Compare(ctx, inst, lhs, rhs, "SNE", "F", false, true); |
| 264 | throw NotImplementedException("GLASM instruction"); | ||
| 265 | } | 278 | } |
| 266 | 279 | ||
| 267 | void EmitFPUnordNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 280 | void EmitFPUnordNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 268 | [[maybe_unused]] Register rhs) { | 281 | Compare(ctx, inst, lhs, rhs, "SNE", "F64", false, true); |
| 269 | throw NotImplementedException("GLASM instruction"); | ||
| 270 | } | 282 | } |
| 271 | 283 | ||
| 272 | void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 284 | void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -275,13 +287,11 @@ void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Reg | |||
| 275 | } | 287 | } |
| 276 | 288 | ||
| 277 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { | 289 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 278 | const Register ret{ctx.reg_alloc.Define(inst)}; | 290 | Compare(ctx, inst, lhs, rhs, "SLT", "F", true); |
| 279 | ctx.Add("SLT.F {}.x,{},{};SNE.S {}.x,{}.x,0;", ret, lhs, rhs, ret, ret); | ||
| 280 | } | 291 | } |
| 281 | 292 | ||
| 282 | void EmitFPOrdLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 293 | void EmitFPOrdLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 283 | [[maybe_unused]] Register rhs) { | 294 | Compare(ctx, inst, lhs, rhs, "SLT", "F64", true); |
| 284 | throw NotImplementedException("GLASM instruction"); | ||
| 285 | } | 295 | } |
| 286 | 296 | ||
| 287 | void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 297 | void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -289,14 +299,12 @@ void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] R | |||
| 289 | throw NotImplementedException("GLASM instruction"); | 299 | throw NotImplementedException("GLASM instruction"); |
| 290 | } | 300 | } |
| 291 | 301 | ||
| 292 | void EmitFPUnordLessThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 302 | void EmitFPUnordLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 293 | [[maybe_unused]] ScalarF32 rhs) { | 303 | Compare(ctx, inst, lhs, rhs, "SLT", "F", false); |
| 294 | throw NotImplementedException("GLASM instruction"); | ||
| 295 | } | 304 | } |
| 296 | 305 | ||
| 297 | void EmitFPUnordLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 306 | void EmitFPUnordLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 298 | [[maybe_unused]] Register rhs) { | 307 | Compare(ctx, inst, lhs, rhs, "SLT", "F64", false); |
| 299 | throw NotImplementedException("GLASM instruction"); | ||
| 300 | } | 308 | } |
| 301 | 309 | ||
| 302 | void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 310 | void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -304,14 +312,12 @@ void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] | |||
| 304 | throw NotImplementedException("GLASM instruction"); | 312 | throw NotImplementedException("GLASM instruction"); |
| 305 | } | 313 | } |
| 306 | 314 | ||
| 307 | void EmitFPOrdGreaterThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 315 | void EmitFPOrdGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 308 | [[maybe_unused]] ScalarF32 rhs) { | 316 | Compare(ctx, inst, lhs, rhs, "SGT", "F", true); |
| 309 | throw NotImplementedException("GLASM instruction"); | ||
| 310 | } | 317 | } |
| 311 | 318 | ||
| 312 | void EmitFPOrdGreaterThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 319 | void EmitFPOrdGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 313 | [[maybe_unused]] Register rhs) { | 320 | Compare(ctx, inst, lhs, rhs, "SGT", "F64", true); |
| 314 | throw NotImplementedException("GLASM instruction"); | ||
| 315 | } | 321 | } |
| 316 | 322 | ||
| 317 | void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 323 | void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -319,14 +325,12 @@ void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused] | |||
| 319 | throw NotImplementedException("GLASM instruction"); | 325 | throw NotImplementedException("GLASM instruction"); |
| 320 | } | 326 | } |
| 321 | 327 | ||
| 322 | void EmitFPUnordGreaterThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 328 | void EmitFPUnordGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 323 | [[maybe_unused]] ScalarF32 rhs) { | 329 | Compare(ctx, inst, lhs, rhs, "SGT", "F", false); |
| 324 | throw NotImplementedException("GLASM instruction"); | ||
| 325 | } | 330 | } |
| 326 | 331 | ||
| 327 | void EmitFPUnordGreaterThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 332 | void EmitFPUnordGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 328 | [[maybe_unused]] Register rhs) { | 333 | Compare(ctx, inst, lhs, rhs, "SGT", "F64", false); |
| 329 | throw NotImplementedException("GLASM instruction"); | ||
| 330 | } | 334 | } |
| 331 | 335 | ||
| 332 | void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 336 | void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -335,13 +339,11 @@ void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused] | |||
| 335 | } | 339 | } |
| 336 | 340 | ||
| 337 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { | 341 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 338 | const Register ret{ctx.reg_alloc.Define(inst)}; | 342 | Compare(ctx, inst, lhs, rhs, "SLE", "F", true); |
| 339 | ctx.Add("SLE.F {}.x,{},{};SNE.S {}.x,{}.x,0;", ret, lhs, rhs, ret, ret); | ||
| 340 | } | 343 | } |
| 341 | 344 | ||
| 342 | void EmitFPOrdLessThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 345 | void EmitFPOrdLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 343 | [[maybe_unused]] Register rhs) { | 346 | Compare(ctx, inst, lhs, rhs, "SLE", "F64", true); |
| 344 | throw NotImplementedException("GLASM instruction"); | ||
| 345 | } | 347 | } |
| 346 | 348 | ||
| 347 | void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 349 | void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -349,14 +351,12 @@ void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unuse | |||
| 349 | throw NotImplementedException("GLASM instruction"); | 351 | throw NotImplementedException("GLASM instruction"); |
| 350 | } | 352 | } |
| 351 | 353 | ||
| 352 | void EmitFPUnordLessThanEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 354 | void EmitFPUnordLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 353 | [[maybe_unused]] ScalarF32 rhs) { | 355 | Compare(ctx, inst, lhs, rhs, "SLE", "F", false); |
| 354 | throw NotImplementedException("GLASM instruction"); | ||
| 355 | } | 356 | } |
| 356 | 357 | ||
| 357 | void EmitFPUnordLessThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 358 | void EmitFPUnordLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 358 | [[maybe_unused]] Register rhs) { | 359 | Compare(ctx, inst, lhs, rhs, "SLE", "F64", false); |
| 359 | throw NotImplementedException("GLASM instruction"); | ||
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 362 | void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -364,14 +364,12 @@ void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unus | |||
| 364 | throw NotImplementedException("GLASM instruction"); | 364 | throw NotImplementedException("GLASM instruction"); |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | void EmitFPOrdGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, | 367 | void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 368 | [[maybe_unused]] ScalarF32 rhs) { | 368 | Compare(ctx, inst, lhs, rhs, "SGE", "F", true); |
| 369 | throw NotImplementedException("GLASM instruction"); | ||
| 370 | } | 369 | } |
| 371 | 370 | ||
| 372 | void EmitFPOrdGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 371 | void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 373 | [[maybe_unused]] Register rhs) { | 372 | Compare(ctx, inst, lhs, rhs, "SGE", "F64", true); |
| 374 | throw NotImplementedException("GLASM instruction"); | ||
| 375 | } | 373 | } |
| 376 | 374 | ||
| 377 | void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 375 | void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| @@ -379,14 +377,24 @@ void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_un | |||
| 379 | throw NotImplementedException("GLASM instruction"); | 377 | throw NotImplementedException("GLASM instruction"); |
| 380 | } | 378 | } |
| 381 | 379 | ||
| 382 | void EmitFPUnordGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, | 380 | void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 383 | [[maybe_unused]] ScalarF32 lhs, [[maybe_unused]] ScalarF32 rhs) { | 381 | Compare(ctx, inst, lhs, rhs, "SGE", "F", false); |
| 384 | throw NotImplementedException("GLASM instruction"); | ||
| 385 | } | 382 | } |
| 386 | 383 | ||
| 387 | void EmitFPUnordGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, | 384 | void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) { |
| 388 | [[maybe_unused]] Register rhs) { | 385 | Compare(ctx, inst, lhs, rhs, "SGE", "F64", false); |
| 386 | } | ||
| 387 | |||
| 388 | void EmitFPIsNan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { | ||
| 389 | throw NotImplementedException("GLASM instruction"); | 389 | throw NotImplementedException("GLASM instruction"); |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | void EmitFPIsNan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { | ||
| 393 | Compare(ctx, inst, value, value, "SNE", "F", true, false); | ||
| 394 | } | ||
| 395 | |||
| 396 | void EmitFPIsNan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 value) { | ||
| 397 | Compare(ctx, inst, value, value, "SNE", "F64", true, false); | ||
| 398 | } | ||
| 399 | |||
| 392 | } // namespace Shader::Backend::GLASM | 400 | } // namespace Shader::Backend::GLASM |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index b19899624..26c97ce8e 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -220,14 +220,14 @@ void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b); | |||
| 220 | void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); | 220 | void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); |
| 221 | void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, Register a, Register b, Register c); | 221 | void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, Register a, Register b, Register c); |
| 222 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, ScalarF32 c); | 222 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, ScalarF32 c); |
| 223 | void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, Register a, Register b, Register c); | 223 | void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b, ScalarF64 c); |
| 224 | void EmitFPMax32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); | 224 | void EmitFPMax32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); |
| 225 | void EmitFPMax64(EmitContext& ctx, Register a, Register b); | 225 | void EmitFPMax64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); |
| 226 | void EmitFPMin32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); | 226 | void EmitFPMin32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); |
| 227 | void EmitFPMin64(EmitContext& ctx, Register a, Register b); | 227 | void EmitFPMin64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); |
| 228 | void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, Register a, Register b); | 228 | void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, Register a, Register b); |
| 229 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b); | 229 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b); |
| 230 | void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, Register a, Register b); | 230 | void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b); |
| 231 | void EmitFPNeg16(EmitContext& ctx, Register value); | 231 | void EmitFPNeg16(EmitContext& ctx, Register value); |
| 232 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value); | 232 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value); |
| 233 | void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value); | 233 | void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value); |
| @@ -260,43 +260,43 @@ void EmitFPTrunc32(EmitContext& ctx, ScalarF32 value); | |||
| 260 | void EmitFPTrunc64(EmitContext& ctx, Register value); | 260 | void EmitFPTrunc64(EmitContext& ctx, Register value); |
| 261 | void EmitFPOrdEqual16(EmitContext& ctx, Register lhs, Register rhs); | 261 | void EmitFPOrdEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 262 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); | 262 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 263 | void EmitFPOrdEqual64(EmitContext& ctx, Register lhs, Register rhs); | 263 | void EmitFPOrdEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 264 | void EmitFPUnordEqual16(EmitContext& ctx, Register lhs, Register rhs); | 264 | void EmitFPUnordEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 265 | void EmitFPUnordEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 265 | void EmitFPUnordEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 266 | void EmitFPUnordEqual64(EmitContext& ctx, Register lhs, Register rhs); | 266 | void EmitFPUnordEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 267 | void EmitFPOrdNotEqual16(EmitContext& ctx, Register lhs, Register rhs); | 267 | void EmitFPOrdNotEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 268 | void EmitFPOrdNotEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 268 | void EmitFPOrdNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 269 | void EmitFPOrdNotEqual64(EmitContext& ctx, Register lhs, Register rhs); | 269 | void EmitFPOrdNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 270 | void EmitFPUnordNotEqual16(EmitContext& ctx, Register lhs, Register rhs); | 270 | void EmitFPUnordNotEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 271 | void EmitFPUnordNotEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 271 | void EmitFPUnordNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 272 | void EmitFPUnordNotEqual64(EmitContext& ctx, Register lhs, Register rhs); | 272 | void EmitFPUnordNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 273 | void EmitFPOrdLessThan16(EmitContext& ctx, Register lhs, Register rhs); | 273 | void EmitFPOrdLessThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 274 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); | 274 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 275 | void EmitFPOrdLessThan64(EmitContext& ctx, Register lhs, Register rhs); | 275 | void EmitFPOrdLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 276 | void EmitFPUnordLessThan16(EmitContext& ctx, Register lhs, Register rhs); | 276 | void EmitFPUnordLessThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 277 | void EmitFPUnordLessThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 277 | void EmitFPUnordLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 278 | void EmitFPUnordLessThan64(EmitContext& ctx, Register lhs, Register rhs); | 278 | void EmitFPUnordLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 279 | void EmitFPOrdGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); | 279 | void EmitFPOrdGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 280 | void EmitFPOrdGreaterThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 280 | void EmitFPOrdGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 281 | void EmitFPOrdGreaterThan64(EmitContext& ctx, Register lhs, Register rhs); | 281 | void EmitFPOrdGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 282 | void EmitFPUnordGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); | 282 | void EmitFPUnordGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 283 | void EmitFPUnordGreaterThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 283 | void EmitFPUnordGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 284 | void EmitFPUnordGreaterThan64(EmitContext& ctx, Register lhs, Register rhs); | 284 | void EmitFPUnordGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 285 | void EmitFPOrdLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); | 285 | void EmitFPOrdLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 286 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); | 286 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 287 | void EmitFPOrdLessThanEqual64(EmitContext& ctx, Register lhs, Register rhs); | 287 | void EmitFPOrdLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 288 | void EmitFPUnordLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); | 288 | void EmitFPUnordLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 289 | void EmitFPUnordLessThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 289 | void EmitFPUnordLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 290 | void EmitFPUnordLessThanEqual64(EmitContext& ctx, Register lhs, Register rhs); | 290 | void EmitFPUnordLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 291 | void EmitFPOrdGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); | 291 | void EmitFPOrdGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 292 | void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 292 | void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 293 | void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, Register lhs, Register rhs); | 293 | void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 294 | void EmitFPUnordGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); | 294 | void EmitFPUnordGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 295 | void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); | 295 | void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 296 | void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, Register lhs, Register rhs); | 296 | void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs); |
| 297 | void EmitFPIsNan16(EmitContext& ctx, Register value); | 297 | void EmitFPIsNan16(EmitContext& ctx, Register value); |
| 298 | void EmitFPIsNan32(EmitContext& ctx, ScalarF32 value); | 298 | void EmitFPIsNan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 299 | void EmitFPIsNan64(EmitContext& ctx, Register value); | 299 | void EmitFPIsNan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 value); |
| 300 | void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); | 300 | void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 301 | void EmitIAdd64(EmitContext& ctx, Register a, Register b); | 301 | void EmitIAdd64(EmitContext& ctx, Register a, Register b); |
| 302 | void EmitISub32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); | 302 | void EmitISub32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
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 e94571f2d..60eb123cf 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -281,18 +281,6 @@ void EmitGetInBoundsFromOp(EmitContext& ctx) { | |||
| 281 | NotImplemented(); | 281 | NotImplemented(); |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | void EmitFPIsNan16(EmitContext& ctx, Register value) { | ||
| 285 | NotImplemented(); | ||
| 286 | } | ||
| 287 | |||
| 288 | void EmitFPIsNan32(EmitContext& ctx, ScalarF32 value) { | ||
| 289 | NotImplemented(); | ||
| 290 | } | ||
| 291 | |||
| 292 | void EmitFPIsNan64(EmitContext& ctx, Register value) { | ||
| 293 | NotImplemented(); | ||
| 294 | } | ||
| 295 | |||
| 296 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { | 284 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 297 | NotImplemented(); | 285 | NotImplemented(); |
| 298 | } | 286 | } |