diff options
| author | 2021-05-09 22:01:03 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | 80813b1d144a7f0f11047e7348620b720def93a9 (patch) | |
| tree | 705aafbb73d550a9ee8f3b5fd24fae9c4beb46d3 /src/shader_recompiler/backend/glasm | |
| parent | glasm: Add conversion instructions to GLASM (diff) | |
| download | yuzu-80813b1d144a7f0f11047e7348620b720def93a9.tar.gz yuzu-80813b1d144a7f0f11047e7348620b720def93a9.tar.xz yuzu-80813b1d144a7f0f11047e7348620b720def93a9.zip | |
glasm: Implement storage atomic ops
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
4 files changed, 358 insertions, 305 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 0e4b189c9..e6e065e7f 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -149,6 +149,18 @@ void EmitInst(EmitContext& ctx, IR::Inst* inst) { | |||
| 149 | } | 149 | } |
| 150 | throw LogicError("Invalid opcode {}", inst->GetOpcode()); | 150 | throw LogicError("Invalid opcode {}", inst->GetOpcode()); |
| 151 | } | 151 | } |
| 152 | |||
| 153 | void SetupOptions(std::string& header, Info info) { | ||
| 154 | if (info.uses_int64_bit_atomics) { | ||
| 155 | header += "OPTION NV_shader_atomic_int64;"; | ||
| 156 | } | ||
| 157 | if (info.uses_atomic_f32_add) { | ||
| 158 | header += "OPTION NV_shader_atomic_float;"; | ||
| 159 | } | ||
| 160 | if (info.uses_atomic_f16x2_add || info.uses_atomic_f16x2_min || info.uses_atomic_f16x2_max) { | ||
| 161 | header += "OPTION NV_shader_atomic_fp16_vector;"; | ||
| 162 | } | ||
| 163 | } | ||
| 152 | } // Anonymous namespace | 164 | } // Anonymous namespace |
| 153 | 165 | ||
| 154 | std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { | 166 | std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { |
| @@ -160,6 +172,7 @@ std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { | |||
| 160 | } | 172 | } |
| 161 | std::string header = "!!NVcp5.0\n" | 173 | std::string header = "!!NVcp5.0\n" |
| 162 | "OPTION NV_internal;"; | 174 | "OPTION NV_internal;"; |
| 175 | SetupOptions(header, program.info); | ||
| 163 | switch (program.stage) { | 176 | switch (program.stage) { |
| 164 | case Stage::Compute: | 177 | case Stage::Compute: |
| 165 | header += fmt::format("GROUP_SIZE {} {} {};", program.workgroup_size[0], | 178 | header += fmt::format("GROUP_SIZE {} {} {};", program.workgroup_size[0], |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_atomic.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_atomic.cpp index e69de29bb..fe44c3d15 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_atomic.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_atomic.cpp | |||
| @@ -0,0 +1,291 @@ | |||
| 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/glasm/emit_context.h" | ||
| 6 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 7 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 8 | |||
| 9 | namespace Shader::Backend::GLASM { | ||
| 10 | namespace { | ||
| 11 | void StorageOp(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, | ||
| 12 | std::string_view then_expr, std::string_view else_expr = {}) { | ||
| 13 | // Operate on bindless SSBO, call the expression with bounds checking | ||
| 14 | // address = c[binding].xy | ||
| 15 | // length = c[binding].z | ||
| 16 | const u32 sb_binding{binding.U32()}; | ||
| 17 | ctx.Add("PK64.U DC,c[{}];" // pointer = address | ||
| 18 | "CVT.U64.U32 DC.z,{};" // offset = uint64_t(offset) | ||
| 19 | "ADD.U64 DC.x,DC.x,DC.z;" // pointer += offset | ||
| 20 | "SLT.U.CC RC.x,{},c[{}].z;", // cc = offset < length | ||
| 21 | sb_binding, offset, offset, sb_binding); | ||
| 22 | if (else_expr.empty()) { | ||
| 23 | ctx.Add("IF NE.x;{}ENDIF;", then_expr); | ||
| 24 | } else { | ||
| 25 | ctx.Add("IF NE.x;{}ELSE;{}ENDIF;", then_expr, else_expr); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | template <typename ValueType> | ||
| 30 | void Atom(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset, | ||
| 31 | ValueType value, std::string_view operation, std::string_view size) { | ||
| 32 | const Register ret{ctx.reg_alloc.Define(inst)}; | ||
| 33 | StorageOp(ctx, binding, offset, | ||
| 34 | fmt::format("ATOM.{}.{} {},{},DC.x;", operation, size, ret, value)); | ||
| 35 | } | ||
| 36 | } // namespace | ||
| 37 | |||
| 38 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 39 | ScalarU32 offset, ScalarU32 value) { | ||
| 40 | Atom(ctx, inst, binding, offset, value, "ADD", "U32"); | ||
| 41 | } | ||
| 42 | |||
| 43 | void EmitStorageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 44 | ScalarU32 offset, ScalarS32 value) { | ||
| 45 | Atom(ctx, inst, binding, offset, value, "MIN", "S32"); | ||
| 46 | } | ||
| 47 | |||
| 48 | void EmitStorageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 49 | ScalarU32 offset, ScalarU32 value) { | ||
| 50 | Atom(ctx, inst, binding, offset, value, "MIN", "U32"); | ||
| 51 | } | ||
| 52 | |||
| 53 | void EmitStorageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 54 | ScalarU32 offset, ScalarS32 value) { | ||
| 55 | Atom(ctx, inst, binding, offset, value, "MAX", "S32"); | ||
| 56 | } | ||
| 57 | |||
| 58 | void EmitStorageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 59 | ScalarU32 offset, ScalarU32 value) { | ||
| 60 | Atom(ctx, inst, binding, offset, value, "MAX", "U32"); | ||
| 61 | } | ||
| 62 | |||
| 63 | void EmitStorageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 64 | ScalarU32 offset, ScalarU32 value) { | ||
| 65 | Atom(ctx, inst, binding, offset, value, "IWRAP", "U32"); | ||
| 66 | } | ||
| 67 | |||
| 68 | void EmitStorageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 69 | ScalarU32 offset, ScalarU32 value) { | ||
| 70 | Atom(ctx, inst, binding, offset, value, "DWRAP", "U32"); | ||
| 71 | } | ||
| 72 | |||
| 73 | void EmitStorageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 74 | ScalarU32 offset, ScalarU32 value) { | ||
| 75 | Atom(ctx, inst, binding, offset, value, "AND", "U32"); | ||
| 76 | } | ||
| 77 | |||
| 78 | void EmitStorageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 79 | ScalarU32 offset, ScalarU32 value) { | ||
| 80 | Atom(ctx, inst, binding, offset, value, "OR", "U32"); | ||
| 81 | } | ||
| 82 | |||
| 83 | void EmitStorageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 84 | ScalarU32 offset, ScalarU32 value) { | ||
| 85 | Atom(ctx, inst, binding, offset, value, "XOR", "U32"); | ||
| 86 | } | ||
| 87 | |||
| 88 | void EmitStorageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 89 | ScalarU32 offset, ScalarU32 value) { | ||
| 90 | Atom(ctx, inst, binding, offset, value, "EXCH", "U32"); | ||
| 91 | } | ||
| 92 | |||
| 93 | void EmitStorageAtomicIAdd64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 94 | ScalarU32 offset, Register value) { | ||
| 95 | Atom(ctx, inst, binding, offset, value, "ADD", "U64"); | ||
| 96 | } | ||
| 97 | |||
| 98 | void EmitStorageAtomicSMin64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 99 | ScalarU32 offset, Register value) { | ||
| 100 | Atom(ctx, inst, binding, offset, value, "MIN", "S64"); | ||
| 101 | } | ||
| 102 | |||
| 103 | void EmitStorageAtomicUMin64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 104 | ScalarU32 offset, Register value) { | ||
| 105 | Atom(ctx, inst, binding, offset, value, "MIN", "U64"); | ||
| 106 | } | ||
| 107 | |||
| 108 | void EmitStorageAtomicSMax64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 109 | ScalarU32 offset, Register value) { | ||
| 110 | Atom(ctx, inst, binding, offset, value, "MAX", "S64"); | ||
| 111 | } | ||
| 112 | |||
| 113 | void EmitStorageAtomicUMax64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 114 | ScalarU32 offset, Register value) { | ||
| 115 | Atom(ctx, inst, binding, offset, value, "MAX", "U64"); | ||
| 116 | } | ||
| 117 | |||
| 118 | void EmitStorageAtomicAnd64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 119 | ScalarU32 offset, Register value) { | ||
| 120 | Atom(ctx, inst, binding, offset, value, "AND", "U64"); | ||
| 121 | } | ||
| 122 | |||
| 123 | void EmitStorageAtomicOr64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 124 | ScalarU32 offset, Register value) { | ||
| 125 | Atom(ctx, inst, binding, offset, value, "OR", "U64"); | ||
| 126 | } | ||
| 127 | |||
| 128 | void EmitStorageAtomicXor64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 129 | ScalarU32 offset, Register value) { | ||
| 130 | Atom(ctx, inst, binding, offset, value, "XOR", "U64"); | ||
| 131 | } | ||
| 132 | |||
| 133 | void EmitStorageAtomicExchange64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 134 | ScalarU32 offset, Register value) { | ||
| 135 | Atom(ctx, inst, binding, offset, value, "EXCH", "U64"); | ||
| 136 | } | ||
| 137 | |||
| 138 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 139 | ScalarU32 offset, ScalarF32 value) { | ||
| 140 | Atom(ctx, inst, binding, offset, value, "ADD", "F32"); | ||
| 141 | } | ||
| 142 | |||
| 143 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 144 | ScalarU32 offset, Register value) { | ||
| 145 | Atom(ctx, inst, binding, offset, value, "ADD", "F16x2"); | ||
| 146 | } | ||
| 147 | |||
| 148 | void EmitStorageAtomicAddF32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 149 | [[maybe_unused]] const IR::Value& binding, | ||
| 150 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 151 | throw NotImplementedException("GLASM instruction"); | ||
| 152 | } | ||
| 153 | |||
| 154 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 155 | ScalarU32 offset, Register value) { | ||
| 156 | Atom(ctx, inst, binding, offset, value, "MIN", "F16x2"); | ||
| 157 | } | ||
| 158 | |||
| 159 | void EmitStorageAtomicMinF32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 160 | [[maybe_unused]] const IR::Value& binding, | ||
| 161 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 162 | throw NotImplementedException("GLASM instruction"); | ||
| 163 | } | ||
| 164 | |||
| 165 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 166 | ScalarU32 offset, Register value) { | ||
| 167 | Atom(ctx, inst, binding, offset, value, "MAX", "F16x2"); | ||
| 168 | } | ||
| 169 | |||
| 170 | void EmitStorageAtomicMaxF32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | ||
| 171 | [[maybe_unused]] const IR::Value& binding, | ||
| 172 | [[maybe_unused]] ScalarU32 offset, [[maybe_unused]] Register value) { | ||
| 173 | throw NotImplementedException("GLASM instruction"); | ||
| 174 | } | ||
| 175 | |||
| 176 | void EmitGlobalAtomicIAdd32(EmitContext&) { | ||
| 177 | throw NotImplementedException("GLASM instruction"); | ||
| 178 | } | ||
| 179 | |||
| 180 | void EmitGlobalAtomicSMin32(EmitContext&) { | ||
| 181 | throw NotImplementedException("GLASM instruction"); | ||
| 182 | } | ||
| 183 | |||
| 184 | void EmitGlobalAtomicUMin32(EmitContext&) { | ||
| 185 | throw NotImplementedException("GLASM instruction"); | ||
| 186 | } | ||
| 187 | |||
| 188 | void EmitGlobalAtomicSMax32(EmitContext&) { | ||
| 189 | throw NotImplementedException("GLASM instruction"); | ||
| 190 | } | ||
| 191 | |||
| 192 | void EmitGlobalAtomicUMax32(EmitContext&) { | ||
| 193 | throw NotImplementedException("GLASM instruction"); | ||
| 194 | } | ||
| 195 | |||
| 196 | void EmitGlobalAtomicInc32(EmitContext&) { | ||
| 197 | throw NotImplementedException("GLASM instruction"); | ||
| 198 | } | ||
| 199 | |||
| 200 | void EmitGlobalAtomicDec32(EmitContext&) { | ||
| 201 | throw NotImplementedException("GLASM instruction"); | ||
| 202 | } | ||
| 203 | |||
| 204 | void EmitGlobalAtomicAnd32(EmitContext&) { | ||
| 205 | throw NotImplementedException("GLASM instruction"); | ||
| 206 | } | ||
| 207 | |||
| 208 | void EmitGlobalAtomicOr32(EmitContext&) { | ||
| 209 | throw NotImplementedException("GLASM instruction"); | ||
| 210 | } | ||
| 211 | |||
| 212 | void EmitGlobalAtomicXor32(EmitContext&) { | ||
| 213 | throw NotImplementedException("GLASM instruction"); | ||
| 214 | } | ||
| 215 | |||
| 216 | void EmitGlobalAtomicExchange32(EmitContext&) { | ||
| 217 | throw NotImplementedException("GLASM instruction"); | ||
| 218 | } | ||
| 219 | |||
| 220 | void EmitGlobalAtomicIAdd64(EmitContext&) { | ||
| 221 | throw NotImplementedException("GLASM instruction"); | ||
| 222 | } | ||
| 223 | |||
| 224 | void EmitGlobalAtomicSMin64(EmitContext&) { | ||
| 225 | throw NotImplementedException("GLASM instruction"); | ||
| 226 | } | ||
| 227 | |||
| 228 | void EmitGlobalAtomicUMin64(EmitContext&) { | ||
| 229 | throw NotImplementedException("GLASM instruction"); | ||
| 230 | } | ||
| 231 | |||
| 232 | void EmitGlobalAtomicSMax64(EmitContext&) { | ||
| 233 | throw NotImplementedException("GLASM instruction"); | ||
| 234 | } | ||
| 235 | |||
| 236 | void EmitGlobalAtomicUMax64(EmitContext&) { | ||
| 237 | throw NotImplementedException("GLASM instruction"); | ||
| 238 | } | ||
| 239 | |||
| 240 | void EmitGlobalAtomicInc64(EmitContext&) { | ||
| 241 | throw NotImplementedException("GLASM instruction"); | ||
| 242 | } | ||
| 243 | |||
| 244 | void EmitGlobalAtomicDec64(EmitContext&) { | ||
| 245 | throw NotImplementedException("GLASM instruction"); | ||
| 246 | } | ||
| 247 | |||
| 248 | void EmitGlobalAtomicAnd64(EmitContext&) { | ||
| 249 | throw NotImplementedException("GLASM instruction"); | ||
| 250 | } | ||
| 251 | |||
| 252 | void EmitGlobalAtomicOr64(EmitContext&) { | ||
| 253 | throw NotImplementedException("GLASM instruction"); | ||
| 254 | } | ||
| 255 | |||
| 256 | void EmitGlobalAtomicXor64(EmitContext&) { | ||
| 257 | throw NotImplementedException("GLASM instruction"); | ||
| 258 | } | ||
| 259 | |||
| 260 | void EmitGlobalAtomicExchange64(EmitContext&) { | ||
| 261 | throw NotImplementedException("GLASM instruction"); | ||
| 262 | } | ||
| 263 | |||
| 264 | void EmitGlobalAtomicAddF32(EmitContext&) { | ||
| 265 | throw NotImplementedException("GLASM instruction"); | ||
| 266 | } | ||
| 267 | |||
| 268 | void EmitGlobalAtomicAddF16x2(EmitContext&) { | ||
| 269 | throw NotImplementedException("GLASM instruction"); | ||
| 270 | } | ||
| 271 | |||
| 272 | void EmitGlobalAtomicAddF32x2(EmitContext&) { | ||
| 273 | throw NotImplementedException("GLASM instruction"); | ||
| 274 | } | ||
| 275 | |||
| 276 | void EmitGlobalAtomicMinF16x2(EmitContext&) { | ||
| 277 | throw NotImplementedException("GLASM instruction"); | ||
| 278 | } | ||
| 279 | |||
| 280 | void EmitGlobalAtomicMinF32x2(EmitContext&) { | ||
| 281 | throw NotImplementedException("GLASM instruction"); | ||
| 282 | } | ||
| 283 | |||
| 284 | void EmitGlobalAtomicMaxF16x2(EmitContext&) { | ||
| 285 | throw NotImplementedException("GLASM instruction"); | ||
| 286 | } | ||
| 287 | |||
| 288 | void EmitGlobalAtomicMaxF32x2(EmitContext&) { | ||
| 289 | throw NotImplementedException("GLASM instruction"); | ||
| 290 | } | ||
| 291 | } // 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 94843cc60..817001afb 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -356,60 +356,60 @@ void EmitSharedAtomicOr32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 | |||
| 356 | void EmitSharedAtomicXor32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); | 356 | void EmitSharedAtomicXor32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 357 | void EmitSharedAtomicExchange32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); | 357 | void EmitSharedAtomicExchange32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 358 | void EmitSharedAtomicExchange64(EmitContext& ctx, ScalarU32 pointer_offset, Register value); | 358 | void EmitSharedAtomicExchange64(EmitContext& ctx, ScalarU32 pointer_offset, Register value); |
| 359 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 359 | void EmitStorageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 360 | ScalarU32 value); | 360 | ScalarU32 offset, ScalarU32 value); |
| 361 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 361 | void EmitStorageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 362 | ScalarS32 value); | 362 | ScalarU32 offset, ScalarS32 value); |
| 363 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 363 | void EmitStorageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 364 | ScalarU32 value); | 364 | ScalarU32 offset, ScalarU32 value); |
| 365 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 365 | void EmitStorageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 366 | ScalarS32 value); | 366 | ScalarU32 offset, ScalarS32 value); |
| 367 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 367 | void EmitStorageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 368 | ScalarU32 value); | 368 | ScalarU32 offset, ScalarU32 value); |
| 369 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 369 | void EmitStorageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 370 | ScalarU32 value); | 370 | ScalarU32 offset, ScalarU32 value); |
| 371 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 371 | void EmitStorageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 372 | ScalarU32 value); | 372 | ScalarU32 offset, ScalarU32 value); |
| 373 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 373 | void EmitStorageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 374 | ScalarU32 value); | 374 | ScalarU32 offset, ScalarU32 value); |
| 375 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 375 | void EmitStorageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 376 | ScalarU32 value); | 376 | ScalarU32 offset, ScalarU32 value); |
| 377 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 377 | void EmitStorageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 378 | ScalarU32 value); | 378 | ScalarU32 offset, ScalarU32 value); |
| 379 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, | 379 | void EmitStorageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 380 | const IR::Value& offset, ScalarU32 value); | 380 | ScalarU32 offset, ScalarU32 value); |
| 381 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 381 | void EmitStorageAtomicIAdd64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 382 | Register value); | 382 | ScalarU32 offset, Register value); |
| 383 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 383 | void EmitStorageAtomicSMin64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 384 | Register value); | 384 | ScalarU32 offset, Register value); |
| 385 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 385 | void EmitStorageAtomicUMin64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 386 | Register value); | 386 | ScalarU32 offset, Register value); |
| 387 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 387 | void EmitStorageAtomicSMax64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 388 | Register value); | 388 | ScalarU32 offset, Register value); |
| 389 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 389 | void EmitStorageAtomicUMax64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 390 | Register value); | 390 | ScalarU32 offset, Register value); |
| 391 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 391 | void EmitStorageAtomicAnd64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 392 | Register value); | 392 | ScalarU32 offset, Register value); |
| 393 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 393 | void EmitStorageAtomicOr64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 394 | Register value); | 394 | ScalarU32 offset, Register value); |
| 395 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 395 | void EmitStorageAtomicXor64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 396 | Register value); | 396 | ScalarU32 offset, Register value); |
| 397 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, | 397 | void EmitStorageAtomicExchange64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 398 | const IR::Value& offset, Register value); | 398 | ScalarU32 offset, Register value); |
| 399 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 399 | void EmitStorageAtomicAddF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 400 | ScalarF32 value); | 400 | ScalarU32 offset, ScalarF32 value); |
| 401 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 401 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 402 | Register value); | 402 | ScalarU32 offset, Register value); |
| 403 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 403 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 404 | Register value); | 404 | ScalarU32 offset, Register value); |
| 405 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 405 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 406 | Register value); | 406 | ScalarU32 offset, Register value); |
| 407 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 407 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 408 | Register value); | 408 | ScalarU32 offset, Register value); |
| 409 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 409 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 410 | Register value); | 410 | ScalarU32 offset, Register value); |
| 411 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 411 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 412 | Register value); | 412 | ScalarU32 offset, Register value); |
| 413 | void EmitGlobalAtomicIAdd32(EmitContext& ctx); | 413 | void EmitGlobalAtomicIAdd32(EmitContext& ctx); |
| 414 | void EmitGlobalAtomicSMin32(EmitContext& ctx); | 414 | void EmitGlobalAtomicSMin32(EmitContext& ctx); |
| 415 | void EmitGlobalAtomicUMin32(EmitContext& ctx); | 415 | void EmitGlobalAtomicUMin32(EmitContext& ctx); |
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 ebdbbcf5f..85110bcc9 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -321,257 +321,6 @@ void EmitSharedAtomicExchange64(EmitContext& ctx, ScalarU32 pointer_offset, Regi | |||
| 321 | NotImplemented(); | 321 | NotImplemented(); |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 325 | ScalarU32 value) { | ||
| 326 | NotImplemented(); | ||
| 327 | } | ||
| 328 | |||
| 329 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 330 | ScalarS32 value) { | ||
| 331 | NotImplemented(); | ||
| 332 | } | ||
| 333 | |||
| 334 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 335 | ScalarU32 value) { | ||
| 336 | NotImplemented(); | ||
| 337 | } | ||
| 338 | |||
| 339 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 340 | ScalarS32 value) { | ||
| 341 | NotImplemented(); | ||
| 342 | } | ||
| 343 | |||
| 344 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 345 | ScalarU32 value) { | ||
| 346 | NotImplemented(); | ||
| 347 | } | ||
| 348 | |||
| 349 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 350 | ScalarU32 value) { | ||
| 351 | NotImplemented(); | ||
| 352 | } | ||
| 353 | |||
| 354 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 355 | ScalarU32 value) { | ||
| 356 | NotImplemented(); | ||
| 357 | } | ||
| 358 | |||
| 359 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 360 | ScalarU32 value) { | ||
| 361 | NotImplemented(); | ||
| 362 | } | ||
| 363 | |||
| 364 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 365 | ScalarU32 value) { | ||
| 366 | NotImplemented(); | ||
| 367 | } | ||
| 368 | |||
| 369 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 370 | ScalarU32 value) { | ||
| 371 | NotImplemented(); | ||
| 372 | } | ||
| 373 | |||
| 374 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, | ||
| 375 | const IR::Value& offset, ScalarU32 value) { | ||
| 376 | NotImplemented(); | ||
| 377 | } | ||
| 378 | |||
| 379 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 380 | Register value) { | ||
| 381 | NotImplemented(); | ||
| 382 | } | ||
| 383 | |||
| 384 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 385 | Register value) { | ||
| 386 | NotImplemented(); | ||
| 387 | } | ||
| 388 | |||
| 389 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 390 | Register value) { | ||
| 391 | NotImplemented(); | ||
| 392 | } | ||
| 393 | |||
| 394 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 395 | Register value) { | ||
| 396 | NotImplemented(); | ||
| 397 | } | ||
| 398 | |||
| 399 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 400 | Register value) { | ||
| 401 | NotImplemented(); | ||
| 402 | } | ||
| 403 | |||
| 404 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 405 | Register value) { | ||
| 406 | NotImplemented(); | ||
| 407 | } | ||
| 408 | |||
| 409 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 410 | Register value) { | ||
| 411 | NotImplemented(); | ||
| 412 | } | ||
| 413 | |||
| 414 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 415 | Register value) { | ||
| 416 | NotImplemented(); | ||
| 417 | } | ||
| 418 | |||
| 419 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, | ||
| 420 | const IR::Value& offset, Register value) { | ||
| 421 | NotImplemented(); | ||
| 422 | } | ||
| 423 | |||
| 424 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 425 | ScalarF32 value) { | ||
| 426 | NotImplemented(); | ||
| 427 | } | ||
| 428 | |||
| 429 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 430 | Register value) { | ||
| 431 | NotImplemented(); | ||
| 432 | } | ||
| 433 | |||
| 434 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 435 | Register value) { | ||
| 436 | NotImplemented(); | ||
| 437 | } | ||
| 438 | |||
| 439 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 440 | Register value) { | ||
| 441 | NotImplemented(); | ||
| 442 | } | ||
| 443 | |||
| 444 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 445 | Register value) { | ||
| 446 | NotImplemented(); | ||
| 447 | } | ||
| 448 | |||
| 449 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 450 | Register value) { | ||
| 451 | NotImplemented(); | ||
| 452 | } | ||
| 453 | |||
| 454 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | ||
| 455 | Register value) { | ||
| 456 | NotImplemented(); | ||
| 457 | } | ||
| 458 | |||
| 459 | void EmitGlobalAtomicIAdd32(EmitContext& ctx) { | ||
| 460 | NotImplemented(); | ||
| 461 | } | ||
| 462 | |||
| 463 | void EmitGlobalAtomicSMin32(EmitContext& ctx) { | ||
| 464 | NotImplemented(); | ||
| 465 | } | ||
| 466 | |||
| 467 | void EmitGlobalAtomicUMin32(EmitContext& ctx) { | ||
| 468 | NotImplemented(); | ||
| 469 | } | ||
| 470 | |||
| 471 | void EmitGlobalAtomicSMax32(EmitContext& ctx) { | ||
| 472 | NotImplemented(); | ||
| 473 | } | ||
| 474 | |||
| 475 | void EmitGlobalAtomicUMax32(EmitContext& ctx) { | ||
| 476 | NotImplemented(); | ||
| 477 | } | ||
| 478 | |||
| 479 | void EmitGlobalAtomicInc32(EmitContext& ctx) { | ||
| 480 | NotImplemented(); | ||
| 481 | } | ||
| 482 | |||
| 483 | void EmitGlobalAtomicDec32(EmitContext& ctx) { | ||
| 484 | NotImplemented(); | ||
| 485 | } | ||
| 486 | |||
| 487 | void EmitGlobalAtomicAnd32(EmitContext& ctx) { | ||
| 488 | NotImplemented(); | ||
| 489 | } | ||
| 490 | |||
| 491 | void EmitGlobalAtomicOr32(EmitContext& ctx) { | ||
| 492 | NotImplemented(); | ||
| 493 | } | ||
| 494 | |||
| 495 | void EmitGlobalAtomicXor32(EmitContext& ctx) { | ||
| 496 | NotImplemented(); | ||
| 497 | } | ||
| 498 | |||
| 499 | void EmitGlobalAtomicExchange32(EmitContext& ctx) { | ||
| 500 | NotImplemented(); | ||
| 501 | } | ||
| 502 | |||
| 503 | void EmitGlobalAtomicIAdd64(EmitContext& ctx) { | ||
| 504 | NotImplemented(); | ||
| 505 | } | ||
| 506 | |||
| 507 | void EmitGlobalAtomicSMin64(EmitContext& ctx) { | ||
| 508 | NotImplemented(); | ||
| 509 | } | ||
| 510 | |||
| 511 | void EmitGlobalAtomicUMin64(EmitContext& ctx) { | ||
| 512 | NotImplemented(); | ||
| 513 | } | ||
| 514 | |||
| 515 | void EmitGlobalAtomicSMax64(EmitContext& ctx) { | ||
| 516 | NotImplemented(); | ||
| 517 | } | ||
| 518 | |||
| 519 | void EmitGlobalAtomicUMax64(EmitContext& ctx) { | ||
| 520 | NotImplemented(); | ||
| 521 | } | ||
| 522 | |||
| 523 | void EmitGlobalAtomicInc64(EmitContext& ctx) { | ||
| 524 | NotImplemented(); | ||
| 525 | } | ||
| 526 | |||
| 527 | void EmitGlobalAtomicDec64(EmitContext& ctx) { | ||
| 528 | NotImplemented(); | ||
| 529 | } | ||
| 530 | |||
| 531 | void EmitGlobalAtomicAnd64(EmitContext& ctx) { | ||
| 532 | NotImplemented(); | ||
| 533 | } | ||
| 534 | |||
| 535 | void EmitGlobalAtomicOr64(EmitContext& ctx) { | ||
| 536 | NotImplemented(); | ||
| 537 | } | ||
| 538 | |||
| 539 | void EmitGlobalAtomicXor64(EmitContext& ctx) { | ||
| 540 | NotImplemented(); | ||
| 541 | } | ||
| 542 | |||
| 543 | void EmitGlobalAtomicExchange64(EmitContext& ctx) { | ||
| 544 | NotImplemented(); | ||
| 545 | } | ||
| 546 | |||
| 547 | void EmitGlobalAtomicAddF32(EmitContext& ctx) { | ||
| 548 | NotImplemented(); | ||
| 549 | } | ||
| 550 | |||
| 551 | void EmitGlobalAtomicAddF16x2(EmitContext& ctx) { | ||
| 552 | NotImplemented(); | ||
| 553 | } | ||
| 554 | |||
| 555 | void EmitGlobalAtomicAddF32x2(EmitContext& ctx) { | ||
| 556 | NotImplemented(); | ||
| 557 | } | ||
| 558 | |||
| 559 | void EmitGlobalAtomicMinF16x2(EmitContext& ctx) { | ||
| 560 | NotImplemented(); | ||
| 561 | } | ||
| 562 | |||
| 563 | void EmitGlobalAtomicMinF32x2(EmitContext& ctx) { | ||
| 564 | NotImplemented(); | ||
| 565 | } | ||
| 566 | |||
| 567 | void EmitGlobalAtomicMaxF16x2(EmitContext& ctx) { | ||
| 568 | NotImplemented(); | ||
| 569 | } | ||
| 570 | |||
| 571 | void EmitGlobalAtomicMaxF32x2(EmitContext& ctx) { | ||
| 572 | NotImplemented(); | ||
| 573 | } | ||
| 574 | |||
| 575 | void EmitLogicalOr(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { | 324 | void EmitLogicalOr(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 576 | ctx.Add("OR.S {},{},{};", inst, a, b); | 325 | ctx.Add("OR.S {},{},{};", inst, a, b); |
| 577 | } | 326 | } |