diff options
| author | 2021-05-08 16:28:52 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:30 -0400 | |
| commit | 6fd190d1ae4275a06ed2e488401e1d63912954be (patch) | |
| tree | ece4681d18c7b0b5bcb6b540ea4a21b32c19b363 /src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |
| parent | glasm: Changes to GLASM register allocator and emit context (diff) | |
| download | yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.gz yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.xz yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.zip | |
glasm: Implement basic GLASM instructions
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | 228 |
1 files changed, 228 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp index e69de29bb..e228fa072 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |||
| @@ -0,0 +1,228 @@ | |||
| 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 <string_view> | ||
| 6 | |||
| 7 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 9 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 10 | |||
| 11 | namespace Shader::Backend::GLASM { | ||
| 12 | |||
| 13 | void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 14 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | ||
| 15 | throw NotImplementedException("GLASM instruction"); | ||
| 16 | } | ||
| 17 | |||
| 18 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 19 | [[maybe_unused]] std::string_view b) { | ||
| 20 | throw NotImplementedException("GLASM instruction"); | ||
| 21 | } | ||
| 22 | |||
| 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 24 | [[maybe_unused]] std::string_view b) { | ||
| 25 | throw NotImplementedException("GLASM instruction"); | ||
| 26 | } | ||
| 27 | |||
| 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 29 | [[maybe_unused]] std::string_view b) { | ||
| 30 | throw NotImplementedException("GLASM instruction"); | ||
| 31 | } | ||
| 32 | |||
| 33 | void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 34 | [[maybe_unused]] std::string_view b) { | ||
| 35 | throw NotImplementedException("GLASM instruction"); | ||
| 36 | } | ||
| 37 | |||
| 38 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 39 | throw NotImplementedException("GLASM instruction"); | ||
| 40 | } | ||
| 41 | |||
| 42 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 43 | throw NotImplementedException("GLASM instruction"); | ||
| 44 | } | ||
| 45 | |||
| 46 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 47 | throw NotImplementedException("GLASM instruction"); | ||
| 48 | } | ||
| 49 | |||
| 50 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 51 | throw NotImplementedException("GLASM instruction"); | ||
| 52 | } | ||
| 53 | |||
| 54 | void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, | ||
| 55 | [[maybe_unused]] std::string_view base, | ||
| 56 | [[maybe_unused]] std::string_view shift) { | ||
| 57 | throw NotImplementedException("GLASM instruction"); | ||
| 58 | } | ||
| 59 | |||
| 60 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, | ||
| 61 | [[maybe_unused]] std::string_view base, | ||
| 62 | [[maybe_unused]] std::string_view shift) { | ||
| 63 | throw NotImplementedException("GLASM instruction"); | ||
| 64 | } | ||
| 65 | |||
| 66 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, | ||
| 67 | [[maybe_unused]] std::string_view base, | ||
| 68 | [[maybe_unused]] std::string_view shift) { | ||
| 69 | throw NotImplementedException("GLASM instruction"); | ||
| 70 | } | ||
| 71 | |||
| 72 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, | ||
| 73 | [[maybe_unused]] std::string_view base, | ||
| 74 | [[maybe_unused]] std::string_view shift) { | ||
| 75 | throw NotImplementedException("GLASM instruction"); | ||
| 76 | } | ||
| 77 | |||
| 78 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, | ||
| 79 | [[maybe_unused]] std::string_view base, | ||
| 80 | [[maybe_unused]] std::string_view shift) { | ||
| 81 | throw NotImplementedException("GLASM instruction"); | ||
| 82 | } | ||
| 83 | |||
| 84 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, | ||
| 85 | [[maybe_unused]] std::string_view base, | ||
| 86 | [[maybe_unused]] std::string_view shift) { | ||
| 87 | throw NotImplementedException("GLASM instruction"); | ||
| 88 | } | ||
| 89 | |||
| 90 | void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 91 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | ||
| 92 | throw NotImplementedException("GLASM instruction"); | ||
| 93 | } | ||
| 94 | |||
| 95 | void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 96 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | ||
| 97 | throw NotImplementedException("GLASM instruction"); | ||
| 98 | } | ||
| 99 | |||
| 100 | void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 101 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | ||
| 102 | throw NotImplementedException("GLASM instruction"); | ||
| 103 | } | ||
| 104 | |||
| 105 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view base, | ||
| 106 | [[maybe_unused]] std::string_view insert, | ||
| 107 | [[maybe_unused]] std::string_view offset, | ||
| 108 | [[maybe_unused]] std::string_view count) { | ||
| 109 | throw NotImplementedException("GLASM instruction"); | ||
| 110 | } | ||
| 111 | |||
| 112 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 113 | [[maybe_unused]] std::string_view base, | ||
| 114 | [[maybe_unused]] std::string_view offset, | ||
| 115 | [[maybe_unused]] std::string_view count) { | ||
| 116 | throw NotImplementedException("GLASM instruction"); | ||
| 117 | } | ||
| 118 | |||
| 119 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 120 | [[maybe_unused]] std::string_view base, | ||
| 121 | [[maybe_unused]] std::string_view offset, | ||
| 122 | [[maybe_unused]] std::string_view count) { | ||
| 123 | throw NotImplementedException("GLASM instruction"); | ||
| 124 | } | ||
| 125 | |||
| 126 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 127 | throw NotImplementedException("GLASM instruction"); | ||
| 128 | } | ||
| 129 | |||
| 130 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 131 | throw NotImplementedException("GLASM instruction"); | ||
| 132 | } | ||
| 133 | |||
| 134 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 135 | throw NotImplementedException("GLASM instruction"); | ||
| 136 | } | ||
| 137 | |||
| 138 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 139 | throw NotImplementedException("GLASM instruction"); | ||
| 140 | } | ||
| 141 | |||
| 142 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | ||
| 143 | throw NotImplementedException("GLASM instruction"); | ||
| 144 | } | ||
| 145 | |||
| 146 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 147 | [[maybe_unused]] std::string_view b) { | ||
| 148 | throw NotImplementedException("GLASM instruction"); | ||
| 149 | } | ||
| 150 | |||
| 151 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 152 | [[maybe_unused]] std::string_view b) { | ||
| 153 | throw NotImplementedException("GLASM instruction"); | ||
| 154 | } | ||
| 155 | |||
| 156 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 157 | [[maybe_unused]] std::string_view b) { | ||
| 158 | throw NotImplementedException("GLASM instruction"); | ||
| 159 | } | ||
| 160 | |||
| 161 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | ||
| 162 | [[maybe_unused]] std::string_view b) { | ||
| 163 | throw NotImplementedException("GLASM instruction"); | ||
| 164 | } | ||
| 165 | |||
| 166 | void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 167 | [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, | ||
| 168 | [[maybe_unused]] std::string_view max) { | ||
| 169 | throw NotImplementedException("GLASM instruction"); | ||
| 170 | } | ||
| 171 | |||
| 172 | void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 173 | [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, | ||
| 174 | [[maybe_unused]] std::string_view max) { | ||
| 175 | throw NotImplementedException("GLASM instruction"); | ||
| 176 | } | ||
| 177 | |||
| 178 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 179 | [[maybe_unused]] std::string_view rhs) { | ||
| 180 | throw NotImplementedException("GLASM instruction"); | ||
| 181 | } | ||
| 182 | |||
| 183 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 184 | [[maybe_unused]] std::string_view rhs) { | ||
| 185 | throw NotImplementedException("GLASM instruction"); | ||
| 186 | } | ||
| 187 | |||
| 188 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 189 | [[maybe_unused]] std::string_view rhs) { | ||
| 190 | throw NotImplementedException("GLASM instruction"); | ||
| 191 | } | ||
| 192 | |||
| 193 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 194 | [[maybe_unused]] std::string_view rhs) { | ||
| 195 | throw NotImplementedException("GLASM instruction"); | ||
| 196 | } | ||
| 197 | |||
| 198 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 199 | [[maybe_unused]] std::string_view rhs) { | ||
| 200 | throw NotImplementedException("GLASM instruction"); | ||
| 201 | } | ||
| 202 | |||
| 203 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 204 | [[maybe_unused]] std::string_view rhs) { | ||
| 205 | throw NotImplementedException("GLASM instruction"); | ||
| 206 | } | ||
| 207 | |||
| 208 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 209 | [[maybe_unused]] std::string_view rhs) { | ||
| 210 | throw NotImplementedException("GLASM instruction"); | ||
| 211 | } | ||
| 212 | |||
| 213 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 214 | [[maybe_unused]] std::string_view rhs) { | ||
| 215 | throw NotImplementedException("GLASM instruction"); | ||
| 216 | } | ||
| 217 | |||
| 218 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 219 | [[maybe_unused]] std::string_view rhs) { | ||
| 220 | throw NotImplementedException("GLASM instruction"); | ||
| 221 | } | ||
| 222 | |||
| 223 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | ||
| 224 | [[maybe_unused]] std::string_view rhs) { | ||
| 225 | throw NotImplementedException("GLASM instruction"); | ||
| 226 | } | ||
| 227 | |||
| 228 | } // namespace Shader::Backend::GLASM | ||