emit_spirv_integer.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "shader_recompiler/backend/spirv/emit_spirv.h"
  5. namespace Shader::Backend::SPIRV {
  6. Id EmitSPIRV::EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) {
  7. if (inst->HasAssociatedPseudoOperation()) {
  8. throw NotImplementedException("Pseudo-operations on IAdd32");
  9. }
  10. return ctx.OpIAdd(ctx.u32[1], a, b);
  11. }
  12. void EmitSPIRV::EmitIAdd64(EmitContext&) {
  13. throw NotImplementedException("SPIR-V Instruction");
  14. }
  15. Id EmitSPIRV::EmitISub32(EmitContext& ctx, Id a, Id b) {
  16. return ctx.OpISub(ctx.u32[1], a, b);
  17. }
  18. void EmitSPIRV::EmitISub64(EmitContext&) {
  19. throw NotImplementedException("SPIR-V Instruction");
  20. }
  21. Id EmitSPIRV::EmitIMul32(EmitContext& ctx, Id a, Id b) {
  22. return ctx.OpIMul(ctx.u32[1], a, b);
  23. }
  24. void EmitSPIRV::EmitINeg32(EmitContext&) {
  25. throw NotImplementedException("SPIR-V Instruction");
  26. }
  27. void EmitSPIRV::EmitIAbs32(EmitContext&) {
  28. throw NotImplementedException("SPIR-V Instruction");
  29. }
  30. Id EmitSPIRV::EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift) {
  31. return ctx.OpShiftLeftLogical(ctx.u32[1], base, shift);
  32. }
  33. void EmitSPIRV::EmitShiftRightLogical32(EmitContext&) {
  34. throw NotImplementedException("SPIR-V Instruction");
  35. }
  36. void EmitSPIRV::EmitShiftRightArithmetic32(EmitContext&) {
  37. throw NotImplementedException("SPIR-V Instruction");
  38. }
  39. void EmitSPIRV::EmitBitwiseAnd32(EmitContext&) {
  40. throw NotImplementedException("SPIR-V Instruction");
  41. }
  42. void EmitSPIRV::EmitBitwiseOr32(EmitContext&) {
  43. throw NotImplementedException("SPIR-V Instruction");
  44. }
  45. void EmitSPIRV::EmitBitwiseXor32(EmitContext&) {
  46. throw NotImplementedException("SPIR-V Instruction");
  47. }
  48. void EmitSPIRV::EmitBitFieldInsert(EmitContext&) {
  49. throw NotImplementedException("SPIR-V Instruction");
  50. }
  51. void EmitSPIRV::EmitBitFieldSExtract(EmitContext&) {
  52. throw NotImplementedException("SPIR-V Instruction");
  53. }
  54. Id EmitSPIRV::EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count) {
  55. return ctx.OpBitFieldUExtract(ctx.u32[1], base, offset, count);
  56. }
  57. Id EmitSPIRV::EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs) {
  58. return ctx.OpSLessThan(ctx.u1, lhs, rhs);
  59. }
  60. void EmitSPIRV::EmitULessThan(EmitContext&) {
  61. throw NotImplementedException("SPIR-V Instruction");
  62. }
  63. void EmitSPIRV::EmitIEqual(EmitContext&) {
  64. throw NotImplementedException("SPIR-V Instruction");
  65. }
  66. void EmitSPIRV::EmitSLessThanEqual(EmitContext&) {
  67. throw NotImplementedException("SPIR-V Instruction");
  68. }
  69. void EmitSPIRV::EmitULessThanEqual(EmitContext&) {
  70. throw NotImplementedException("SPIR-V Instruction");
  71. }
  72. Id EmitSPIRV::EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs) {
  73. return ctx.OpSGreaterThan(ctx.u1, lhs, rhs);
  74. }
  75. void EmitSPIRV::EmitUGreaterThan(EmitContext&) {
  76. throw NotImplementedException("SPIR-V Instruction");
  77. }
  78. void EmitSPIRV::EmitINotEqual(EmitContext&) {
  79. throw NotImplementedException("SPIR-V Instruction");
  80. }
  81. void EmitSPIRV::EmitSGreaterThanEqual(EmitContext&) {
  82. throw NotImplementedException("SPIR-V Instruction");
  83. }
  84. Id EmitSPIRV::EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs) {
  85. return ctx.OpUGreaterThanEqual(ctx.u1, lhs, rhs);
  86. }
  87. void EmitSPIRV::EmitLogicalOr(EmitContext&) {
  88. throw NotImplementedException("SPIR-V Instruction");
  89. }
  90. void EmitSPIRV::EmitLogicalAnd(EmitContext&) {
  91. throw NotImplementedException("SPIR-V Instruction");
  92. }
  93. void EmitSPIRV::EmitLogicalXor(EmitContext&) {
  94. throw NotImplementedException("SPIR-V Instruction");
  95. }
  96. void EmitSPIRV::EmitLogicalNot(EmitContext&) {
  97. throw NotImplementedException("SPIR-V Instruction");
  98. }
  99. } // namespace Shader::Backend::SPIRV