diff options
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp new file mode 100644 index 000000000..3ef4f3d78 --- /dev/null +++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "shader_recompiler/backend/spirv/emit_spirv.h" | ||
| 6 | |||
| 7 | namespace Shader::Backend::SPIRV { | ||
| 8 | |||
| 9 | Id EmitSPIRV::EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | ||
| 10 | if (inst->HasAssociatedPseudoOperation()) { | ||
| 11 | throw NotImplementedException("Pseudo-operations on IAdd32"); | ||
| 12 | } | ||
| 13 | return ctx.OpIAdd(ctx.u32[1], a, b); | ||
| 14 | } | ||
| 15 | |||
| 16 | void EmitSPIRV::EmitIAdd64(EmitContext&) { | ||
| 17 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 18 | } | ||
| 19 | |||
| 20 | Id EmitSPIRV::EmitISub32(EmitContext& ctx, Id a, Id b) { | ||
| 21 | return ctx.OpISub(ctx.u32[1], a, b); | ||
| 22 | } | ||
| 23 | |||
| 24 | void EmitSPIRV::EmitISub64(EmitContext&) { | ||
| 25 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 26 | } | ||
| 27 | |||
| 28 | Id EmitSPIRV::EmitIMul32(EmitContext& ctx, Id a, Id b) { | ||
| 29 | return ctx.OpIMul(ctx.u32[1], a, b); | ||
| 30 | } | ||
| 31 | |||
| 32 | void EmitSPIRV::EmitINeg32(EmitContext&) { | ||
| 33 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 34 | } | ||
| 35 | |||
| 36 | void EmitSPIRV::EmitIAbs32(EmitContext&) { | ||
| 37 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 38 | } | ||
| 39 | |||
| 40 | Id EmitSPIRV::EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift) { | ||
| 41 | return ctx.OpShiftLeftLogical(ctx.u32[1], base, shift); | ||
| 42 | } | ||
| 43 | |||
| 44 | void EmitSPIRV::EmitShiftRightLogical32(EmitContext&) { | ||
| 45 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 46 | } | ||
| 47 | |||
| 48 | void EmitSPIRV::EmitShiftRightArithmetic32(EmitContext&) { | ||
| 49 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 50 | } | ||
| 51 | |||
| 52 | void EmitSPIRV::EmitBitwiseAnd32(EmitContext&) { | ||
| 53 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 54 | } | ||
| 55 | |||
| 56 | void EmitSPIRV::EmitBitwiseOr32(EmitContext&) { | ||
| 57 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 58 | } | ||
| 59 | |||
| 60 | void EmitSPIRV::EmitBitwiseXor32(EmitContext&) { | ||
| 61 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 62 | } | ||
| 63 | |||
| 64 | void EmitSPIRV::EmitBitFieldInsert(EmitContext&) { | ||
| 65 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 66 | } | ||
| 67 | |||
| 68 | void EmitSPIRV::EmitBitFieldSExtract(EmitContext&) { | ||
| 69 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 70 | } | ||
| 71 | |||
| 72 | Id EmitSPIRV::EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count) { | ||
| 73 | return ctx.OpBitFieldUExtract(ctx.u32[1], base, offset, count); | ||
| 74 | } | ||
| 75 | |||
| 76 | void EmitSPIRV::EmitSLessThan(EmitContext&) { | ||
| 77 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 78 | } | ||
| 79 | |||
| 80 | void EmitSPIRV::EmitULessThan(EmitContext&) { | ||
| 81 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 82 | } | ||
| 83 | |||
| 84 | void EmitSPIRV::EmitIEqual(EmitContext&) { | ||
| 85 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 86 | } | ||
| 87 | |||
| 88 | void EmitSPIRV::EmitSLessThanEqual(EmitContext&) { | ||
| 89 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 90 | } | ||
| 91 | |||
| 92 | void EmitSPIRV::EmitULessThanEqual(EmitContext&) { | ||
| 93 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 94 | } | ||
| 95 | |||
| 96 | void EmitSPIRV::EmitSGreaterThan(EmitContext&) { | ||
| 97 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 98 | } | ||
| 99 | |||
| 100 | void EmitSPIRV::EmitUGreaterThan(EmitContext&) { | ||
| 101 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 102 | } | ||
| 103 | |||
| 104 | void EmitSPIRV::EmitINotEqual(EmitContext&) { | ||
| 105 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 106 | } | ||
| 107 | |||
| 108 | void EmitSPIRV::EmitSGreaterThanEqual(EmitContext&) { | ||
| 109 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 110 | } | ||
| 111 | |||
| 112 | Id EmitSPIRV::EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs) { | ||
| 113 | return ctx.OpUGreaterThanEqual(ctx.u1, lhs, rhs); | ||
| 114 | } | ||
| 115 | |||
| 116 | void EmitSPIRV::EmitLogicalOr(EmitContext&) { | ||
| 117 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 118 | } | ||
| 119 | |||
| 120 | void EmitSPIRV::EmitLogicalAnd(EmitContext&) { | ||
| 121 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 122 | } | ||
| 123 | |||
| 124 | void EmitSPIRV::EmitLogicalXor(EmitContext&) { | ||
| 125 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 126 | } | ||
| 127 | |||
| 128 | void EmitSPIRV::EmitLogicalNot(EmitContext&) { | ||
| 129 | throw NotImplementedException("SPIR-V Instruction"); | ||
| 130 | } | ||
| 131 | |||
| 132 | } // namespace Shader::Backend::SPIRV | ||