diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | 31 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp | 107 |
2 files changed, 138 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index b48007856..5efbe4e6f 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -372,6 +372,8 @@ void EmitSharedAtomicExchange32(EmitContext& ctx, IR::Inst& inst, ScalarU32 poin | |||
| 372 | ScalarU32 value); | 372 | ScalarU32 value); |
| 373 | void EmitSharedAtomicExchange64(EmitContext& ctx, IR::Inst& inst, ScalarU32 pointer_offset, | 373 | void EmitSharedAtomicExchange64(EmitContext& ctx, IR::Inst& inst, ScalarU32 pointer_offset, |
| 374 | Register value); | 374 | Register value); |
| 375 | void EmitSharedAtomicExchange32x2(EmitContext& ctx, IR::Inst& inst, ScalarU32 pointer_offset, | ||
| 376 | Register value); | ||
| 375 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 377 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 376 | ScalarU32 offset, ScalarU32 value); | 378 | ScalarU32 offset, ScalarU32 value); |
| 377 | void EmitStorageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 379 | void EmitStorageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| @@ -412,6 +414,24 @@ void EmitStorageAtomicXor64(EmitContext& ctx, IR::Inst& inst, const IR::Value& b | |||
| 412 | ScalarU32 offset, Register value); | 414 | ScalarU32 offset, Register value); |
| 413 | void EmitStorageAtomicExchange64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 415 | void EmitStorageAtomicExchange64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 414 | ScalarU32 offset, Register value); | 416 | ScalarU32 offset, Register value); |
| 417 | void EmitStorageAtomicIAdd32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 418 | ScalarU32 offset, Register value); | ||
| 419 | void EmitStorageAtomicSMin32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 420 | ScalarU32 offset, Register value); | ||
| 421 | void EmitStorageAtomicUMin32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 422 | ScalarU32 offset, Register value); | ||
| 423 | void EmitStorageAtomicSMax32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 424 | ScalarU32 offset, Register value); | ||
| 425 | void EmitStorageAtomicUMax32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 426 | ScalarU32 offset, Register value); | ||
| 427 | void EmitStorageAtomicAnd32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 428 | ScalarU32 offset, Register value); | ||
| 429 | void EmitStorageAtomicOr32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 430 | ScalarU32 offset, Register value); | ||
| 431 | void EmitStorageAtomicXor32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 432 | ScalarU32 offset, Register value); | ||
| 433 | void EmitStorageAtomicExchange32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 434 | ScalarU32 offset, Register value); | ||
| 415 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 435 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 416 | ScalarU32 offset, ScalarF32 value); | 436 | ScalarU32 offset, ScalarF32 value); |
| 417 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 437 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| @@ -448,6 +468,17 @@ void EmitGlobalAtomicAnd64(EmitContext& ctx); | |||
| 448 | void EmitGlobalAtomicOr64(EmitContext& ctx); | 468 | void EmitGlobalAtomicOr64(EmitContext& ctx); |
| 449 | void EmitGlobalAtomicXor64(EmitContext& ctx); | 469 | void EmitGlobalAtomicXor64(EmitContext& ctx); |
| 450 | void EmitGlobalAtomicExchange64(EmitContext& ctx); | 470 | void EmitGlobalAtomicExchange64(EmitContext& ctx); |
| 471 | void EmitGlobalAtomicIAdd32x2(EmitContext& ctx); | ||
| 472 | void EmitGlobalAtomicSMin32x2(EmitContext& ctx); | ||
| 473 | void EmitGlobalAtomicUMin32x2(EmitContext& ctx); | ||
| 474 | void EmitGlobalAtomicSMax32x2(EmitContext& ctx); | ||
| 475 | void EmitGlobalAtomicUMax32x2(EmitContext& ctx); | ||
| 476 | void EmitGlobalAtomicInc32x2(EmitContext& ctx); | ||
| 477 | void EmitGlobalAtomicDec32x2(EmitContext& ctx); | ||
| 478 | void EmitGlobalAtomicAnd32x2(EmitContext& ctx); | ||
| 479 | void EmitGlobalAtomicOr32x2(EmitContext& ctx); | ||
| 480 | void EmitGlobalAtomicXor32x2(EmitContext& ctx); | ||
| 481 | void EmitGlobalAtomicExchange32x2(EmitContext& ctx); | ||
| 451 | void EmitGlobalAtomicAddF32(EmitContext& ctx); | 482 | void EmitGlobalAtomicAddF32(EmitContext& ctx); |
| 452 | void EmitGlobalAtomicAddF16x2(EmitContext& ctx); | 483 | void EmitGlobalAtomicAddF16x2(EmitContext& ctx); |
| 453 | void EmitGlobalAtomicAddF32x2(EmitContext& ctx); | 484 | void EmitGlobalAtomicAddF32x2(EmitContext& ctx); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp index f135b67f5..f0fd94a28 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp | |||
| @@ -311,6 +311,13 @@ void EmitSharedAtomicExchange64(EmitContext& ctx, IR::Inst& inst, ScalarU32 poin | |||
| 311 | ctx.LongAdd("ATOMS.EXCH.U64 {}.x,{},shared_mem[{}];", inst, value, pointer_offset); | 311 | ctx.LongAdd("ATOMS.EXCH.U64 {}.x,{},shared_mem[{}];", inst, value, pointer_offset); |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | void EmitSharedAtomicExchange32x2([[maybe_unused]] EmitContext& ctx, | ||
| 315 | [[maybe_unused]] IR::Inst& inst, | ||
| 316 | [[maybe_unused]] ScalarU32 pointer_offset, | ||
| 317 | [[maybe_unused]] Register value) { | ||
| 318 | throw NotImplementedException("GLASM instruction"); | ||
| 319 | } | ||
| 320 | |||
| 314 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 321 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 315 | ScalarU32 offset, ScalarU32 value) { | 322 | ScalarU32 offset, ScalarU32 value) { |
| 316 | Atom(ctx, inst, binding, offset, value, "ADD", "U32"); | 323 | Atom(ctx, inst, binding, offset, value, "ADD", "U32"); |
| @@ -411,6 +418,62 @@ void EmitStorageAtomicExchange64(EmitContext& ctx, IR::Inst& inst, const IR::Val | |||
| 411 | Atom(ctx, inst, binding, offset, value, "EXCH", "U64"); | 418 | Atom(ctx, inst, binding, offset, value, "EXCH", "U64"); |
| 412 | } | 419 | } |
| 413 | 420 | ||
| 421 | void EmitStorageAtomicIAdd32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 422 | [[maybe_unused]] const IR::Value& binding, | ||
| 423 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 424 | throw NotImplementedException("GLASM instruction"); | ||
| 425 | } | ||
| 426 | |||
| 427 | void EmitStorageAtomicSMin32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 428 | [[maybe_unused]] const IR::Value& binding, | ||
| 429 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 430 | throw NotImplementedException("GLASM instruction"); | ||
| 431 | } | ||
| 432 | |||
| 433 | void EmitStorageAtomicUMin32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 434 | [[maybe_unused]] const IR::Value& binding, | ||
| 435 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 436 | throw NotImplementedException("GLASM instruction"); | ||
| 437 | } | ||
| 438 | |||
| 439 | void EmitStorageAtomicSMax32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 440 | [[maybe_unused]] const IR::Value& binding, | ||
| 441 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 442 | throw NotImplementedException("GLASM instruction"); | ||
| 443 | } | ||
| 444 | |||
| 445 | void EmitStorageAtomicUMax32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 446 | [[maybe_unused]] const IR::Value& binding, | ||
| 447 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 448 | throw NotImplementedException("GLASM instruction"); | ||
| 449 | } | ||
| 450 | |||
| 451 | void EmitStorageAtomicAnd32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 452 | [[maybe_unused]] const IR::Value& binding, | ||
| 453 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 454 | throw NotImplementedException("GLASM instruction"); | ||
| 455 | } | ||
| 456 | |||
| 457 | void EmitStorageAtomicOr32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 458 | [[maybe_unused]] const IR::Value& binding, | ||
| 459 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 460 | throw NotImplementedException("GLASM instruction"); | ||
| 461 | } | ||
| 462 | |||
| 463 | void EmitStorageAtomicXor32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 464 | [[maybe_unused]] const IR::Value& binding, | ||
| 465 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 466 | throw NotImplementedException("GLASM instruction"); | ||
| 467 | } | ||
| 468 | |||
| 469 | void EmitStorageAtomicExchange32x2([[maybe_unused]] EmitContext& ctx, | ||
| 470 | [[maybe_unused]] IR::Inst& inst, | ||
| 471 | [[maybe_unused]] const IR::Value& binding, | ||
| 472 | [[maybe_unused]] ScalarU32 offset, | ||
| 473 | [[maybe_unused]] Register value) { | ||
| 474 | throw NotImplementedException("GLASM instruction"); | ||
| 475 | } | ||
| 476 | |||
| 414 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 477 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 415 | ScalarU32 offset, ScalarF32 value) { | 478 | ScalarU32 offset, ScalarF32 value) { |
| 416 | Atom(ctx, inst, binding, offset, value, "ADD", "F32"); | 479 | Atom(ctx, inst, binding, offset, value, "ADD", "F32"); |
| @@ -537,6 +600,50 @@ void EmitGlobalAtomicExchange64(EmitContext&) { | |||
| 537 | throw NotImplementedException("GLASM instruction"); | 600 | throw NotImplementedException("GLASM instruction"); |
| 538 | } | 601 | } |
| 539 | 602 | ||
| 603 | void EmitGlobalAtomicIAdd32x2(EmitContext&) { | ||
| 604 | throw NotImplementedException("GLASM instruction"); | ||
| 605 | } | ||
| 606 | |||
| 607 | void EmitGlobalAtomicSMin32x2(EmitContext&) { | ||
| 608 | throw NotImplementedException("GLASM instruction"); | ||
| 609 | } | ||
| 610 | |||
| 611 | void EmitGlobalAtomicUMin32x2(EmitContext&) { | ||
| 612 | throw NotImplementedException("GLASM instruction"); | ||
| 613 | } | ||
| 614 | |||
| 615 | void EmitGlobalAtomicSMax32x2(EmitContext&) { | ||
| 616 | throw NotImplementedException("GLASM instruction"); | ||
| 617 | } | ||
| 618 | |||
| 619 | void EmitGlobalAtomicUMax32x2(EmitContext&) { | ||
| 620 | throw NotImplementedException("GLASM instruction"); | ||
| 621 | } | ||
| 622 | |||
| 623 | void EmitGlobalAtomicInc32x2(EmitContext&) { | ||
| 624 | throw NotImplementedException("GLASM instruction"); | ||
| 625 | } | ||
| 626 | |||
| 627 | void EmitGlobalAtomicDec32x2(EmitContext&) { | ||
| 628 | throw NotImplementedException("GLASM instruction"); | ||
| 629 | } | ||
| 630 | |||
| 631 | void EmitGlobalAtomicAnd32x2(EmitContext&) { | ||
| 632 | throw NotImplementedException("GLASM instruction"); | ||
| 633 | } | ||
| 634 | |||
| 635 | void EmitGlobalAtomicOr32x2(EmitContext&) { | ||
| 636 | throw NotImplementedException("GLASM instruction"); | ||
| 637 | } | ||
| 638 | |||
| 639 | void EmitGlobalAtomicXor32x2(EmitContext&) { | ||
| 640 | throw NotImplementedException("GLASM instruction"); | ||
| 641 | } | ||
| 642 | |||
| 643 | void EmitGlobalAtomicExchange32x2(EmitContext&) { | ||
| 644 | throw NotImplementedException("GLASM instruction"); | ||
| 645 | } | ||
| 646 | |||
| 540 | void EmitGlobalAtomicAddF32(EmitContext&) { | 647 | void EmitGlobalAtomicAddF32(EmitContext&) { |
| 541 | throw NotImplementedException("GLASM instruction"); | 648 | throw NotImplementedException("GLASM instruction"); |
| 542 | } | 649 | } |