summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-08 16:28:52 -0300
committerGravatar ameerj2021-07-22 21:51:30 -0400
commit6fd190d1ae4275a06ed2e488401e1d63912954be (patch)
treeece4681d18c7b0b5bcb6b540ea4a21b32c19b363 /src/shader_recompiler/backend/glasm
parentglasm: Changes to GLASM register allocator and emit context (diff)
downloadyuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.gz
yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.xz
yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.zip
glasm: Implement basic GLASM instructions
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_context.cpp21
-rw-r--r--src/shader_recompiler/backend/glasm/emit_context.h5
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm.cpp66
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp125
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp421
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_instructions.h177
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp228
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp178
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp786
9 files changed, 1167 insertions, 840 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp
index b4db4ff8f..9f839f3bf 100644
--- a/src/shader_recompiler/backend/glasm/emit_context.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_context.cpp
@@ -3,9 +3,28 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "shader_recompiler/backend/glasm/emit_context.h" 5#include "shader_recompiler/backend/glasm/emit_context.h"
6#include "shader_recompiler/frontend/ir/program.h"
6 7
7namespace Shader::Backend::GLASM { 8namespace Shader::Backend::GLASM {
8 9
9EmitContext::EmitContext() = default; 10EmitContext::EmitContext(IR::Program& program) {
11 // FIXME: Temporary partial implementation
12 u32 cbuf_index{};
13 for (const auto& desc : program.info.constant_buffer_descriptors) {
14 if (desc.count != 1) {
15 throw NotImplementedException("Constant buffer descriptor array");
16 }
17 Add("CBUFFER c{}[]={{program.buffer[{}]}};", desc.index, cbuf_index);
18 ++cbuf_index;
19 }
20 for (const auto& desc : program.info.storage_buffers_descriptors) {
21 if (desc.count != 1) {
22 throw NotImplementedException("Storage buffer descriptor array");
23 }
24 }
25 if (const size_t num = program.info.storage_buffers_descriptors.size(); num > 0) {
26 Add("PARAM c[{}]={{program.local[0..{}]}};", num, num - 1);
27 }
28}
10 29
11} // namespace Shader::Backend::GLASM 30} // namespace Shader::Backend::GLASM
diff --git a/src/shader_recompiler/backend/glasm/emit_context.h b/src/shader_recompiler/backend/glasm/emit_context.h
index cf66619de..4f98a9816 100644
--- a/src/shader_recompiler/backend/glasm/emit_context.h
+++ b/src/shader_recompiler/backend/glasm/emit_context.h
@@ -13,13 +13,14 @@
13 13
14namespace Shader::IR { 14namespace Shader::IR {
15class Inst; 15class Inst;
16} 16struct Program;
17} // namespace Shader::IR
17 18
18namespace Shader::Backend::GLASM { 19namespace Shader::Backend::GLASM {
19 20
20class EmitContext { 21class EmitContext {
21public: 22public:
22 explicit EmitContext(); 23 explicit EmitContext(IR::Program& program);
23 24
24 template <typename... Args> 25 template <typename... Args>
25 void Add(const char* fmt, IR::Inst& inst, Args&&... args) { 26 void Add(const char* fmt, IR::Inst& inst, Args&&... args) {
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
index 59d7c0f96..65600f58c 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
@@ -50,7 +50,7 @@ template <auto func, bool is_first_arg_inst, size_t... I>
50void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { 50void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) {
51 using Traits = FuncTraits<decltype(func)>; 51 using Traits = FuncTraits<decltype(func)>;
52 if constexpr (is_first_arg_inst) { 52 if constexpr (is_first_arg_inst) {
53 func(ctx, inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); 53 func(ctx, *inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
54 } else { 54 } else {
55 func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); 55 func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...);
56 } 56 }
@@ -64,7 +64,7 @@ void Invoke(EmitContext& ctx, IR::Inst* inst) {
64 Invoke<func, false>(ctx, inst, std::make_index_sequence<0>{}); 64 Invoke<func, false>(ctx, inst, std::make_index_sequence<0>{});
65 } else { 65 } else {
66 using FirstArgType = typename Traits::template ArgType<1>; 66 using FirstArgType = typename Traits::template ArgType<1>;
67 static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst*>; 67 static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst&>;
68 using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>; 68 using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>;
69 Invoke<func, is_first_arg_inst>(ctx, inst, Indices{}); 69 Invoke<func, is_first_arg_inst>(ctx, inst, Indices{});
70 } 70 }
@@ -80,16 +80,76 @@ void EmitInst(EmitContext& ctx, IR::Inst* inst) {
80 } 80 }
81 throw LogicError("Invalid opcode {}", inst->GetOpcode()); 81 throw LogicError("Invalid opcode {}", inst->GetOpcode());
82} 82}
83
84void Identity(IR::Inst& inst, const IR::Value& value) {
85 if (value.IsImmediate()) {
86 return;
87 }
88 IR::Inst* const value_inst{value.InstRecursive()};
89 if (inst.GetOpcode() == IR::Opcode::Identity) {
90 value_inst->DestructiveAddUsage(inst.UseCount());
91 value_inst->DestructiveRemoveUsage();
92 }
93 inst.SetDefinition(value_inst->Definition<Id>());
94}
83} // Anonymous namespace 95} // Anonymous namespace
84 96
85std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { 97std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) {
86 EmitContext ctx; 98 EmitContext ctx{program};
87 for (IR::Block* const block : program.blocks) { 99 for (IR::Block* const block : program.blocks) {
88 for (IR::Inst& inst : block->Instructions()) { 100 for (IR::Inst& inst : block->Instructions()) {
89 EmitInst(ctx, &inst); 101 EmitInst(ctx, &inst);
90 } 102 }
91 } 103 }
104 std::string header = "!!NVcp5.0\n"
105 "OPTION NV_internal;";
106 switch (program.stage) {
107 case Stage::Compute:
108 header += fmt::format("GROUP_SIZE {} {} {};", program.workgroup_size[0],
109 program.workgroup_size[1], program.workgroup_size[2]);
110 break;
111 default:
112 break;
113 }
114 header += "TEMP ";
115 for (size_t index = 0; index < ctx.reg_alloc.NumUsedRegisters(); ++index) {
116 header += fmt::format("R{},", index);
117 }
118 header += "RC;";
119 if (!program.info.storage_buffers_descriptors.empty()) {
120 header += "LONG TEMP LC;";
121 }
122 ctx.code.insert(0, header);
123 ctx.code += "END";
92 return ctx.code; 124 return ctx.code;
93} 125}
94 126
127void EmitIdentity(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
128 Identity(inst, value);
129}
130
131void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
132 Identity(inst, value);
133}
134
135void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
136 Identity(inst, value);
137}
138
139void EmitBitCastU64F64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
140 Identity(inst, value);
141}
142
143void EmitBitCastF16U16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
144 Identity(inst, value);
145}
146
147void EmitBitCastF32U32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
148 Identity(inst, value);
149}
150
151void EmitBitCastF64U64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
152 Identity(inst, value);
153}
154
95} // namespace Shader::Backend::GLASM 155} // namespace Shader::Backend::GLASM
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
index e69de29bb..72733d1cf 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
@@ -0,0 +1,125 @@
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
11namespace Shader::Backend::GLASM {
12namespace {
13void GetCbuf(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, const IR::Value& offset,
14 std::string_view size) {
15 if (!binding.IsImmediate()) {
16 throw NotImplementedException("Indirect constant buffer loading");
17 }
18 const std::string ret{ctx.reg_alloc.Define(inst)};
19 ctx.Add("LDC.{} {},c{}[{}];", size, ret, binding.U32(), ctx.reg_alloc.Consume(offset));
20}
21} // Anonymous namespace
22
23void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
24 const IR::Value& offset) {
25 GetCbuf(ctx, inst, binding, offset, "U8");
26}
27
28void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
29 const IR::Value& offset) {
30 GetCbuf(ctx, inst, binding, offset, "S8");
31}
32
33void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
34 const IR::Value& offset) {
35 GetCbuf(ctx, inst, binding, offset, "U16");
36}
37
38void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
39 const IR::Value& offset) {
40 GetCbuf(ctx, inst, binding, offset, "S16");
41}
42
43void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
44 const IR::Value& offset) {
45 GetCbuf(ctx, inst, binding, offset, "U32");
46}
47
48void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
49 const IR::Value& offset) {
50 GetCbuf(ctx, inst, binding, offset, "F32");
51}
52
53void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
54 const IR::Value& offset) {
55 GetCbuf(ctx, inst, binding, offset, "U32X2");
56}
57
58void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
59 [[maybe_unused]] std::string_view vertex) {
60 if (IR::IsGeneric(attr)) {
61 const u32 index{IR::GenericAttributeIndex(attr)};
62 const u32 element{IR::GenericAttributeElement(attr)};
63 ctx.Add("MOV.F {},in_attr{}.{};", inst, index, "xyzw"[element]);
64 return;
65 }
66 throw NotImplementedException("Get attribute {}", attr);
67}
68
69void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
70 [[maybe_unused]] std::string_view vertex) {
71 const u32 element{static_cast<u32>(attr) % 4};
72 const char swizzle{"xyzw"[element]};
73 if (IR::IsGeneric(attr)) {
74 const u32 index{IR::GenericAttributeIndex(attr)};
75 ctx.Add("MOV.F out_attr{}.{},{};", index, swizzle, value);
76 return;
77 }
78 switch (attr) {
79 case IR::Attribute::PositionX:
80 case IR::Attribute::PositionY:
81 case IR::Attribute::PositionZ:
82 case IR::Attribute::PositionW:
83 ctx.Add("MOV.F result.position.{},{};", swizzle, value);
84 break;
85 default:
86 throw NotImplementedException("Set attribute {}", attr);
87 }
88}
89
90void EmitGetAttributeIndexed([[maybe_unused]] EmitContext& ctx,
91 [[maybe_unused]] std::string_view offset,
92 [[maybe_unused]] std::string_view vertex) {
93 throw NotImplementedException("GLASM instruction");
94}
95
96void EmitSetAttributeIndexed([[maybe_unused]] EmitContext& ctx,
97 [[maybe_unused]] std::string_view offset,
98 [[maybe_unused]] std::string_view value,
99 [[maybe_unused]] std::string_view vertex) {
100 throw NotImplementedException("GLASM instruction");
101}
102
103void EmitGetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch patch) {
104 throw NotImplementedException("GLASM instruction");
105}
106
107void EmitSetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch patch,
108 [[maybe_unused]] std::string_view value) {
109 throw NotImplementedException("GLASM instruction");
110}
111
112void EmitSetFragColor([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] u32 index,
113 [[maybe_unused]] u32 component, [[maybe_unused]] std::string_view value) {
114 throw NotImplementedException("GLASM instruction");
115}
116
117void EmitSetSampleMask([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
118 throw NotImplementedException("GLASM instruction");
119}
120
121void EmitSetFragDepth([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
122 throw NotImplementedException("GLASM instruction");
123}
124
125} // namespace Shader::Backend::GLASM
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
index e69de29bb..db9dda261 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
@@ -0,0 +1,421 @@
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
11namespace Shader::Backend::GLASM {
12
13void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
14 throw NotImplementedException("GLASM instruction");
15}
16
17void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
18 ctx.Add("MOV.F {},|{}|;", inst, value);
19}
20
21void EmitFPAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
22 throw NotImplementedException("GLASM instruction");
23}
24
25void EmitFPAdd16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
26 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
27 throw NotImplementedException("GLASM instruction");
28}
29
30void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
31 ctx.Add("ADD.F {},{},{};", inst, a, b);
32}
33
34void EmitFPAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
35 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
36 throw NotImplementedException("GLASM instruction");
37}
38
39void EmitFPFma16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
40 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b,
41 [[maybe_unused]] std::string_view c) {
42 throw NotImplementedException("GLASM instruction");
43}
44
45void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b,
46 std::string_view c) {
47 ctx.Add("MAD.F {},{},{},{};", inst, a, b, c);
48}
49
50void EmitFPFma64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
51 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b,
52 [[maybe_unused]] std::string_view c) {
53 throw NotImplementedException("GLASM instruction");
54}
55
56void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
57 [[maybe_unused]] std::string_view b) {
58 throw NotImplementedException("GLASM instruction");
59}
60
61void EmitFPMax64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
62 [[maybe_unused]] std::string_view b) {
63 throw NotImplementedException("GLASM instruction");
64}
65
66void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
67 [[maybe_unused]] std::string_view b) {
68 throw NotImplementedException("GLASM instruction");
69}
70
71void EmitFPMin64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
72 [[maybe_unused]] std::string_view b) {
73 throw NotImplementedException("GLASM instruction");
74}
75
76void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
77 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
78 throw NotImplementedException("GLASM instruction");
79}
80
81void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
82 ctx.Add("MUL.F {},{},{};", inst, a, b);
83}
84
85void EmitFPMul64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
86 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
87 throw NotImplementedException("GLASM instruction");
88}
89
90void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
91 throw NotImplementedException("GLASM instruction");
92}
93
94void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
95 if (value[0] == '-') {
96 // Guard against negating a negative immediate
97 ctx.Add("MOV.F {},{};", inst, value.substr(1));
98 } else {
99 ctx.Add("MOV.F {},-{};", inst, value);
100 }
101}
102
103void EmitFPNeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
104 throw NotImplementedException("GLASM instruction");
105}
106
107void EmitFPSin([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
108 throw NotImplementedException("GLASM instruction");
109}
110
111void EmitFPCos([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
112 throw NotImplementedException("GLASM instruction");
113}
114
115void EmitFPExp2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
116 throw NotImplementedException("GLASM instruction");
117}
118
119void EmitFPLog2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
120 throw NotImplementedException("GLASM instruction");
121}
122
123void EmitFPRecip32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
124 throw NotImplementedException("GLASM instruction");
125}
126
127void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
128 throw NotImplementedException("GLASM instruction");
129}
130
131void EmitFPRecipSqrt32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
132 throw NotImplementedException("GLASM instruction");
133}
134
135void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
136 throw NotImplementedException("GLASM instruction");
137}
138
139void EmitFPSqrt([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
140 throw NotImplementedException("GLASM instruction");
141}
142
143void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
144 throw NotImplementedException("GLASM instruction");
145}
146
147void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
148 ctx.Add("MOV.F.SAT {},{};", inst, value);
149}
150
151void EmitFPSaturate64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
152 throw NotImplementedException("GLASM instruction");
153}
154
155void EmitFPClamp16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value,
156 [[maybe_unused]] std::string_view min_value,
157 [[maybe_unused]] std::string_view max_value) {
158 throw NotImplementedException("GLASM instruction");
159}
160
161void EmitFPClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value,
162 [[maybe_unused]] std::string_view min_value,
163 [[maybe_unused]] std::string_view max_value) {
164 throw NotImplementedException("GLASM instruction");
165}
166
167void EmitFPClamp64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value,
168 [[maybe_unused]] std::string_view min_value,
169 [[maybe_unused]] std::string_view max_value) {
170 throw NotImplementedException("GLASM instruction");
171}
172
173void EmitFPRoundEven16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
174 throw NotImplementedException("GLASM instruction");
175}
176
177void EmitFPRoundEven32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
178 throw NotImplementedException("GLASM instruction");
179}
180
181void EmitFPRoundEven64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
182 throw NotImplementedException("GLASM instruction");
183}
184
185void EmitFPFloor16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
186 throw NotImplementedException("GLASM instruction");
187}
188
189void EmitFPFloor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
190 throw NotImplementedException("GLASM instruction");
191}
192
193void EmitFPFloor64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
194 throw NotImplementedException("GLASM instruction");
195}
196
197void EmitFPCeil16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
198 throw NotImplementedException("GLASM instruction");
199}
200
201void EmitFPCeil32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
202 throw NotImplementedException("GLASM instruction");
203}
204
205void EmitFPCeil64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
206 throw NotImplementedException("GLASM instruction");
207}
208
209void EmitFPTrunc16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
210 throw NotImplementedException("GLASM instruction");
211}
212
213void EmitFPTrunc32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
214 throw NotImplementedException("GLASM instruction");
215}
216
217void EmitFPTrunc64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
218 throw NotImplementedException("GLASM instruction");
219}
220
221void EmitFPOrdEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
222 [[maybe_unused]] std::string_view rhs) {
223 throw NotImplementedException("GLASM instruction");
224}
225
226void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
227 std::string_view rhs) {
228 const std::string ret{ctx.reg_alloc.Define(inst)};
229 ctx.Add("SEQ.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret);
230}
231
232void EmitFPOrdEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
233 [[maybe_unused]] std::string_view rhs) {
234 throw NotImplementedException("GLASM instruction");
235}
236
237void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
238 [[maybe_unused]] std::string_view rhs) {
239 throw NotImplementedException("GLASM instruction");
240}
241
242void EmitFPUnordEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
243 [[maybe_unused]] std::string_view rhs) {
244 throw NotImplementedException("GLASM instruction");
245}
246
247void EmitFPUnordEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
248 [[maybe_unused]] std::string_view rhs) {
249 throw NotImplementedException("GLASM instruction");
250}
251
252void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
253 [[maybe_unused]] std::string_view rhs) {
254 throw NotImplementedException("GLASM instruction");
255}
256
257void EmitFPOrdNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
258 [[maybe_unused]] std::string_view rhs) {
259 throw NotImplementedException("GLASM instruction");
260}
261
262void EmitFPOrdNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
263 [[maybe_unused]] std::string_view rhs) {
264 throw NotImplementedException("GLASM instruction");
265}
266
267void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
268 [[maybe_unused]] std::string_view rhs) {
269 throw NotImplementedException("GLASM instruction");
270}
271
272void EmitFPUnordNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
273 [[maybe_unused]] std::string_view rhs) {
274 throw NotImplementedException("GLASM instruction");
275}
276
277void EmitFPUnordNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
278 [[maybe_unused]] std::string_view rhs) {
279 throw NotImplementedException("GLASM instruction");
280}
281
282void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
283 [[maybe_unused]] std::string_view rhs) {
284 throw NotImplementedException("GLASM instruction");
285}
286
287void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
288 std::string_view rhs) {
289 const std::string ret{ctx.reg_alloc.Define(inst)};
290 ctx.Add("SLT.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret);
291}
292
293void EmitFPOrdLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
294 [[maybe_unused]] std::string_view rhs) {
295 throw NotImplementedException("GLASM instruction");
296}
297
298void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
299 [[maybe_unused]] std::string_view rhs) {
300 throw NotImplementedException("GLASM instruction");
301}
302
303void EmitFPUnordLessThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
304 [[maybe_unused]] std::string_view rhs) {
305 throw NotImplementedException("GLASM instruction");
306}
307
308void EmitFPUnordLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
309 [[maybe_unused]] std::string_view rhs) {
310 throw NotImplementedException("GLASM instruction");
311}
312
313void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx,
314 [[maybe_unused]] std::string_view lhs,
315 [[maybe_unused]] std::string_view rhs) {
316 throw NotImplementedException("GLASM instruction");
317}
318
319void EmitFPOrdGreaterThan32([[maybe_unused]] EmitContext& ctx,
320 [[maybe_unused]] std::string_view lhs,
321 [[maybe_unused]] std::string_view rhs) {
322 throw NotImplementedException("GLASM instruction");
323}
324
325void EmitFPOrdGreaterThan64([[maybe_unused]] EmitContext& ctx,
326 [[maybe_unused]] std::string_view lhs,
327 [[maybe_unused]] std::string_view rhs) {
328 throw NotImplementedException("GLASM instruction");
329}
330
331void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx,
332 [[maybe_unused]] std::string_view lhs,
333 [[maybe_unused]] std::string_view rhs) {
334 throw NotImplementedException("GLASM instruction");
335}
336
337void EmitFPUnordGreaterThan32([[maybe_unused]] EmitContext& ctx,
338 [[maybe_unused]] std::string_view lhs,
339 [[maybe_unused]] std::string_view rhs) {
340 throw NotImplementedException("GLASM instruction");
341}
342
343void EmitFPUnordGreaterThan64([[maybe_unused]] EmitContext& ctx,
344 [[maybe_unused]] std::string_view lhs,
345 [[maybe_unused]] std::string_view rhs) {
346 throw NotImplementedException("GLASM instruction");
347}
348
349void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx,
350 [[maybe_unused]] std::string_view lhs,
351 [[maybe_unused]] std::string_view rhs) {
352 throw NotImplementedException("GLASM instruction");
353}
354
355void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
356 std::string_view rhs) {
357 const std::string ret{ctx.reg_alloc.Define(inst)};
358 ctx.Add("SLE.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret);
359}
360
361void EmitFPOrdLessThanEqual64([[maybe_unused]] EmitContext& ctx,
362 [[maybe_unused]] std::string_view lhs,
363 [[maybe_unused]] std::string_view rhs) {
364 throw NotImplementedException("GLASM instruction");
365}
366
367void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx,
368 [[maybe_unused]] std::string_view lhs,
369 [[maybe_unused]] std::string_view rhs) {
370 throw NotImplementedException("GLASM instruction");
371}
372
373void EmitFPUnordLessThanEqual32([[maybe_unused]] EmitContext& ctx,
374 [[maybe_unused]] std::string_view lhs,
375 [[maybe_unused]] std::string_view rhs) {
376 throw NotImplementedException("GLASM instruction");
377}
378
379void EmitFPUnordLessThanEqual64([[maybe_unused]] EmitContext& ctx,
380 [[maybe_unused]] std::string_view lhs,
381 [[maybe_unused]] std::string_view rhs) {
382 throw NotImplementedException("GLASM instruction");
383}
384
385void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx,
386 [[maybe_unused]] std::string_view lhs,
387 [[maybe_unused]] std::string_view rhs) {
388 throw NotImplementedException("GLASM instruction");
389}
390
391void EmitFPOrdGreaterThanEqual32([[maybe_unused]] EmitContext& ctx,
392 [[maybe_unused]] std::string_view lhs,
393 [[maybe_unused]] std::string_view rhs) {
394 throw NotImplementedException("GLASM instruction");
395}
396
397void EmitFPOrdGreaterThanEqual64([[maybe_unused]] EmitContext& ctx,
398 [[maybe_unused]] std::string_view lhs,
399 [[maybe_unused]] std::string_view rhs) {
400 throw NotImplementedException("GLASM instruction");
401}
402
403void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx,
404 [[maybe_unused]] std::string_view lhs,
405 [[maybe_unused]] std::string_view rhs) {
406 throw NotImplementedException("GLASM instruction");
407}
408
409void EmitFPUnordGreaterThanEqual32([[maybe_unused]] EmitContext& ctx,
410 [[maybe_unused]] std::string_view lhs,
411 [[maybe_unused]] std::string_view rhs) {
412 throw NotImplementedException("GLASM instruction");
413}
414
415void EmitFPUnordGreaterThanEqual64([[maybe_unused]] EmitContext& ctx,
416 [[maybe_unused]] std::string_view lhs,
417 [[maybe_unused]] std::string_view rhs) {
418 throw NotImplementedException("GLASM instruction");
419}
420
421} // 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 21d6af914..30cc6c2eb 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h
@@ -20,9 +20,9 @@ namespace Shader::Backend::GLASM {
20class EmitContext; 20class EmitContext;
21 21
22// Microinstruction emitters 22// Microinstruction emitters
23void EmitPhi(EmitContext& ctx, IR::Inst* inst); 23void EmitPhi(EmitContext& ctx, IR::Inst& inst);
24void EmitVoid(EmitContext& ctx); 24void EmitVoid(EmitContext& ctx);
25void EmitIdentity(EmitContext& ctx, const IR::Value& value); 25void EmitIdentity(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
26void EmitBranch(EmitContext& ctx, std::string_view label); 26void EmitBranch(EmitContext& ctx, std::string_view label);
27void EmitBranchConditional(EmitContext& ctx, std::string_view condition, 27void EmitBranchConditional(EmitContext& ctx, std::string_view condition,
28 std::string_view true_label, std::string_view false_label); 28 std::string_view true_label, std::string_view false_label);
@@ -47,14 +47,22 @@ void EmitSetGotoVariable(EmitContext& ctx);
47void EmitGetGotoVariable(EmitContext& ctx); 47void EmitGetGotoVariable(EmitContext& ctx);
48void EmitSetIndirectBranchVariable(EmitContext& ctx); 48void EmitSetIndirectBranchVariable(EmitContext& ctx);
49void EmitGetIndirectBranchVariable(EmitContext& ctx); 49void EmitGetIndirectBranchVariable(EmitContext& ctx);
50void EmitGetCbufU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 50void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
51void EmitGetCbufS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 51 const IR::Value& offset);
52void EmitGetCbufU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 52void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
53void EmitGetCbufS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 53 const IR::Value& offset);
54void EmitGetCbufU32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 54void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
55void EmitGetCbufF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 55 const IR::Value& offset);
56void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 56void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
57void EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view vertex); 57 const IR::Value& offset);
58void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
59 const IR::Value& offset);
60void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
61 const IR::Value& offset);
62void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
63 const IR::Value& offset);
64void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
65 std::string_view vertex);
58void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value, 66void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
59 std::string_view vertex); 67 std::string_view vertex);
60void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex); 68void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex);
@@ -100,26 +108,33 @@ void EmitWriteGlobalS16(EmitContext& ctx);
100void EmitWriteGlobal32(EmitContext& ctx, std::string_view address, std::string_view value); 108void EmitWriteGlobal32(EmitContext& ctx, std::string_view address, std::string_view value);
101void EmitWriteGlobal64(EmitContext& ctx, std::string_view address, std::string_view value); 109void EmitWriteGlobal64(EmitContext& ctx, std::string_view address, std::string_view value);
102void EmitWriteGlobal128(EmitContext& ctx, std::string_view address, std::string_view value); 110void EmitWriteGlobal128(EmitContext& ctx, std::string_view address, std::string_view value);
103void EmitLoadStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 111void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
104void EmitLoadStorageS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 112 std::string_view offset);
105void EmitLoadStorageU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 113void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
106void EmitLoadStorageS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 114 std::string_view offset);
107void EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 115void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
108void EmitLoadStorage64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 116 std::string_view offset);
109void EmitLoadStorage128(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); 117void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
110void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 118 std::string_view offset);
119void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
120 std::string_view offset);
121void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
122 std::string_view offset);
123void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
124 std::string_view offset);
125void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
111 std::string_view value); 126 std::string_view value);
112void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 127void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
113 std::string_view value); 128 std::string_view value);
114void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 129void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
115 std::string_view value); 130 std::string_view value);
116void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 131void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
117 std::string_view value); 132 std::string_view value);
118void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 133void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
119 std::string_view value); 134 std::string_view value);
120void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 135void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
121 std::string_view value); 136 std::string_view value);
122void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, 137void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
123 std::string_view value); 138 std::string_view value);
124void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset); 139void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset);
125void EmitLoadSharedS8(EmitContext& ctx, std::string_view offset); 140void EmitLoadSharedS8(EmitContext& ctx, std::string_view offset);
@@ -203,12 +218,12 @@ void EmitSelectF32(EmitContext& ctx, std::string_view cond, std::string_view tru
203 std::string_view false_value); 218 std::string_view false_value);
204void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value, 219void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value,
205 std::string_view false_value); 220 std::string_view false_value);
206void EmitBitCastU16F16(EmitContext& ctx); 221void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
207void EmitBitCastU32F32(EmitContext& ctx, std::string_view value); 222void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
208void EmitBitCastU64F64(EmitContext& ctx); 223void EmitBitCastU64F64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
209void EmitBitCastF16U16(EmitContext& ctx); 224void EmitBitCastF16U16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
210void EmitBitCastF32U32(EmitContext& ctx, std::string_view value); 225void EmitBitCastF32U32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
211void EmitBitCastF64U64(EmitContext& ctx); 226void EmitBitCastF64U64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
212void EmitPackUint2x32(EmitContext& ctx, std::string_view value); 227void EmitPackUint2x32(EmitContext& ctx, std::string_view value);
213void EmitUnpackUint2x32(EmitContext& ctx, std::string_view value); 228void EmitUnpackUint2x32(EmitContext& ctx, std::string_view value);
214void EmitPackFloat2x16(EmitContext& ctx, std::string_view value); 229void EmitPackFloat2x16(EmitContext& ctx, std::string_view value);
@@ -224,26 +239,26 @@ void EmitGetOverflowFromOp(EmitContext& ctx);
224void EmitGetSparseFromOp(EmitContext& ctx); 239void EmitGetSparseFromOp(EmitContext& ctx);
225void EmitGetInBoundsFromOp(EmitContext& ctx); 240void EmitGetInBoundsFromOp(EmitContext& ctx);
226void EmitFPAbs16(EmitContext& ctx, std::string_view value); 241void EmitFPAbs16(EmitContext& ctx, std::string_view value);
227void EmitFPAbs32(EmitContext& ctx, std::string_view value); 242void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value);
228void EmitFPAbs64(EmitContext& ctx, std::string_view value); 243void EmitFPAbs64(EmitContext& ctx, std::string_view value);
229void EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 244void EmitFPAdd16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
230void EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 245void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
231void EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 246void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
232void EmitFPFma16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b, 247void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b,
233 std::string_view c); 248 std::string_view c);
234void EmitFPFma32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b, 249void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b,
235 std::string_view c); 250 std::string_view c);
236void EmitFPFma64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b, 251void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b,
237 std::string_view c); 252 std::string_view c);
238void EmitFPMax32(EmitContext& ctx, std::string_view a, std::string_view b); 253void EmitFPMax32(EmitContext& ctx, std::string_view a, std::string_view b);
239void EmitFPMax64(EmitContext& ctx, std::string_view a, std::string_view b); 254void EmitFPMax64(EmitContext& ctx, std::string_view a, std::string_view b);
240void EmitFPMin32(EmitContext& ctx, std::string_view a, std::string_view b); 255void EmitFPMin32(EmitContext& ctx, std::string_view a, std::string_view b);
241void EmitFPMin64(EmitContext& ctx, std::string_view a, std::string_view b); 256void EmitFPMin64(EmitContext& ctx, std::string_view a, std::string_view b);
242void EmitFPMul16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 257void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
243void EmitFPMul32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 258void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
244void EmitFPMul64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 259void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
245void EmitFPNeg16(EmitContext& ctx, std::string_view value); 260void EmitFPNeg16(EmitContext& ctx, std::string_view value);
246void EmitFPNeg32(EmitContext& ctx, std::string_view value); 261void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value);
247void EmitFPNeg64(EmitContext& ctx, std::string_view value); 262void EmitFPNeg64(EmitContext& ctx, std::string_view value);
248void EmitFPSin(EmitContext& ctx, std::string_view value); 263void EmitFPSin(EmitContext& ctx, std::string_view value);
249void EmitFPCos(EmitContext& ctx, std::string_view value); 264void EmitFPCos(EmitContext& ctx, std::string_view value);
@@ -255,7 +270,7 @@ void EmitFPRecipSqrt32(EmitContext& ctx, std::string_view value);
255void EmitFPRecipSqrt64(EmitContext& ctx, std::string_view value); 270void EmitFPRecipSqrt64(EmitContext& ctx, std::string_view value);
256void EmitFPSqrt(EmitContext& ctx, std::string_view value); 271void EmitFPSqrt(EmitContext& ctx, std::string_view value);
257void EmitFPSaturate16(EmitContext& ctx, std::string_view value); 272void EmitFPSaturate16(EmitContext& ctx, std::string_view value);
258void EmitFPSaturate32(EmitContext& ctx, std::string_view value); 273void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, std::string_view value);
259void EmitFPSaturate64(EmitContext& ctx, std::string_view value); 274void EmitFPSaturate64(EmitContext& ctx, std::string_view value);
260void EmitFPClamp16(EmitContext& ctx, std::string_view value, std::string_view min_value, 275void EmitFPClamp16(EmitContext& ctx, std::string_view value, std::string_view min_value,
261 std::string_view max_value); 276 std::string_view max_value);
@@ -276,7 +291,7 @@ void EmitFPTrunc16(EmitContext& ctx, std::string_view value);
276void EmitFPTrunc32(EmitContext& ctx, std::string_view value); 291void EmitFPTrunc32(EmitContext& ctx, std::string_view value);
277void EmitFPTrunc64(EmitContext& ctx, std::string_view value); 292void EmitFPTrunc64(EmitContext& ctx, std::string_view value);
278void EmitFPOrdEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 293void EmitFPOrdEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
279void EmitFPOrdEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 294void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs);
280void EmitFPOrdEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 295void EmitFPOrdEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
281void EmitFPUnordEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 296void EmitFPUnordEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
282void EmitFPUnordEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 297void EmitFPUnordEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
@@ -288,7 +303,8 @@ void EmitFPUnordNotEqual16(EmitContext& ctx, std::string_view lhs, std::string_v
288void EmitFPUnordNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 303void EmitFPUnordNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
289void EmitFPUnordNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 304void EmitFPUnordNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
290void EmitFPOrdLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 305void EmitFPOrdLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
291void EmitFPOrdLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 306void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
307 std::string_view rhs);
292void EmitFPOrdLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 308void EmitFPOrdLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
293void EmitFPUnordLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 309void EmitFPUnordLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
294void EmitFPUnordLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 310void EmitFPUnordLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
@@ -300,7 +316,8 @@ void EmitFPUnordGreaterThan16(EmitContext& ctx, std::string_view lhs, std::strin
300void EmitFPUnordGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 316void EmitFPUnordGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
301void EmitFPUnordGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 317void EmitFPUnordGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
302void EmitFPOrdLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 318void EmitFPOrdLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
303void EmitFPOrdLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 319void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
320 std::string_view rhs);
304void EmitFPOrdLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 321void EmitFPOrdLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
305void EmitFPUnordLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 322void EmitFPUnordLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
306void EmitFPUnordLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 323void EmitFPUnordLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
@@ -314,7 +331,7 @@ void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, std::string_view lhs, std::
314void EmitFPIsNan16(EmitContext& ctx, std::string_view value); 331void EmitFPIsNan16(EmitContext& ctx, std::string_view value);
315void EmitFPIsNan32(EmitContext& ctx, std::string_view value); 332void EmitFPIsNan32(EmitContext& ctx, std::string_view value);
316void EmitFPIsNan64(EmitContext& ctx, std::string_view value); 333void EmitFPIsNan64(EmitContext& ctx, std::string_view value);
317void EmitIAdd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 334void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
318void EmitIAdd64(EmitContext& ctx, std::string_view a, std::string_view b); 335void EmitIAdd64(EmitContext& ctx, std::string_view a, std::string_view b);
319void EmitISub32(EmitContext& ctx, std::string_view a, std::string_view b); 336void EmitISub32(EmitContext& ctx, std::string_view a, std::string_view b);
320void EmitISub64(EmitContext& ctx, std::string_view a, std::string_view b); 337void EmitISub64(EmitContext& ctx, std::string_view a, std::string_view b);
@@ -329,14 +346,14 @@ void EmitShiftRightLogical32(EmitContext& ctx, std::string_view base, std::strin
329void EmitShiftRightLogical64(EmitContext& ctx, std::string_view base, std::string_view shift); 346void EmitShiftRightLogical64(EmitContext& ctx, std::string_view base, std::string_view shift);
330void EmitShiftRightArithmetic32(EmitContext& ctx, std::string_view base, std::string_view shift); 347void EmitShiftRightArithmetic32(EmitContext& ctx, std::string_view base, std::string_view shift);
331void EmitShiftRightArithmetic64(EmitContext& ctx, std::string_view base, std::string_view shift); 348void EmitShiftRightArithmetic64(EmitContext& ctx, std::string_view base, std::string_view shift);
332void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 349void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
333void EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 350void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
334void EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b); 351void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b);
335void EmitBitFieldInsert(EmitContext& ctx, std::string_view base, std::string_view insert, 352void EmitBitFieldInsert(EmitContext& ctx, std::string_view base, std::string_view insert,
336 std::string_view offset, std::string_view count); 353 std::string_view offset, std::string_view count);
337void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst* inst, std::string_view base, 354void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base,
338 std::string_view offset, std::string_view count); 355 std::string_view offset, std::string_view count);
339void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst* inst, std::string_view base, 356void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base,
340 std::string_view offset, std::string_view count); 357 std::string_view offset, std::string_view count);
341void EmitBitReverse32(EmitContext& ctx, std::string_view value); 358void EmitBitReverse32(EmitContext& ctx, std::string_view value);
342void EmitBitCount32(EmitContext& ctx, std::string_view value); 359void EmitBitCount32(EmitContext& ctx, std::string_view value);
@@ -347,9 +364,9 @@ void EmitSMin32(EmitContext& ctx, std::string_view a, std::string_view b);
347void EmitUMin32(EmitContext& ctx, std::string_view a, std::string_view b); 364void EmitUMin32(EmitContext& ctx, std::string_view a, std::string_view b);
348void EmitSMax32(EmitContext& ctx, std::string_view a, std::string_view b); 365void EmitSMax32(EmitContext& ctx, std::string_view a, std::string_view b);
349void EmitUMax32(EmitContext& ctx, std::string_view a, std::string_view b); 366void EmitUMax32(EmitContext& ctx, std::string_view a, std::string_view b);
350void EmitSClamp32(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view min, 367void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min,
351 std::string_view max); 368 std::string_view max);
352void EmitUClamp32(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view min, 369void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min,
353 std::string_view max); 370 std::string_view max);
354void EmitSLessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 371void EmitSLessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
355void EmitULessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs); 372void EmitULessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs);
@@ -544,36 +561,36 @@ void EmitBoundImageQueryLod(EmitContext&);
544void EmitBoundImageGradient(EmitContext&); 561void EmitBoundImageGradient(EmitContext&);
545void EmitBoundImageRead(EmitContext&); 562void EmitBoundImageRead(EmitContext&);
546void EmitBoundImageWrite(EmitContext&); 563void EmitBoundImageWrite(EmitContext&);
547void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 564void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
548 std::string_view coords, std::string_view bias_lc, 565 std::string_view coords, std::string_view bias_lc,
549 const IR::Value& offset); 566 const IR::Value& offset);
550void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 567void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
551 std::string_view coords, std::string_view lod_lc, 568 std::string_view coords, std::string_view lod_lc,
552 const IR::Value& offset); 569 const IR::Value& offset);
553void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 570void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
554 std::string_view coords, std::string_view dref, 571 std::string_view coords, std::string_view dref,
555 std::string_view bias_lc, const IR::Value& offset); 572 std::string_view bias_lc, const IR::Value& offset);
556void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 573void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
557 std::string_view coords, std::string_view dref, 574 std::string_view coords, std::string_view dref,
558 std::string_view lod_lc, const IR::Value& offset); 575 std::string_view lod_lc, const IR::Value& offset);
559void EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 576void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
560 std::string_view coords, const IR::Value& offset, const IR::Value& offset2); 577 std::string_view coords, const IR::Value& offset, const IR::Value& offset2);
561void EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 578void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
562 std::string_view coords, const IR::Value& offset, const IR::Value& offset2, 579 std::string_view coords, const IR::Value& offset, const IR::Value& offset2,
563 std::string_view dref); 580 std::string_view dref);
564void EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 581void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
565 std::string_view coords, std::string_view offset, std::string_view lod, 582 std::string_view coords, std::string_view offset, std::string_view lod,
566 std::string_view ms); 583 std::string_view ms);
567void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 584void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
568 std::string_view lod); 585 std::string_view lod);
569void EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 586void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
570 std::string_view coords); 587 std::string_view coords);
571void EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 588void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
572 std::string_view coords, std::string_view derivates, std::string_view offset, 589 std::string_view coords, std::string_view derivates, std::string_view offset,
573 std::string_view lod_clamp); 590 std::string_view lod_clamp);
574void EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 591void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
575 std::string_view coords); 592 std::string_view coords);
576void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 593void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
577 std::string_view coords, std::string_view color); 594 std::string_view coords, std::string_view color);
578void EmitBindlessImageAtomicIAdd32(EmitContext&); 595void EmitBindlessImageAtomicIAdd32(EmitContext&);
579void EmitBindlessImageAtomicSMin32(EmitContext&); 596void EmitBindlessImageAtomicSMin32(EmitContext&);
@@ -597,27 +614,27 @@ void EmitBoundImageAtomicAnd32(EmitContext&);
597void EmitBoundImageAtomicOr32(EmitContext&); 614void EmitBoundImageAtomicOr32(EmitContext&);
598void EmitBoundImageAtomicXor32(EmitContext&); 615void EmitBoundImageAtomicXor32(EmitContext&);
599void EmitBoundImageAtomicExchange32(EmitContext&); 616void EmitBoundImageAtomicExchange32(EmitContext&);
600void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 617void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
601 std::string_view coords, std::string_view value); 618 std::string_view coords, std::string_view value);
602void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 619void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
603 std::string_view coords, std::string_view value); 620 std::string_view coords, std::string_view value);
604void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 621void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
605 std::string_view coords, std::string_view value); 622 std::string_view coords, std::string_view value);
606void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 623void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
607 std::string_view coords, std::string_view value); 624 std::string_view coords, std::string_view value);
608void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 625void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
609 std::string_view coords, std::string_view value); 626 std::string_view coords, std::string_view value);
610void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 627void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
611 std::string_view coords, std::string_view value); 628 std::string_view coords, std::string_view value);
612void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 629void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
613 std::string_view coords, std::string_view value); 630 std::string_view coords, std::string_view value);
614void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 631void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
615 std::string_view coords, std::string_view value); 632 std::string_view coords, std::string_view value);
616void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 633void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
617 std::string_view coords, std::string_view value); 634 std::string_view coords, std::string_view value);
618void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 635void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
619 std::string_view coords, std::string_view value); 636 std::string_view coords, std::string_view value);
620void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 637void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
621 std::string_view coords, std::string_view value); 638 std::string_view coords, std::string_view value);
622void EmitLaneId(EmitContext& ctx); 639void EmitLaneId(EmitContext& ctx);
623void EmitVoteAll(EmitContext& ctx, std::string_view pred); 640void EmitVoteAll(EmitContext& ctx, std::string_view pred);
@@ -629,15 +646,15 @@ void EmitSubgroupLtMask(EmitContext& ctx);
629void EmitSubgroupLeMask(EmitContext& ctx); 646void EmitSubgroupLeMask(EmitContext& ctx);
630void EmitSubgroupGtMask(EmitContext& ctx); 647void EmitSubgroupGtMask(EmitContext& ctx);
631void EmitSubgroupGeMask(EmitContext& ctx); 648void EmitSubgroupGeMask(EmitContext& ctx);
632void EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, std::string_view value, 649void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value,
633 std::string_view index, std::string_view clamp, 650 std::string_view index, std::string_view clamp,
634 std::string_view segmentation_mask); 651 std::string_view segmentation_mask);
635void EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view index, 652void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view index,
636 std::string_view clamp, std::string_view segmentation_mask); 653 std::string_view clamp, std::string_view segmentation_mask);
637void EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, std::string_view value, 654void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string_view value,
638 std::string_view index, std::string_view clamp, 655 std::string_view index, std::string_view clamp,
639 std::string_view segmentation_mask); 656 std::string_view segmentation_mask);
640void EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, std::string_view value, 657void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string_view value,
641 std::string_view index, std::string_view clamp, 658 std::string_view index, std::string_view clamp,
642 std::string_view segmentation_mask); 659 std::string_view segmentation_mask);
643void EmitFSwizzleAdd(EmitContext& ctx, std::string_view op_a, std::string_view op_b, 660void EmitFSwizzleAdd(EmitContext& ctx, std::string_view op_a, std::string_view op_b,
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
11namespace Shader::Backend::GLASM {
12
13void 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
18void 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
23void 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
28void 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
33void 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
38void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
39 throw NotImplementedException("GLASM instruction");
40}
41
42void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
43 throw NotImplementedException("GLASM instruction");
44}
45
46void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
47 throw NotImplementedException("GLASM instruction");
48}
49
50void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
51 throw NotImplementedException("GLASM instruction");
52}
53
54void 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
60void 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
66void 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
72void 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
78void 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
84void 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
90void 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
95void 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
100void 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
105void 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
112void 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
119void 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
126void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
127 throw NotImplementedException("GLASM instruction");
128}
129
130void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
131 throw NotImplementedException("GLASM instruction");
132}
133
134void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
135 throw NotImplementedException("GLASM instruction");
136}
137
138void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
139 throw NotImplementedException("GLASM instruction");
140}
141
142void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
143 throw NotImplementedException("GLASM instruction");
144}
145
146void 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
151void 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
156void 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
161void 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
166void 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
172void 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
178void 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
183void 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
188void 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
193void 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
198void 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
203void 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
208void 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
213void 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
218void 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
223void 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
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
index e69de29bb..9e38a1bdf 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
@@ -0,0 +1,178 @@
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/program.h"
10#include "shader_recompiler/frontend/ir/value.h"
11
12namespace Shader::Backend::GLASM {
13namespace {
14void StorageOp(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
15 std::string_view then_expr, std::string_view else_expr = {}) {
16 // Operate on bindless SSBO, call the expression with bounds checking
17 // address = c[binding].xy
18 // length = c[binding].z
19 const u32 sb_binding{binding.U32()};
20 ctx.Add("PK64.U LC,c[{}];" // pointer = address
21 "CVT.U64.U32 LC.z,{};" // offset = uint64_t(offset)
22 "ADD.U64 LC.x,LC.x,LC.z;" // pointer += offset
23 "SLT.U.CC RC.x,{},c[{}].z;", // cc = offset < length
24 sb_binding, offset, offset, sb_binding);
25 if (else_expr.empty()) {
26 ctx.Add("{}", then_expr);
27 } else {
28 ctx.Add("IF NE.x;{}ELSE;{}ENDIF;", then_expr, else_expr);
29 }
30}
31
32void Store(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
33 std::string_view value, std::string_view size) {
34 StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, value));
35}
36
37void Load(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, std::string_view offset,
38 std::string_view size) {
39 const std::string ret{ctx.reg_alloc.Define(inst)};
40 StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, ret),
41 fmt::format("MOV.U {},{{0,0,0,0}};", ret));
42}
43} // Anonymous namespace
44
45void EmitLoadGlobalU8([[maybe_unused]] EmitContext& ctx) {
46 throw NotImplementedException("GLASM instruction");
47}
48
49void EmitLoadGlobalS8([[maybe_unused]] EmitContext& ctx) {
50 throw NotImplementedException("GLASM instruction");
51}
52
53void EmitLoadGlobalU16([[maybe_unused]] EmitContext& ctx) {
54 throw NotImplementedException("GLASM instruction");
55}
56
57void EmitLoadGlobalS16([[maybe_unused]] EmitContext& ctx) {
58 throw NotImplementedException("GLASM instruction");
59}
60
61void EmitLoadGlobal32([[maybe_unused]] EmitContext& ctx,
62 [[maybe_unused]] std::string_view address) {
63 throw NotImplementedException("GLASM instruction");
64}
65
66void EmitLoadGlobal64([[maybe_unused]] EmitContext& ctx,
67 [[maybe_unused]] std::string_view address) {
68 throw NotImplementedException("GLASM instruction");
69}
70
71void EmitLoadGlobal128([[maybe_unused]] EmitContext& ctx,
72 [[maybe_unused]] std::string_view address) {
73 throw NotImplementedException("GLASM instruction");
74}
75
76void EmitWriteGlobalU8([[maybe_unused]] EmitContext& ctx) {
77 throw NotImplementedException("GLASM instruction");
78}
79
80void EmitWriteGlobalS8([[maybe_unused]] EmitContext& ctx) {
81 throw NotImplementedException("GLASM instruction");
82}
83
84void EmitWriteGlobalU16([[maybe_unused]] EmitContext& ctx) {
85 throw NotImplementedException("GLASM instruction");
86}
87
88void EmitWriteGlobalS16([[maybe_unused]] EmitContext& ctx) {
89 throw NotImplementedException("GLASM instruction");
90}
91
92void EmitWriteGlobal32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view address,
93 [[maybe_unused]] std::string_view value) {
94 throw NotImplementedException("GLASM instruction");
95}
96
97void EmitWriteGlobal64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view address,
98 [[maybe_unused]] std::string_view value) {
99 throw NotImplementedException("GLASM instruction");
100}
101
102void EmitWriteGlobal128([[maybe_unused]] EmitContext& ctx,
103 [[maybe_unused]] std::string_view address,
104 [[maybe_unused]] std::string_view value) {
105 throw NotImplementedException("GLASM instruction");
106}
107
108void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
109 std::string_view offset) {
110 Load(ctx, inst, binding, offset, "U8");
111}
112
113void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
114 std::string_view offset) {
115 Load(ctx, inst, binding, offset, "S8");
116}
117
118void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
119 std::string_view offset) {
120 Load(ctx, inst, binding, offset, "U16");
121}
122
123void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
124 std::string_view offset) {
125 Load(ctx, inst, binding, offset, "S16");
126}
127
128void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
129 std::string_view offset) {
130 Load(ctx, inst, binding, offset, "U32");
131}
132
133void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
134 std::string_view offset) {
135 Load(ctx, inst, binding, offset, "U32X2");
136}
137
138void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
139 std::string_view offset) {
140 Load(ctx, inst, binding, offset, "U32X4");
141}
142
143void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
144 std::string_view value) {
145 Store(ctx, binding, offset, value, "U8");
146}
147
148void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
149 std::string_view value) {
150 Store(ctx, binding, offset, value, "S8");
151}
152
153void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
154 std::string_view value) {
155 Store(ctx, binding, offset, value, "U16");
156}
157
158void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
159 std::string_view value) {
160 Store(ctx, binding, offset, value, "S16");
161}
162
163void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
164 std::string_view value) {
165 Store(ctx, binding, offset, value, "U32");
166}
167
168void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
169 std::string_view value) {
170 Store(ctx, binding, offset, value, "U32X2");
171}
172
173void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, std::string_view offset,
174 std::string_view value) {
175 Store(ctx, binding, offset, value, "U32X4");
176}
177
178} // namespace Shader::Backend::GLASM
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 e90224e15..1337f4ae8 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
@@ -15,11 +15,9 @@
15 15
16namespace Shader::Backend::GLASM { 16namespace Shader::Backend::GLASM {
17 17
18static void NotImplemented() { 18#define NotImplemented() throw NotImplementedException("GLASM instruction {}", __LINE__)
19 throw NotImplementedException("GLASM instruction");
20}
21 19
22void EmitPhi(EmitContext& ctx, IR::Inst* inst) { 20void EmitPhi(EmitContext& ctx, IR::Inst& inst) {
23 NotImplemented(); 21 NotImplemented();
24} 22}
25 23
@@ -27,10 +25,6 @@ void EmitVoid(EmitContext& ctx) {
27 NotImplemented(); 25 NotImplemented();
28} 26}
29 27
30void EmitIdentity(EmitContext& ctx, const IR::Value& value) {
31 NotImplemented();
32}
33
34void EmitBranch(EmitContext& ctx, std::string_view label) { 28void EmitBranch(EmitContext& ctx, std::string_view label) {
35 NotImplemented(); 29 NotImplemented();
36} 30}
@@ -50,7 +44,7 @@ void EmitSelectionMerge(EmitContext& ctx, std::string_view merge_label) {
50} 44}
51 45
52void EmitReturn(EmitContext& ctx) { 46void EmitReturn(EmitContext& ctx) {
53 NotImplemented(); 47 ctx.Add("RET;");
54} 48}
55 49
56void EmitJoin(EmitContext& ctx) { 50void EmitJoin(EmitContext& ctx) {
@@ -78,11 +72,11 @@ void EmitDeviceMemoryBarrier(EmitContext& ctx) {
78} 72}
79 73
80void EmitPrologue(EmitContext& ctx) { 74void EmitPrologue(EmitContext& ctx) {
81 NotImplemented(); 75 // TODO
82} 76}
83 77
84void EmitEpilogue(EmitContext& ctx) { 78void EmitEpilogue(EmitContext& ctx) {
85 NotImplemented(); 79 // TODO
86} 80}
87 81
88void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { 82void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
@@ -125,72 +119,6 @@ void EmitGetIndirectBranchVariable(EmitContext& ctx) {
125 NotImplemented(); 119 NotImplemented();
126} 120}
127 121
128void EmitGetCbufU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
129 NotImplemented();
130}
131
132void EmitGetCbufS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
133 NotImplemented();
134}
135
136void EmitGetCbufU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
137 NotImplemented();
138}
139
140void EmitGetCbufS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
141 NotImplemented();
142}
143
144void EmitGetCbufU32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
145 NotImplemented();
146}
147
148void EmitGetCbufF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
149 NotImplemented();
150}
151
152void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
153 NotImplemented();
154}
155
156void EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view vertex) {
157 NotImplemented();
158}
159
160void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value,
161 std::string_view vertex) {
162 NotImplemented();
163}
164
165void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex) {
166 NotImplemented();
167}
168
169void EmitSetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view value,
170 std::string_view vertex) {
171 NotImplemented();
172}
173
174void EmitGetPatch(EmitContext& ctx, IR::Patch patch) {
175 NotImplemented();
176}
177
178void EmitSetPatch(EmitContext& ctx, IR::Patch patch, std::string_view value) {
179 NotImplemented();
180}
181
182void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, std::string_view value) {
183 NotImplemented();
184}
185
186void EmitSetSampleMask(EmitContext& ctx, std::string_view value) {
187 NotImplemented();
188}
189
190void EmitSetFragDepth(EmitContext& ctx, std::string_view value) {
191 NotImplemented();
192}
193
194void EmitGetZFlag(EmitContext& ctx) { 122void EmitGetZFlag(EmitContext& ctx) {
195 NotImplemented(); 123 NotImplemented();
196} 124}
@@ -275,125 +203,6 @@ void EmitUndefU64(EmitContext& ctx) {
275 NotImplemented(); 203 NotImplemented();
276} 204}
277 205
278void EmitLoadGlobalU8(EmitContext& ctx) {
279 NotImplemented();
280}
281
282void EmitLoadGlobalS8(EmitContext& ctx) {
283 NotImplemented();
284}
285
286void EmitLoadGlobalU16(EmitContext& ctx) {
287 NotImplemented();
288}
289
290void EmitLoadGlobalS16(EmitContext& ctx) {
291 NotImplemented();
292}
293
294void EmitLoadGlobal32(EmitContext& ctx, std::string_view address) {
295 NotImplemented();
296}
297
298void EmitLoadGlobal64(EmitContext& ctx, std::string_view address) {
299 NotImplemented();
300}
301
302void EmitLoadGlobal128(EmitContext& ctx, std::string_view address) {
303 NotImplemented();
304}
305
306void EmitWriteGlobalU8(EmitContext& ctx) {
307 NotImplemented();
308}
309
310void EmitWriteGlobalS8(EmitContext& ctx) {
311 NotImplemented();
312}
313
314void EmitWriteGlobalU16(EmitContext& ctx) {
315 NotImplemented();
316}
317
318void EmitWriteGlobalS16(EmitContext& ctx) {
319 NotImplemented();
320}
321
322void EmitWriteGlobal32(EmitContext& ctx, std::string_view address, std::string_view value) {
323 NotImplemented();
324}
325
326void EmitWriteGlobal64(EmitContext& ctx, std::string_view address, std::string_view value) {
327 NotImplemented();
328}
329
330void EmitWriteGlobal128(EmitContext& ctx, std::string_view address, std::string_view value) {
331 NotImplemented();
332}
333
334void EmitLoadStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
335 NotImplemented();
336}
337
338void EmitLoadStorageS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
339 NotImplemented();
340}
341
342void EmitLoadStorageU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
343 NotImplemented();
344}
345
346void EmitLoadStorageS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
347 NotImplemented();
348}
349
350void EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
351 NotImplemented();
352}
353
354void EmitLoadStorage64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
355 NotImplemented();
356}
357
358void EmitLoadStorage128(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {
359 NotImplemented();
360}
361
362void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
363 std::string_view value) {
364 NotImplemented();
365}
366
367void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
368 std::string_view value) {
369 NotImplemented();
370}
371
372void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
373 std::string_view value) {
374 NotImplemented();
375}
376
377void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
378 std::string_view value) {
379 NotImplemented();
380}
381
382void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
383 std::string_view value) {
384 NotImplemented();
385}
386
387void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
388 std::string_view value) {
389 NotImplemented();
390}
391
392void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
393 std::string_view value) {
394 NotImplemented();
395}
396
397void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset) { 206void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset) {
398 NotImplemented(); 207 NotImplemented();
399} 208}
@@ -644,30 +453,6 @@ void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view tru
644 NotImplemented(); 453 NotImplemented();
645} 454}
646 455
647void EmitBitCastU16F16(EmitContext& ctx) {
648 NotImplemented();
649}
650
651void EmitBitCastU32F32(EmitContext& ctx, std::string_view value) {
652 NotImplemented();
653}
654
655void EmitBitCastU64F64(EmitContext& ctx) {
656 NotImplemented();
657}
658
659void EmitBitCastF16U16(EmitContext& ctx) {
660 NotImplemented();
661}
662
663void EmitBitCastF32U32(EmitContext& ctx, std::string_view value) {
664 NotImplemented();
665}
666
667void EmitBitCastF64U64(EmitContext& ctx) {
668 NotImplemented();
669}
670
671void EmitPackUint2x32(EmitContext& ctx, std::string_view value) { 456void EmitPackUint2x32(EmitContext& ctx, std::string_view value) {
672 NotImplemented(); 457 NotImplemented();
673} 458}
@@ -724,340 +509,6 @@ void EmitGetInBoundsFromOp(EmitContext& ctx) {
724 NotImplemented(); 509 NotImplemented();
725} 510}
726 511
727void EmitFPAbs16(EmitContext& ctx, std::string_view value) {
728 NotImplemented();
729}
730
731void EmitFPAbs32(EmitContext& ctx, std::string_view value) {
732 NotImplemented();
733}
734
735void EmitFPAbs64(EmitContext& ctx, std::string_view value) {
736 NotImplemented();
737}
738
739void EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
740 NotImplemented();
741}
742
743void EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
744 NotImplemented();
745}
746
747void EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
748 NotImplemented();
749}
750
751void EmitFPFma16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b,
752 std::string_view c) {
753 NotImplemented();
754}
755
756void EmitFPFma32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b,
757 std::string_view c) {
758 NotImplemented();
759}
760
761void EmitFPFma64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b,
762 std::string_view c) {
763 NotImplemented();
764}
765
766void EmitFPMax32(EmitContext& ctx, std::string_view a, std::string_view b) {
767 NotImplemented();
768}
769
770void EmitFPMax64(EmitContext& ctx, std::string_view a, std::string_view b) {
771 NotImplemented();
772}
773
774void EmitFPMin32(EmitContext& ctx, std::string_view a, std::string_view b) {
775 NotImplemented();
776}
777
778void EmitFPMin64(EmitContext& ctx, std::string_view a, std::string_view b) {
779 NotImplemented();
780}
781
782void EmitFPMul16(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
783 NotImplemented();
784}
785
786void EmitFPMul32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
787 NotImplemented();
788}
789
790void EmitFPMul64(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
791 NotImplemented();
792}
793
794void EmitFPNeg16(EmitContext& ctx, std::string_view value) {
795 NotImplemented();
796}
797
798void EmitFPNeg32(EmitContext& ctx, std::string_view value) {
799 NotImplemented();
800}
801
802void EmitFPNeg64(EmitContext& ctx, std::string_view value) {
803 NotImplemented();
804}
805
806void EmitFPSin(EmitContext& ctx, std::string_view value) {
807 NotImplemented();
808}
809
810void EmitFPCos(EmitContext& ctx, std::string_view value) {
811 NotImplemented();
812}
813
814void EmitFPExp2(EmitContext& ctx, std::string_view value) {
815 NotImplemented();
816}
817
818void EmitFPLog2(EmitContext& ctx, std::string_view value) {
819 NotImplemented();
820}
821
822void EmitFPRecip32(EmitContext& ctx, std::string_view value) {
823 NotImplemented();
824}
825
826void EmitFPRecip64(EmitContext& ctx, std::string_view value) {
827 NotImplemented();
828}
829
830void EmitFPRecipSqrt32(EmitContext& ctx, std::string_view value) {
831 NotImplemented();
832}
833
834void EmitFPRecipSqrt64(EmitContext& ctx, std::string_view value) {
835 NotImplemented();
836}
837
838void EmitFPSqrt(EmitContext& ctx, std::string_view value) {
839 NotImplemented();
840}
841
842void EmitFPSaturate16(EmitContext& ctx, std::string_view value) {
843 NotImplemented();
844}
845
846void EmitFPSaturate32(EmitContext& ctx, std::string_view value) {
847 NotImplemented();
848}
849
850void EmitFPSaturate64(EmitContext& ctx, std::string_view value) {
851 NotImplemented();
852}
853
854void EmitFPClamp16(EmitContext& ctx, std::string_view value, std::string_view min_value,
855 std::string_view max_value) {
856 NotImplemented();
857}
858
859void EmitFPClamp32(EmitContext& ctx, std::string_view value, std::string_view min_value,
860 std::string_view max_value) {
861 NotImplemented();
862}
863
864void EmitFPClamp64(EmitContext& ctx, std::string_view value, std::string_view min_value,
865 std::string_view max_value) {
866 NotImplemented();
867}
868
869void EmitFPRoundEven16(EmitContext& ctx, std::string_view value) {
870 NotImplemented();
871}
872
873void EmitFPRoundEven32(EmitContext& ctx, std::string_view value) {
874 NotImplemented();
875}
876
877void EmitFPRoundEven64(EmitContext& ctx, std::string_view value) {
878 NotImplemented();
879}
880
881void EmitFPFloor16(EmitContext& ctx, std::string_view value) {
882 NotImplemented();
883}
884
885void EmitFPFloor32(EmitContext& ctx, std::string_view value) {
886 NotImplemented();
887}
888
889void EmitFPFloor64(EmitContext& ctx, std::string_view value) {
890 NotImplemented();
891}
892
893void EmitFPCeil16(EmitContext& ctx, std::string_view value) {
894 NotImplemented();
895}
896
897void EmitFPCeil32(EmitContext& ctx, std::string_view value) {
898 NotImplemented();
899}
900
901void EmitFPCeil64(EmitContext& ctx, std::string_view value) {
902 NotImplemented();
903}
904
905void EmitFPTrunc16(EmitContext& ctx, std::string_view value) {
906 NotImplemented();
907}
908
909void EmitFPTrunc32(EmitContext& ctx, std::string_view value) {
910 NotImplemented();
911}
912
913void EmitFPTrunc64(EmitContext& ctx, std::string_view value) {
914 NotImplemented();
915}
916
917void EmitFPOrdEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
918 NotImplemented();
919}
920
921void EmitFPOrdEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
922 NotImplemented();
923}
924
925void EmitFPOrdEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
926 NotImplemented();
927}
928
929void EmitFPUnordEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
930 NotImplemented();
931}
932
933void EmitFPUnordEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
934 NotImplemented();
935}
936
937void EmitFPUnordEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
938 NotImplemented();
939}
940
941void EmitFPOrdNotEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
942 NotImplemented();
943}
944
945void EmitFPOrdNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
946 NotImplemented();
947}
948
949void EmitFPOrdNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
950 NotImplemented();
951}
952
953void EmitFPUnordNotEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
954 NotImplemented();
955}
956
957void EmitFPUnordNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
958 NotImplemented();
959}
960
961void EmitFPUnordNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
962 NotImplemented();
963}
964
965void EmitFPOrdLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
966 NotImplemented();
967}
968
969void EmitFPOrdLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
970 NotImplemented();
971}
972
973void EmitFPOrdLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
974 NotImplemented();
975}
976
977void EmitFPUnordLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
978 NotImplemented();
979}
980
981void EmitFPUnordLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
982 NotImplemented();
983}
984
985void EmitFPUnordLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
986 NotImplemented();
987}
988
989void EmitFPOrdGreaterThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
990 NotImplemented();
991}
992
993void EmitFPOrdGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
994 NotImplemented();
995}
996
997void EmitFPOrdGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
998 NotImplemented();
999}
1000
1001void EmitFPUnordGreaterThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1002 NotImplemented();
1003}
1004
1005void EmitFPUnordGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1006 NotImplemented();
1007}
1008
1009void EmitFPUnordGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1010 NotImplemented();
1011}
1012
1013void EmitFPOrdLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1014 NotImplemented();
1015}
1016
1017void EmitFPOrdLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1018 NotImplemented();
1019}
1020
1021void EmitFPOrdLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1022 NotImplemented();
1023}
1024
1025void EmitFPUnordLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1026 NotImplemented();
1027}
1028
1029void EmitFPUnordLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1030 NotImplemented();
1031}
1032
1033void EmitFPUnordLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1034 NotImplemented();
1035}
1036
1037void EmitFPOrdGreaterThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1038 NotImplemented();
1039}
1040
1041void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1042 NotImplemented();
1043}
1044
1045void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1046 NotImplemented();
1047}
1048
1049void EmitFPUnordGreaterThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1050 NotImplemented();
1051}
1052
1053void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1054 NotImplemented();
1055}
1056
1057void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1058 NotImplemented();
1059}
1060
1061void EmitFPIsNan16(EmitContext& ctx, std::string_view value) { 512void EmitFPIsNan16(EmitContext& ctx, std::string_view value) {
1062 NotImplemented(); 513 NotImplemented();
1063} 514}
@@ -1070,179 +521,6 @@ void EmitFPIsNan64(EmitContext& ctx, std::string_view value) {
1070 NotImplemented(); 521 NotImplemented();
1071} 522}
1072 523
1073void EmitIAdd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
1074 NotImplemented();
1075}
1076
1077void EmitIAdd64(EmitContext& ctx, std::string_view a, std::string_view b) {
1078 NotImplemented();
1079}
1080
1081void EmitISub32(EmitContext& ctx, std::string_view a, std::string_view b) {
1082 NotImplemented();
1083}
1084
1085void EmitISub64(EmitContext& ctx, std::string_view a, std::string_view b) {
1086 NotImplemented();
1087}
1088
1089void EmitIMul32(EmitContext& ctx, std::string_view a, std::string_view b) {
1090 NotImplemented();
1091}
1092
1093void EmitINeg32(EmitContext& ctx, std::string_view value) {
1094 NotImplemented();
1095}
1096
1097void EmitINeg64(EmitContext& ctx, std::string_view value) {
1098 NotImplemented();
1099}
1100
1101void EmitIAbs32(EmitContext& ctx, std::string_view value) {
1102 NotImplemented();
1103}
1104
1105void EmitIAbs64(EmitContext& ctx, std::string_view value) {
1106 NotImplemented();
1107}
1108
1109void EmitShiftLeftLogical32(EmitContext& ctx, std::string_view base, std::string_view shift) {
1110 NotImplemented();
1111}
1112
1113void EmitShiftLeftLogical64(EmitContext& ctx, std::string_view base, std::string_view shift) {
1114 NotImplemented();
1115}
1116
1117void EmitShiftRightLogical32(EmitContext& ctx, std::string_view base, std::string_view shift) {
1118 NotImplemented();
1119}
1120
1121void EmitShiftRightLogical64(EmitContext& ctx, std::string_view base, std::string_view shift) {
1122 NotImplemented();
1123}
1124
1125void EmitShiftRightArithmetic32(EmitContext& ctx, std::string_view base, std::string_view shift) {
1126 NotImplemented();
1127}
1128
1129void EmitShiftRightArithmetic64(EmitContext& ctx, std::string_view base, std::string_view shift) {
1130 NotImplemented();
1131}
1132
1133void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
1134 NotImplemented();
1135}
1136
1137void EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
1138 NotImplemented();
1139}
1140
1141void EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, std::string_view a, std::string_view b) {
1142 NotImplemented();
1143}
1144
1145void EmitBitFieldInsert(EmitContext& ctx, std::string_view base, std::string_view insert,
1146 std::string_view offset, std::string_view count) {
1147 NotImplemented();
1148}
1149
1150void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst* inst, std::string_view base,
1151 std::string_view offset, std::string_view count) {
1152 NotImplemented();
1153}
1154
1155void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst* inst, std::string_view base,
1156 std::string_view offset, std::string_view count) {
1157 NotImplemented();
1158}
1159
1160void EmitBitReverse32(EmitContext& ctx, std::string_view value) {
1161 NotImplemented();
1162}
1163
1164void EmitBitCount32(EmitContext& ctx, std::string_view value) {
1165 NotImplemented();
1166}
1167
1168void EmitBitwiseNot32(EmitContext& ctx, std::string_view value) {
1169 NotImplemented();
1170}
1171
1172void EmitFindSMsb32(EmitContext& ctx, std::string_view value) {
1173 NotImplemented();
1174}
1175
1176void EmitFindUMsb32(EmitContext& ctx, std::string_view value) {
1177 NotImplemented();
1178}
1179
1180void EmitSMin32(EmitContext& ctx, std::string_view a, std::string_view b) {
1181 NotImplemented();
1182}
1183
1184void EmitUMin32(EmitContext& ctx, std::string_view a, std::string_view b) {
1185 NotImplemented();
1186}
1187
1188void EmitSMax32(EmitContext& ctx, std::string_view a, std::string_view b) {
1189 NotImplemented();
1190}
1191
1192void EmitUMax32(EmitContext& ctx, std::string_view a, std::string_view b) {
1193 NotImplemented();
1194}
1195
1196void EmitSClamp32(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view min,
1197 std::string_view max) {
1198 NotImplemented();
1199}
1200
1201void EmitUClamp32(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view min,
1202 std::string_view max) {
1203 NotImplemented();
1204}
1205
1206void EmitSLessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1207 NotImplemented();
1208}
1209
1210void EmitULessThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1211 NotImplemented();
1212}
1213
1214void EmitIEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1215 NotImplemented();
1216}
1217
1218void EmitSLessThanEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1219 NotImplemented();
1220}
1221
1222void EmitULessThanEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1223 NotImplemented();
1224}
1225
1226void EmitSGreaterThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1227 NotImplemented();
1228}
1229
1230void EmitUGreaterThan(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1231 NotImplemented();
1232}
1233
1234void EmitINotEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1235 NotImplemented();
1236}
1237
1238void EmitSGreaterThanEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1239 NotImplemented();
1240}
1241
1242void EmitUGreaterThanEqual(EmitContext& ctx, std::string_view lhs, std::string_view rhs) {
1243 NotImplemented();
1244}
1245
1246void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string_view pointer_offset, 524void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string_view pointer_offset,
1247 std::string_view value) { 525 std::string_view value) {
1248 NotImplemented(); 526 NotImplemented();
@@ -1858,69 +1136,69 @@ void EmitBoundImageWrite(EmitContext&) {
1858 NotImplemented(); 1136 NotImplemented();
1859} 1137}
1860 1138
1861void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1139void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1862 std::string_view coords, std::string_view bias_lc, 1140 std::string_view coords, std::string_view bias_lc,
1863 const IR::Value& offset) { 1141 const IR::Value& offset) {
1864 NotImplemented(); 1142 NotImplemented();
1865} 1143}
1866 1144
1867void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1145void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1868 std::string_view coords, std::string_view lod_lc, 1146 std::string_view coords, std::string_view lod_lc,
1869 const IR::Value& offset) { 1147 const IR::Value& offset) {
1870 NotImplemented(); 1148 NotImplemented();
1871} 1149}
1872 1150
1873void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1151void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1874 std::string_view coords, std::string_view dref, 1152 std::string_view coords, std::string_view dref,
1875 std::string_view bias_lc, const IR::Value& offset) { 1153 std::string_view bias_lc, const IR::Value& offset) {
1876 NotImplemented(); 1154 NotImplemented();
1877} 1155}
1878 1156
1879void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1157void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1880 std::string_view coords, std::string_view dref, 1158 std::string_view coords, std::string_view dref,
1881 std::string_view lod_lc, const IR::Value& offset) { 1159 std::string_view lod_lc, const IR::Value& offset) {
1882 NotImplemented(); 1160 NotImplemented();
1883} 1161}
1884 1162
1885void EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1163void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1886 std::string_view coords, const IR::Value& offset, const IR::Value& offset2) { 1164 std::string_view coords, const IR::Value& offset, const IR::Value& offset2) {
1887 NotImplemented(); 1165 NotImplemented();
1888} 1166}
1889 1167
1890void EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1168void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1891 std::string_view coords, const IR::Value& offset, const IR::Value& offset2, 1169 std::string_view coords, const IR::Value& offset, const IR::Value& offset2,
1892 std::string_view dref) { 1170 std::string_view dref) {
1893 NotImplemented(); 1171 NotImplemented();
1894} 1172}
1895 1173
1896void EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1174void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1897 std::string_view coords, std::string_view offset, std::string_view lod, 1175 std::string_view coords, std::string_view offset, std::string_view lod,
1898 std::string_view ms) { 1176 std::string_view ms) {
1899 NotImplemented(); 1177 NotImplemented();
1900} 1178}
1901 1179
1902void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1180void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1903 std::string_view lod) { 1181 std::string_view lod) {
1904 NotImplemented(); 1182 NotImplemented();
1905} 1183}
1906 1184
1907void EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1185void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1908 std::string_view coords) { 1186 std::string_view coords) {
1909 NotImplemented(); 1187 NotImplemented();
1910} 1188}
1911 1189
1912void EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1190void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1913 std::string_view coords, std::string_view derivates, std::string_view offset, 1191 std::string_view coords, std::string_view derivates, std::string_view offset,
1914 std::string_view lod_clamp) { 1192 std::string_view lod_clamp) {
1915 NotImplemented(); 1193 NotImplemented();
1916} 1194}
1917 1195
1918void EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1196void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1919 std::string_view coords) { 1197 std::string_view coords) {
1920 NotImplemented(); 1198 NotImplemented();
1921} 1199}
1922 1200
1923void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1201void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
1924 std::string_view coords, std::string_view color) { 1202 std::string_view coords, std::string_view color) {
1925 NotImplemented(); 1203 NotImplemented();
1926} 1204}
@@ -2013,57 +1291,57 @@ void EmitBoundImageAtomicExchange32(EmitContext&) {
2013 NotImplemented(); 1291 NotImplemented();
2014} 1292}
2015 1293
2016void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1294void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2017 std::string_view coords, std::string_view value) { 1295 std::string_view coords, std::string_view value) {
2018 NotImplemented(); 1296 NotImplemented();
2019} 1297}
2020 1298
2021void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1299void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2022 std::string_view coords, std::string_view value) { 1300 std::string_view coords, std::string_view value) {
2023 NotImplemented(); 1301 NotImplemented();
2024} 1302}
2025 1303
2026void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1304void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2027 std::string_view coords, std::string_view value) { 1305 std::string_view coords, std::string_view value) {
2028 NotImplemented(); 1306 NotImplemented();
2029} 1307}
2030 1308
2031void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1309void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2032 std::string_view coords, std::string_view value) { 1310 std::string_view coords, std::string_view value) {
2033 NotImplemented(); 1311 NotImplemented();
2034} 1312}
2035 1313
2036void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1314void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2037 std::string_view coords, std::string_view value) { 1315 std::string_view coords, std::string_view value) {
2038 NotImplemented(); 1316 NotImplemented();
2039} 1317}
2040 1318
2041void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1319void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2042 std::string_view coords, std::string_view value) { 1320 std::string_view coords, std::string_view value) {
2043 NotImplemented(); 1321 NotImplemented();
2044} 1322}
2045 1323
2046void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1324void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2047 std::string_view coords, std::string_view value) { 1325 std::string_view coords, std::string_view value) {
2048 NotImplemented(); 1326 NotImplemented();
2049} 1327}
2050 1328
2051void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1329void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2052 std::string_view coords, std::string_view value) { 1330 std::string_view coords, std::string_view value) {
2053 NotImplemented(); 1331 NotImplemented();
2054} 1332}
2055 1333
2056void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1334void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2057 std::string_view coords, std::string_view value) { 1335 std::string_view coords, std::string_view value) {
2058 NotImplemented(); 1336 NotImplemented();
2059} 1337}
2060 1338
2061void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1339void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2062 std::string_view coords, std::string_view value) { 1340 std::string_view coords, std::string_view value) {
2063 NotImplemented(); 1341 NotImplemented();
2064} 1342}
2065 1343
2066void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, 1344void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
2067 std::string_view coords, std::string_view value) { 1345 std::string_view coords, std::string_view value) {
2068 NotImplemented(); 1346 NotImplemented();
2069} 1347}
@@ -2108,24 +1386,24 @@ void EmitSubgroupGeMask(EmitContext& ctx) {
2108 NotImplemented(); 1386 NotImplemented();
2109} 1387}
2110 1388
2111void EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, std::string_view value, 1389void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value,
2112 std::string_view index, std::string_view clamp, 1390 std::string_view index, std::string_view clamp,
2113 std::string_view segmentation_mask) { 1391 std::string_view segmentation_mask) {
2114 NotImplemented(); 1392 NotImplemented();
2115} 1393}
2116 1394
2117void EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, std::string_view value, std::string_view index, 1395void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view index,
2118 std::string_view clamp, std::string_view segmentation_mask) { 1396 std::string_view clamp, std::string_view segmentation_mask) {
2119 NotImplemented(); 1397 NotImplemented();
2120} 1398}
2121 1399
2122void EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, std::string_view value, 1400void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string_view value,
2123 std::string_view index, std::string_view clamp, 1401 std::string_view index, std::string_view clamp,
2124 std::string_view segmentation_mask) { 1402 std::string_view segmentation_mask) {
2125 NotImplemented(); 1403 NotImplemented();
2126} 1404}
2127 1405
2128void EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, std::string_view value, 1406void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string_view value,
2129 std::string_view index, std::string_view clamp, 1407 std::string_view index, std::string_view clamp,
2130 std::string_view segmentation_mask) { 1408 std::string_view segmentation_mask) {
2131 NotImplemented(); 1409 NotImplemented();