diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
12 files changed, 1380 insertions, 1244 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.h b/src/shader_recompiler/backend/glasm/emit_context.h index 4f98a9816..a59acbf6c 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.h +++ b/src/shader_recompiler/backend/glasm/emit_context.h | |||
| @@ -23,15 +23,15 @@ public: | |||
| 23 | explicit EmitContext(IR::Program& program); | 23 | explicit EmitContext(IR::Program& program); |
| 24 | 24 | ||
| 25 | template <typename... Args> | 25 | template <typename... Args> |
| 26 | void Add(const char* fmt, IR::Inst& inst, Args&&... args) { | 26 | void Add(const char* format_str, IR::Inst& inst, Args&&... args) { |
| 27 | code += fmt::format(fmt, reg_alloc.Define(inst), std::forward<Args>(args)...); | 27 | code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(args)...); |
| 28 | // TODO: Remove this | 28 | // TODO: Remove this |
| 29 | code += '\n'; | 29 | code += '\n'; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | template <typename... Args> | 32 | template <typename... Args> |
| 33 | void Add(const char* fmt, Args&&... args) { | 33 | void Add(const char* format_str, Args&&... args) { |
| 34 | code += fmt::format(fmt, std::forward<Args>(args)...); | 34 | code += fmt::format(format_str, std::forward<Args>(args)...); |
| 35 | // TODO: Remove this | 35 | // TODO: Remove this |
| 36 | code += '\n'; | 36 | code += '\n'; |
| 37 | } | 37 | } |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 7ec880c81..8981cf300 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -27,22 +27,80 @@ struct FuncTraits<ReturnType_ (*)(Args...)> { | |||
| 27 | using ArgType = std::tuple_element_t<I, std::tuple<Args...>>; | 27 | using ArgType = std::tuple_element_t<I, std::tuple<Args...>>; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | template <typename T> | ||
| 31 | struct Identity { | ||
| 32 | Identity(const T& data_) : data{data_} {} | ||
| 33 | |||
| 34 | const T& Extract() { | ||
| 35 | return data; | ||
| 36 | } | ||
| 37 | |||
| 38 | T data; | ||
| 39 | }; | ||
| 40 | |||
| 41 | template <bool scalar> | ||
| 42 | struct RegWrapper { | ||
| 43 | RegWrapper(EmitContext& ctx, Value value) | ||
| 44 | : reg_alloc{ctx.reg_alloc}, allocated{value.type != Type::Register} { | ||
| 45 | reg = allocated ? reg_alloc.AllocReg() : Register{value}; | ||
| 46 | switch (value.type) { | ||
| 47 | case Type::Register: | ||
| 48 | break; | ||
| 49 | case Type::U32: | ||
| 50 | ctx.Add("MOV.U {}.x,{};", reg, value.imm_u32); | ||
| 51 | break; | ||
| 52 | case Type::S32: | ||
| 53 | ctx.Add("MOV.S {}.x,{};", reg, value.imm_s32); | ||
| 54 | break; | ||
| 55 | case Type::F32: | ||
| 56 | ctx.Add("MOV.F {}.x,{};", reg, value.imm_f32); | ||
| 57 | break; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | ~RegWrapper() { | ||
| 61 | if (allocated) { | ||
| 62 | reg_alloc.FreeReg(reg); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | auto Extract() { | ||
| 67 | return std::conditional_t<scalar, ScalarRegister, Register>{Value{reg}}; | ||
| 68 | } | ||
| 69 | |||
| 70 | RegAlloc& reg_alloc; | ||
| 71 | Register reg{}; | ||
| 72 | bool allocated{}; | ||
| 73 | }; | ||
| 74 | |||
| 30 | template <typename ArgType> | 75 | template <typename ArgType> |
| 31 | auto Arg(EmitContext& ctx, const IR::Value& arg) { | 76 | auto Arg(EmitContext& ctx, const IR::Value& arg) { |
| 32 | if constexpr (std::is_same_v<ArgType, std::string_view>) { | 77 | if constexpr (std::is_same_v<ArgType, Register>) { |
| 33 | return ctx.reg_alloc.Consume(arg); | 78 | return RegWrapper<false>{ctx, ctx.reg_alloc.Consume(arg)}; |
| 79 | } else if constexpr (std::is_same_v<ArgType, ScalarRegister>) { | ||
| 80 | return RegWrapper<true>{ctx, ctx.reg_alloc.Consume(arg)}; | ||
| 81 | } else if constexpr (std::is_base_of_v<Value, ArgType>) { | ||
| 82 | return Identity{ArgType{ctx.reg_alloc.Consume(arg)}}; | ||
| 34 | } else if constexpr (std::is_same_v<ArgType, const IR::Value&>) { | 83 | } else if constexpr (std::is_same_v<ArgType, const IR::Value&>) { |
| 35 | return arg; | 84 | return Identity{arg}; |
| 36 | } else if constexpr (std::is_same_v<ArgType, u32>) { | 85 | } else if constexpr (std::is_same_v<ArgType, u32>) { |
| 37 | return arg.U32(); | 86 | return Identity{arg.U32()}; |
| 38 | } else if constexpr (std::is_same_v<ArgType, IR::Block*>) { | 87 | } else if constexpr (std::is_same_v<ArgType, IR::Block*>) { |
| 39 | return arg.Label(); | 88 | return Identity{arg.Label()}; |
| 40 | } else if constexpr (std::is_same_v<ArgType, IR::Attribute>) { | 89 | } else if constexpr (std::is_same_v<ArgType, IR::Attribute>) { |
| 41 | return arg.Attribute(); | 90 | return Identity{arg.Attribute()}; |
| 42 | } else if constexpr (std::is_same_v<ArgType, IR::Patch>) { | 91 | } else if constexpr (std::is_same_v<ArgType, IR::Patch>) { |
| 43 | return arg.Patch(); | 92 | return Identity{arg.Patch()}; |
| 44 | } else if constexpr (std::is_same_v<ArgType, IR::Reg>) { | 93 | } else if constexpr (std::is_same_v<ArgType, IR::Reg>) { |
| 45 | return arg.Reg(); | 94 | return Identity{arg.Reg()}; |
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | template <auto func, bool is_first_arg_inst, typename... Args> | ||
| 99 | void InvokeCall(EmitContext& ctx, IR::Inst* inst, Args&&... args) { | ||
| 100 | if constexpr (is_first_arg_inst) { | ||
| 101 | func(ctx, *inst, std::forward<Args>(args.Extract())...); | ||
| 102 | } else { | ||
| 103 | func(ctx, std::forward<Args>(args.Extract())...); | ||
| 46 | } | 104 | } |
| 47 | } | 105 | } |
| 48 | 106 | ||
| @@ -50,9 +108,10 @@ template <auto func, bool is_first_arg_inst, size_t... I> | |||
| 50 | void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { | 108 | void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { |
| 51 | using Traits = FuncTraits<decltype(func)>; | 109 | using Traits = FuncTraits<decltype(func)>; |
| 52 | if constexpr (is_first_arg_inst) { | 110 | if constexpr (is_first_arg_inst) { |
| 53 | func(ctx, *inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); | 111 | func(ctx, *inst, |
| 112 | Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I)).Extract()...); | ||
| 54 | } else { | 113 | } else { |
| 55 | func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); | 114 | func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I)).Extract()...); |
| 56 | } | 115 | } |
| 57 | } | 116 | } |
| 58 | 117 | ||
| @@ -81,7 +140,7 @@ void EmitInst(EmitContext& ctx, IR::Inst* inst) { | |||
| 81 | throw LogicError("Invalid opcode {}", inst->GetOpcode()); | 140 | throw LogicError("Invalid opcode {}", inst->GetOpcode()); |
| 82 | } | 141 | } |
| 83 | 142 | ||
| 84 | void Identity(IR::Inst& inst, const IR::Value& value) { | 143 | void Alias(IR::Inst& inst, const IR::Value& value) { |
| 85 | if (value.IsImmediate()) { | 144 | if (value.IsImmediate()) { |
| 86 | return; | 145 | return; |
| 87 | } | 146 | } |
| @@ -125,31 +184,31 @@ std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) { | |||
| 125 | } | 184 | } |
| 126 | 185 | ||
| 127 | void EmitIdentity(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 186 | void EmitIdentity(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 128 | Identity(inst, value); | 187 | Alias(inst, value); |
| 129 | } | 188 | } |
| 130 | 189 | ||
| 131 | void EmitBitCastU16F16(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 190 | void EmitBitCastU16F16(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 132 | Identity(inst, value); | 191 | Alias(inst, value); |
| 133 | } | 192 | } |
| 134 | 193 | ||
| 135 | void EmitBitCastU32F32(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 194 | void EmitBitCastU32F32(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 136 | Identity(inst, value); | 195 | Alias(inst, value); |
| 137 | } | 196 | } |
| 138 | 197 | ||
| 139 | void EmitBitCastU64F64(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 198 | void EmitBitCastU64F64(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 140 | Identity(inst, value); | 199 | Alias(inst, value); |
| 141 | } | 200 | } |
| 142 | 201 | ||
| 143 | void EmitBitCastF16U16(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 202 | void EmitBitCastF16U16(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 144 | Identity(inst, value); | 203 | Alias(inst, value); |
| 145 | } | 204 | } |
| 146 | 205 | ||
| 147 | void EmitBitCastF32U32(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 206 | void EmitBitCastF32U32(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 148 | Identity(inst, value); | 207 | Alias(inst, value); |
| 149 | } | 208 | } |
| 150 | 209 | ||
| 151 | void EmitBitCastF64U64(EmitContext&, IR::Inst& inst, const IR::Value& value) { | 210 | void EmitBitCastF64U64(EmitContext&, IR::Inst& inst, const IR::Value& value) { |
| 152 | Identity(inst, value); | 211 | Alias(inst, value); |
| 153 | } | 212 | } |
| 154 | 213 | ||
| 155 | } // namespace Shader::Backend::GLASM | 214 | } // namespace Shader::Backend::GLASM |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp index e69de29bb..063dcaf13 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp | |||
| @@ -0,0 +1,225 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 6 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 7 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 8 | |||
| 9 | namespace Shader::Backend::GLASM { | ||
| 10 | namespace { | ||
| 11 | template <typename... Values> | ||
| 12 | void CompositeConstructU32(EmitContext& ctx, IR::Inst& inst, Values&&... elements) { | ||
| 13 | const Register ret{ctx.reg_alloc.Define(inst)}; | ||
| 14 | if (std::ranges::any_of(std::array{elements...}, | ||
| 15 | [](const IR::Value& value) { return value.IsImmediate(); })) { | ||
| 16 | const std::array<u32, 4> values{(elements.IsImmediate() ? elements.U32() : 0)...}; | ||
| 17 | ctx.Add("MOV.U {},{{{},{},{},{}}};", ret, fmt::to_string(values[0]), | ||
| 18 | fmt::to_string(values[1]), fmt::to_string(values[2]), fmt::to_string(values[3])); | ||
| 19 | } | ||
| 20 | size_t index{}; | ||
| 21 | for (const IR::Value& element : {elements...}) { | ||
| 22 | if (!element.IsImmediate()) { | ||
| 23 | const ScalarU32 value{ctx.reg_alloc.Consume(element)}; | ||
| 24 | ctx.Add("MOV.U {}.{},{};", ret, "xyzw"[index], value); | ||
| 25 | } | ||
| 26 | ++index; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | void CompositeExtractU32(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index) { | ||
| 31 | const Register ret{ctx.reg_alloc.Define(inst)}; | ||
| 32 | if (ret == composite && index == 0) { | ||
| 33 | // No need to do anything here, the source and destination are the same register | ||
| 34 | return; | ||
| 35 | } | ||
| 36 | ctx.Add("MOV.U {}.x,{}.{};", ret, composite, "xyzw"[index]); | ||
| 37 | } | ||
| 38 | } // Anonymous namespace | ||
| 39 | |||
| 40 | void EmitCompositeConstructU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, | ||
| 41 | const IR::Value& e2) { | ||
| 42 | CompositeConstructU32(ctx, inst, e1, e2); | ||
| 43 | } | ||
| 44 | |||
| 45 | void EmitCompositeConstructU32x3(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, | ||
| 46 | const IR::Value& e2, const IR::Value& e3) { | ||
| 47 | CompositeConstructU32(ctx, inst, e1, e2, e3); | ||
| 48 | } | ||
| 49 | |||
| 50 | void EmitCompositeConstructU32x4(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, | ||
| 51 | const IR::Value& e2, const IR::Value& e3, const IR::Value& e4) { | ||
| 52 | CompositeConstructU32(ctx, inst, e1, e2, e3, e4); | ||
| 53 | } | ||
| 54 | |||
| 55 | void EmitCompositeExtractU32x2(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index) { | ||
| 56 | CompositeExtractU32(ctx, inst, composite, index); | ||
| 57 | } | ||
| 58 | |||
| 59 | void EmitCompositeExtractU32x3(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index) { | ||
| 60 | CompositeExtractU32(ctx, inst, composite, index); | ||
| 61 | } | ||
| 62 | |||
| 63 | void EmitCompositeExtractU32x4(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index) { | ||
| 64 | CompositeExtractU32(ctx, inst, composite, index); | ||
| 65 | } | ||
| 66 | |||
| 67 | void EmitCompositeInsertU32x2([[maybe_unused]] EmitContext& ctx, | ||
| 68 | [[maybe_unused]] Register composite, | ||
| 69 | [[maybe_unused]] ScalarU32 object, [[maybe_unused]] u32 index) { | ||
| 70 | throw NotImplementedException("GLASM instruction"); | ||
| 71 | } | ||
| 72 | |||
| 73 | void EmitCompositeInsertU32x3([[maybe_unused]] EmitContext& ctx, | ||
| 74 | [[maybe_unused]] Register composite, | ||
| 75 | [[maybe_unused]] ScalarU32 object, [[maybe_unused]] u32 index) { | ||
| 76 | throw NotImplementedException("GLASM instruction"); | ||
| 77 | } | ||
| 78 | |||
| 79 | void EmitCompositeInsertU32x4([[maybe_unused]] EmitContext& ctx, | ||
| 80 | [[maybe_unused]] Register composite, | ||
| 81 | [[maybe_unused]] ScalarU32 object, [[maybe_unused]] u32 index) { | ||
| 82 | throw NotImplementedException("GLASM instruction"); | ||
| 83 | } | ||
| 84 | |||
| 85 | void EmitCompositeConstructF16x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register e1, | ||
| 86 | [[maybe_unused]] Register e2) { | ||
| 87 | throw NotImplementedException("GLASM instruction"); | ||
| 88 | } | ||
| 89 | |||
| 90 | void EmitCompositeConstructF16x3([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register e1, | ||
| 91 | [[maybe_unused]] Register e2, [[maybe_unused]] Register e3) { | ||
| 92 | throw NotImplementedException("GLASM instruction"); | ||
| 93 | } | ||
| 94 | |||
| 95 | void EmitCompositeConstructF16x4([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register e1, | ||
| 96 | [[maybe_unused]] Register e2, [[maybe_unused]] Register e3, | ||
| 97 | [[maybe_unused]] Register e4) { | ||
| 98 | throw NotImplementedException("GLASM instruction"); | ||
| 99 | } | ||
| 100 | |||
| 101 | void EmitCompositeExtractF16x2([[maybe_unused]] EmitContext& ctx, | ||
| 102 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 103 | throw NotImplementedException("GLASM instruction"); | ||
| 104 | } | ||
| 105 | |||
| 106 | void EmitCompositeExtractF16x3([[maybe_unused]] EmitContext& ctx, | ||
| 107 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 108 | throw NotImplementedException("GLASM instruction"); | ||
| 109 | } | ||
| 110 | |||
| 111 | void EmitCompositeExtractF16x4([[maybe_unused]] EmitContext& ctx, | ||
| 112 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 113 | throw NotImplementedException("GLASM instruction"); | ||
| 114 | } | ||
| 115 | |||
| 116 | void EmitCompositeInsertF16x2([[maybe_unused]] EmitContext& ctx, | ||
| 117 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 118 | [[maybe_unused]] u32 index) { | ||
| 119 | throw NotImplementedException("GLASM instruction"); | ||
| 120 | } | ||
| 121 | |||
| 122 | void EmitCompositeInsertF16x3([[maybe_unused]] EmitContext& ctx, | ||
| 123 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 124 | [[maybe_unused]] u32 index) { | ||
| 125 | throw NotImplementedException("GLASM instruction"); | ||
| 126 | } | ||
| 127 | |||
| 128 | void EmitCompositeInsertF16x4([[maybe_unused]] EmitContext& ctx, | ||
| 129 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 130 | [[maybe_unused]] u32 index) { | ||
| 131 | throw NotImplementedException("GLASM instruction"); | ||
| 132 | } | ||
| 133 | |||
| 134 | void EmitCompositeConstructF32x2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 e1, | ||
| 135 | [[maybe_unused]] ScalarF32 e2) { | ||
| 136 | throw NotImplementedException("GLASM instruction"); | ||
| 137 | } | ||
| 138 | |||
| 139 | void EmitCompositeConstructF32x3([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 e1, | ||
| 140 | [[maybe_unused]] ScalarF32 e2, [[maybe_unused]] ScalarF32 e3) { | ||
| 141 | throw NotImplementedException("GLASM instruction"); | ||
| 142 | } | ||
| 143 | |||
| 144 | void EmitCompositeConstructF32x4([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 e1, | ||
| 145 | [[maybe_unused]] ScalarF32 e2, [[maybe_unused]] ScalarF32 e3, | ||
| 146 | [[maybe_unused]] ScalarF32 e4) { | ||
| 147 | throw NotImplementedException("GLASM instruction"); | ||
| 148 | } | ||
| 149 | |||
| 150 | void EmitCompositeExtractF32x2([[maybe_unused]] EmitContext& ctx, | ||
| 151 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 152 | throw NotImplementedException("GLASM instruction"); | ||
| 153 | } | ||
| 154 | |||
| 155 | void EmitCompositeExtractF32x3([[maybe_unused]] EmitContext& ctx, | ||
| 156 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 157 | throw NotImplementedException("GLASM instruction"); | ||
| 158 | } | ||
| 159 | |||
| 160 | void EmitCompositeExtractF32x4([[maybe_unused]] EmitContext& ctx, | ||
| 161 | [[maybe_unused]] Register composite, [[maybe_unused]] u32 index) { | ||
| 162 | throw NotImplementedException("GLASM instruction"); | ||
| 163 | } | ||
| 164 | |||
| 165 | void EmitCompositeInsertF32x2([[maybe_unused]] EmitContext& ctx, | ||
| 166 | [[maybe_unused]] Register composite, | ||
| 167 | [[maybe_unused]] ScalarF32 object, [[maybe_unused]] u32 index) { | ||
| 168 | throw NotImplementedException("GLASM instruction"); | ||
| 169 | } | ||
| 170 | |||
| 171 | void EmitCompositeInsertF32x3([[maybe_unused]] EmitContext& ctx, | ||
| 172 | [[maybe_unused]] Register composite, | ||
| 173 | [[maybe_unused]] ScalarF32 object, [[maybe_unused]] u32 index) { | ||
| 174 | throw NotImplementedException("GLASM instruction"); | ||
| 175 | } | ||
| 176 | |||
| 177 | void EmitCompositeInsertF32x4([[maybe_unused]] EmitContext& ctx, | ||
| 178 | [[maybe_unused]] Register composite, | ||
| 179 | [[maybe_unused]] ScalarF32 object, [[maybe_unused]] u32 index) { | ||
| 180 | throw NotImplementedException("GLASM instruction"); | ||
| 181 | } | ||
| 182 | |||
| 183 | void EmitCompositeConstructF64x2([[maybe_unused]] EmitContext& ctx) { | ||
| 184 | throw NotImplementedException("GLASM instruction"); | ||
| 185 | } | ||
| 186 | |||
| 187 | void EmitCompositeConstructF64x3([[maybe_unused]] EmitContext& ctx) { | ||
| 188 | throw NotImplementedException("GLASM instruction"); | ||
| 189 | } | ||
| 190 | |||
| 191 | void EmitCompositeConstructF64x4([[maybe_unused]] EmitContext& ctx) { | ||
| 192 | throw NotImplementedException("GLASM instruction"); | ||
| 193 | } | ||
| 194 | |||
| 195 | void EmitCompositeExtractF64x2([[maybe_unused]] EmitContext& ctx) { | ||
| 196 | throw NotImplementedException("GLASM instruction"); | ||
| 197 | } | ||
| 198 | |||
| 199 | void EmitCompositeExtractF64x3([[maybe_unused]] EmitContext& ctx) { | ||
| 200 | throw NotImplementedException("GLASM instruction"); | ||
| 201 | } | ||
| 202 | |||
| 203 | void EmitCompositeExtractF64x4([[maybe_unused]] EmitContext& ctx) { | ||
| 204 | throw NotImplementedException("GLASM instruction"); | ||
| 205 | } | ||
| 206 | |||
| 207 | void EmitCompositeInsertF64x2([[maybe_unused]] EmitContext& ctx, | ||
| 208 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 209 | [[maybe_unused]] u32 index) { | ||
| 210 | throw NotImplementedException("GLASM instruction"); | ||
| 211 | } | ||
| 212 | |||
| 213 | void EmitCompositeInsertF64x3([[maybe_unused]] EmitContext& ctx, | ||
| 214 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 215 | [[maybe_unused]] u32 index) { | ||
| 216 | throw NotImplementedException("GLASM instruction"); | ||
| 217 | } | ||
| 218 | |||
| 219 | void EmitCompositeInsertF64x4([[maybe_unused]] EmitContext& ctx, | ||
| 220 | [[maybe_unused]] Register composite, [[maybe_unused]] Register object, | ||
| 221 | [[maybe_unused]] u32 index) { | ||
| 222 | throw NotImplementedException("GLASM instruction"); | ||
| 223 | } | ||
| 224 | |||
| 225 | } // 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 72733d1cf..fed79e381 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 | |||
| @@ -10,64 +10,58 @@ | |||
| 10 | 10 | ||
| 11 | namespace Shader::Backend::GLASM { | 11 | namespace Shader::Backend::GLASM { |
| 12 | namespace { | 12 | namespace { |
| 13 | void GetCbuf(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, const IR::Value& offset, | 13 | void GetCbuf(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset, |
| 14 | std::string_view size) { | 14 | std::string_view size) { |
| 15 | if (!binding.IsImmediate()) { | 15 | if (!binding.IsImmediate()) { |
| 16 | throw NotImplementedException("Indirect constant buffer loading"); | 16 | throw NotImplementedException("Indirect constant buffer loading"); |
| 17 | } | 17 | } |
| 18 | const std::string ret{ctx.reg_alloc.Define(inst)}; | 18 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 19 | ctx.Add("LDC.{} {},c{}[{}];", size, ret, binding.U32(), ctx.reg_alloc.Consume(offset)); | 19 | ctx.Add("LDC.{} {},c{}[{}];", size, ret, binding.U32(), offset); |
| 20 | } | 20 | } |
| 21 | } // Anonymous namespace | 21 | } // Anonymous namespace |
| 22 | 22 | ||
| 23 | void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 23 | void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 24 | const IR::Value& offset) { | ||
| 25 | GetCbuf(ctx, inst, binding, offset, "U8"); | 24 | GetCbuf(ctx, inst, binding, offset, "U8"); |
| 26 | } | 25 | } |
| 27 | 26 | ||
| 28 | void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 27 | void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 29 | const IR::Value& offset) { | ||
| 30 | GetCbuf(ctx, inst, binding, offset, "S8"); | 28 | GetCbuf(ctx, inst, binding, offset, "S8"); |
| 31 | } | 29 | } |
| 32 | 30 | ||
| 33 | void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 31 | void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 34 | const IR::Value& offset) { | ||
| 35 | GetCbuf(ctx, inst, binding, offset, "U16"); | 32 | GetCbuf(ctx, inst, binding, offset, "U16"); |
| 36 | } | 33 | } |
| 37 | 34 | ||
| 38 | void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 35 | void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 39 | const IR::Value& offset) { | ||
| 40 | GetCbuf(ctx, inst, binding, offset, "S16"); | 36 | GetCbuf(ctx, inst, binding, offset, "S16"); |
| 41 | } | 37 | } |
| 42 | 38 | ||
| 43 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 39 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 44 | const IR::Value& offset) { | ||
| 45 | GetCbuf(ctx, inst, binding, offset, "U32"); | 40 | GetCbuf(ctx, inst, binding, offset, "U32"); |
| 46 | } | 41 | } |
| 47 | 42 | ||
| 48 | void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 43 | void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset) { |
| 49 | const IR::Value& offset) { | ||
| 50 | GetCbuf(ctx, inst, binding, offset, "F32"); | 44 | GetCbuf(ctx, inst, binding, offset, "F32"); |
| 51 | } | 45 | } |
| 52 | 46 | ||
| 53 | void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 47 | void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 54 | const IR::Value& offset) { | 48 | ScalarU32 offset) { |
| 55 | GetCbuf(ctx, inst, binding, offset, "U32X2"); | 49 | GetCbuf(ctx, inst, binding, offset, "U32X2"); |
| 56 | } | 50 | } |
| 57 | 51 | ||
| 58 | void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, | 52 | void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, |
| 59 | [[maybe_unused]] std::string_view vertex) { | 53 | [[maybe_unused]] ScalarU32 vertex) { |
| 60 | if (IR::IsGeneric(attr)) { | 54 | if (IR::IsGeneric(attr)) { |
| 61 | const u32 index{IR::GenericAttributeIndex(attr)}; | 55 | const u32 index{IR::GenericAttributeIndex(attr)}; |
| 62 | const u32 element{IR::GenericAttributeElement(attr)}; | 56 | const u32 element{IR::GenericAttributeElement(attr)}; |
| 63 | ctx.Add("MOV.F {},in_attr{}.{};", inst, index, "xyzw"[element]); | 57 | ctx.Add("MOV.F {}.x,in_attr{}.{};", inst, index, "xyzw"[element]); |
| 64 | return; | 58 | return; |
| 65 | } | 59 | } |
| 66 | throw NotImplementedException("Get attribute {}", attr); | 60 | throw NotImplementedException("Get attribute {}", attr); |
| 67 | } | 61 | } |
| 68 | 62 | ||
| 69 | void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value, | 63 | void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value, |
| 70 | [[maybe_unused]] std::string_view vertex) { | 64 | [[maybe_unused]] ScalarU32 vertex) { |
| 71 | const u32 element{static_cast<u32>(attr) % 4}; | 65 | const u32 element{static_cast<u32>(attr) % 4}; |
| 72 | const char swizzle{"xyzw"[element]}; | 66 | const char swizzle{"xyzw"[element]}; |
| 73 | if (IR::IsGeneric(attr)) { | 67 | if (IR::IsGeneric(attr)) { |
| @@ -87,16 +81,13 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view val | |||
| 87 | } | 81 | } |
| 88 | } | 82 | } |
| 89 | 83 | ||
| 90 | void EmitGetAttributeIndexed([[maybe_unused]] EmitContext& ctx, | 84 | void EmitGetAttributeIndexed([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, |
| 91 | [[maybe_unused]] std::string_view offset, | 85 | [[maybe_unused]] ScalarU32 vertex) { |
| 92 | [[maybe_unused]] std::string_view vertex) { | ||
| 93 | throw NotImplementedException("GLASM instruction"); | 86 | throw NotImplementedException("GLASM instruction"); |
| 94 | } | 87 | } |
| 95 | 88 | ||
| 96 | void EmitSetAttributeIndexed([[maybe_unused]] EmitContext& ctx, | 89 | void EmitSetAttributeIndexed([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, |
| 97 | [[maybe_unused]] std::string_view offset, | 90 | [[maybe_unused]] ScalarF32 value, [[maybe_unused]] ScalarU32 vertex) { |
| 98 | [[maybe_unused]] std::string_view value, | ||
| 99 | [[maybe_unused]] std::string_view vertex) { | ||
| 100 | throw NotImplementedException("GLASM instruction"); | 91 | throw NotImplementedException("GLASM instruction"); |
| 101 | } | 92 | } |
| 102 | 93 | ||
| @@ -105,20 +96,20 @@ void EmitGetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch | |||
| 105 | } | 96 | } |
| 106 | 97 | ||
| 107 | void EmitSetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch patch, | 98 | void EmitSetPatch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Patch patch, |
| 108 | [[maybe_unused]] std::string_view value) { | 99 | [[maybe_unused]] ScalarF32 value) { |
| 109 | throw NotImplementedException("GLASM instruction"); | 100 | throw NotImplementedException("GLASM instruction"); |
| 110 | } | 101 | } |
| 111 | 102 | ||
| 112 | void EmitSetFragColor([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] u32 index, | 103 | void EmitSetFragColor([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] u32 index, |
| 113 | [[maybe_unused]] u32 component, [[maybe_unused]] std::string_view value) { | 104 | [[maybe_unused]] u32 component, [[maybe_unused]] ScalarF32 value) { |
| 114 | throw NotImplementedException("GLASM instruction"); | 105 | throw NotImplementedException("GLASM instruction"); |
| 115 | } | 106 | } |
| 116 | 107 | ||
| 117 | void EmitSetSampleMask([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 108 | void EmitSetSampleMask([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 118 | throw NotImplementedException("GLASM instruction"); | 109 | throw NotImplementedException("GLASM instruction"); |
| 119 | } | 110 | } |
| 120 | 111 | ||
| 121 | void EmitSetFragDepth([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 112 | void EmitSetFragDepth([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 122 | throw NotImplementedException("GLASM instruction"); | 113 | throw NotImplementedException("GLASM instruction"); |
| 123 | } | 114 | } |
| 124 | 115 | ||
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 db9dda261..fed6503c6 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp | |||
| @@ -10,411 +10,382 @@ | |||
| 10 | 10 | ||
| 11 | namespace Shader::Backend::GLASM { | 11 | namespace Shader::Backend::GLASM { |
| 12 | 12 | ||
| 13 | void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 13 | void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 14 | throw NotImplementedException("GLASM instruction"); | 14 | throw NotImplementedException("GLASM instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value) { | 17 | void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 18 | ctx.Add("MOV.F {},|{}|;", inst, value); | 18 | ctx.Add("MOV.F {}.x,|{}|;", inst, value); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitFPAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 21 | void EmitFPAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 22 | throw NotImplementedException("GLASM instruction"); | 22 | throw NotImplementedException("GLASM instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void EmitFPAdd16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 25 | void EmitFPAdd16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 26 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 26 | [[maybe_unused]] Register a, [[maybe_unused]] Register b) { |
| 27 | throw NotImplementedException("GLASM instruction"); | 27 | throw NotImplementedException("GLASM instruction"); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { | 30 | void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) { |
| 31 | ctx.Add("ADD.F {},{},{};", inst, a, b); | 31 | ctx.Add("ADD.F {}.x,{},{};", inst, a, b); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | void EmitFPAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 34 | void EmitFPAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 35 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 35 | [[maybe_unused]] Register a, [[maybe_unused]] Register b) { |
| 36 | throw NotImplementedException("GLASM instruction"); | 36 | throw NotImplementedException("GLASM instruction"); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void EmitFPFma16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 39 | void EmitFPFma16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 40 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b, | 40 | [[maybe_unused]] Register a, [[maybe_unused]] Register b, |
| 41 | [[maybe_unused]] std::string_view c) { | 41 | [[maybe_unused]] Register c) { |
| 42 | throw NotImplementedException("GLASM instruction"); | 42 | throw NotImplementedException("GLASM instruction"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b, | 45 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, ScalarF32 c) { |
| 46 | std::string_view c) { | 46 | ctx.Add("MAD.F {}.x,{},{},{};", inst, a, b, c); |
| 47 | ctx.Add("MAD.F {},{},{},{};", inst, a, b, c); | ||
| 48 | } | 47 | } |
| 49 | 48 | ||
| 50 | void EmitFPFma64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 49 | void EmitFPFma64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 51 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b, | 50 | [[maybe_unused]] Register a, [[maybe_unused]] Register b, |
| 52 | [[maybe_unused]] std::string_view c) { | 51 | [[maybe_unused]] Register c) { |
| 53 | throw NotImplementedException("GLASM instruction"); | 52 | throw NotImplementedException("GLASM instruction"); |
| 54 | } | 53 | } |
| 55 | 54 | ||
| 56 | void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | 55 | void EmitFPMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, |
| 57 | [[maybe_unused]] std::string_view b) { | 56 | [[maybe_unused]] ScalarF32 b) { |
| 58 | throw NotImplementedException("GLASM instruction"); | 57 | throw NotImplementedException("GLASM instruction"); |
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | void EmitFPMax64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | 60 | void EmitFPMax64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, |
| 62 | [[maybe_unused]] std::string_view b) { | 61 | [[maybe_unused]] Register b) { |
| 63 | throw NotImplementedException("GLASM instruction"); | 62 | throw NotImplementedException("GLASM instruction"); |
| 64 | } | 63 | } |
| 65 | 64 | ||
| 66 | void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | 65 | void EmitFPMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 a, |
| 67 | [[maybe_unused]] std::string_view b) { | 66 | [[maybe_unused]] ScalarF32 b) { |
| 68 | throw NotImplementedException("GLASM instruction"); | 67 | throw NotImplementedException("GLASM instruction"); |
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | void EmitFPMin64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a, | 70 | void EmitFPMin64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, |
| 72 | [[maybe_unused]] std::string_view b) { | 71 | [[maybe_unused]] Register b) { |
| 73 | throw NotImplementedException("GLASM instruction"); | 72 | throw NotImplementedException("GLASM instruction"); |
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 75 | void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 77 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 76 | [[maybe_unused]] Register a, [[maybe_unused]] Register b) { |
| 78 | throw NotImplementedException("GLASM instruction"); | 77 | throw NotImplementedException("GLASM instruction"); |
| 79 | } | 78 | } |
| 80 | 79 | ||
| 81 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { | 80 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) { |
| 82 | ctx.Add("MUL.F {},{},{};", inst, a, b); | 81 | ctx.Add("MUL.F {}.x,{},{};", inst, a, b); |
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | void EmitFPMul64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 84 | void EmitFPMul64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 86 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 85 | [[maybe_unused]] Register a, [[maybe_unused]] Register b) { |
| 87 | throw NotImplementedException("GLASM instruction"); | 86 | throw NotImplementedException("GLASM instruction"); |
| 88 | } | 87 | } |
| 89 | 88 | ||
| 90 | void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 89 | void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 91 | throw NotImplementedException("GLASM instruction"); | 90 | throw NotImplementedException("GLASM instruction"); |
| 92 | } | 91 | } |
| 93 | 92 | ||
| 94 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value) { | 93 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value) { |
| 95 | if (value[0] == '-') { | 94 | ctx.Add("MOV.F {}.x,-{};", inst, value); |
| 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 | } | 95 | } |
| 102 | 96 | ||
| 103 | void EmitFPNeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 97 | void EmitFPNeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 104 | throw NotImplementedException("GLASM instruction"); | 98 | throw NotImplementedException("GLASM instruction"); |
| 105 | } | 99 | } |
| 106 | 100 | ||
| 107 | void EmitFPSin([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 101 | void EmitFPSin([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 108 | throw NotImplementedException("GLASM instruction"); | 102 | throw NotImplementedException("GLASM instruction"); |
| 109 | } | 103 | } |
| 110 | 104 | ||
| 111 | void EmitFPCos([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 105 | void EmitFPCos([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 112 | throw NotImplementedException("GLASM instruction"); | 106 | throw NotImplementedException("GLASM instruction"); |
| 113 | } | 107 | } |
| 114 | 108 | ||
| 115 | void EmitFPExp2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 109 | void EmitFPExp2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 116 | throw NotImplementedException("GLASM instruction"); | 110 | throw NotImplementedException("GLASM instruction"); |
| 117 | } | 111 | } |
| 118 | 112 | ||
| 119 | void EmitFPLog2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 113 | void EmitFPLog2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 120 | throw NotImplementedException("GLASM instruction"); | 114 | throw NotImplementedException("GLASM instruction"); |
| 121 | } | 115 | } |
| 122 | 116 | ||
| 123 | void EmitFPRecip32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 117 | void EmitFPRecip32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 124 | throw NotImplementedException("GLASM instruction"); | 118 | throw NotImplementedException("GLASM instruction"); |
| 125 | } | 119 | } |
| 126 | 120 | ||
| 127 | void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 121 | void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 128 | throw NotImplementedException("GLASM instruction"); | 122 | throw NotImplementedException("GLASM instruction"); |
| 129 | } | 123 | } |
| 130 | 124 | ||
| 131 | void EmitFPRecipSqrt32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 125 | void EmitFPRecipSqrt32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 132 | throw NotImplementedException("GLASM instruction"); | 126 | throw NotImplementedException("GLASM instruction"); |
| 133 | } | 127 | } |
| 134 | 128 | ||
| 135 | void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 129 | void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 136 | throw NotImplementedException("GLASM instruction"); | 130 | throw NotImplementedException("GLASM instruction"); |
| 137 | } | 131 | } |
| 138 | 132 | ||
| 139 | void EmitFPSqrt([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 133 | void EmitFPSqrt([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 140 | throw NotImplementedException("GLASM instruction"); | 134 | throw NotImplementedException("GLASM instruction"); |
| 141 | } | 135 | } |
| 142 | 136 | ||
| 143 | void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 137 | void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 144 | throw NotImplementedException("GLASM instruction"); | 138 | throw NotImplementedException("GLASM instruction"); |
| 145 | } | 139 | } |
| 146 | 140 | ||
| 147 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, std::string_view value) { | 141 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) { |
| 148 | ctx.Add("MOV.F.SAT {},{};", inst, value); | 142 | ctx.Add("MOV.F.SAT {}.x,{};", inst, value); |
| 149 | } | 143 | } |
| 150 | 144 | ||
| 151 | void EmitFPSaturate64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 145 | void EmitFPSaturate64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 152 | throw NotImplementedException("GLASM instruction"); | 146 | throw NotImplementedException("GLASM instruction"); |
| 153 | } | 147 | } |
| 154 | 148 | ||
| 155 | void EmitFPClamp16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value, | 149 | void EmitFPClamp16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value, |
| 156 | [[maybe_unused]] std::string_view min_value, | 150 | [[maybe_unused]] Register min_value, [[maybe_unused]] Register max_value) { |
| 157 | [[maybe_unused]] std::string_view max_value) { | ||
| 158 | throw NotImplementedException("GLASM instruction"); | 151 | throw NotImplementedException("GLASM instruction"); |
| 159 | } | 152 | } |
| 160 | 153 | ||
| 161 | void EmitFPClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value, | 154 | void EmitFPClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value, |
| 162 | [[maybe_unused]] std::string_view min_value, | 155 | [[maybe_unused]] ScalarF32 min_value, [[maybe_unused]] ScalarF32 max_value) { |
| 163 | [[maybe_unused]] std::string_view max_value) { | ||
| 164 | throw NotImplementedException("GLASM instruction"); | 156 | throw NotImplementedException("GLASM instruction"); |
| 165 | } | 157 | } |
| 166 | 158 | ||
| 167 | void EmitFPClamp64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value, | 159 | void EmitFPClamp64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value, |
| 168 | [[maybe_unused]] std::string_view min_value, | 160 | [[maybe_unused]] Register min_value, [[maybe_unused]] Register max_value) { |
| 169 | [[maybe_unused]] std::string_view max_value) { | ||
| 170 | throw NotImplementedException("GLASM instruction"); | 161 | throw NotImplementedException("GLASM instruction"); |
| 171 | } | 162 | } |
| 172 | 163 | ||
| 173 | void EmitFPRoundEven16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 164 | void EmitFPRoundEven16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 174 | throw NotImplementedException("GLASM instruction"); | 165 | throw NotImplementedException("GLASM instruction"); |
| 175 | } | 166 | } |
| 176 | 167 | ||
| 177 | void EmitFPRoundEven32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 168 | void EmitFPRoundEven32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 178 | throw NotImplementedException("GLASM instruction"); | 169 | throw NotImplementedException("GLASM instruction"); |
| 179 | } | 170 | } |
| 180 | 171 | ||
| 181 | void EmitFPRoundEven64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 172 | void EmitFPRoundEven64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 182 | throw NotImplementedException("GLASM instruction"); | 173 | throw NotImplementedException("GLASM instruction"); |
| 183 | } | 174 | } |
| 184 | 175 | ||
| 185 | void EmitFPFloor16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 176 | void EmitFPFloor16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 186 | throw NotImplementedException("GLASM instruction"); | 177 | throw NotImplementedException("GLASM instruction"); |
| 187 | } | 178 | } |
| 188 | 179 | ||
| 189 | void EmitFPFloor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 180 | void EmitFPFloor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 190 | throw NotImplementedException("GLASM instruction"); | 181 | throw NotImplementedException("GLASM instruction"); |
| 191 | } | 182 | } |
| 192 | 183 | ||
| 193 | void EmitFPFloor64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 184 | void EmitFPFloor64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 194 | throw NotImplementedException("GLASM instruction"); | 185 | throw NotImplementedException("GLASM instruction"); |
| 195 | } | 186 | } |
| 196 | 187 | ||
| 197 | void EmitFPCeil16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 188 | void EmitFPCeil16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 198 | throw NotImplementedException("GLASM instruction"); | 189 | throw NotImplementedException("GLASM instruction"); |
| 199 | } | 190 | } |
| 200 | 191 | ||
| 201 | void EmitFPCeil32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 192 | void EmitFPCeil32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 202 | throw NotImplementedException("GLASM instruction"); | 193 | throw NotImplementedException("GLASM instruction"); |
| 203 | } | 194 | } |
| 204 | 195 | ||
| 205 | void EmitFPCeil64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 196 | void EmitFPCeil64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 206 | throw NotImplementedException("GLASM instruction"); | 197 | throw NotImplementedException("GLASM instruction"); |
| 207 | } | 198 | } |
| 208 | 199 | ||
| 209 | void EmitFPTrunc16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 200 | void EmitFPTrunc16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 210 | throw NotImplementedException("GLASM instruction"); | 201 | throw NotImplementedException("GLASM instruction"); |
| 211 | } | 202 | } |
| 212 | 203 | ||
| 213 | void EmitFPTrunc32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 204 | void EmitFPTrunc32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) { |
| 214 | throw NotImplementedException("GLASM instruction"); | 205 | throw NotImplementedException("GLASM instruction"); |
| 215 | } | 206 | } |
| 216 | 207 | ||
| 217 | void EmitFPTrunc64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) { | 208 | void EmitFPTrunc64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 218 | throw NotImplementedException("GLASM instruction"); | 209 | throw NotImplementedException("GLASM instruction"); |
| 219 | } | 210 | } |
| 220 | 211 | ||
| 221 | void EmitFPOrdEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 212 | void EmitFPOrdEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 222 | [[maybe_unused]] std::string_view rhs) { | 213 | [[maybe_unused]] Register rhs) { |
| 223 | throw NotImplementedException("GLASM instruction"); | 214 | throw NotImplementedException("GLASM instruction"); |
| 224 | } | 215 | } |
| 225 | 216 | ||
| 226 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 217 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 227 | std::string_view rhs) { | 218 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 228 | const std::string ret{ctx.reg_alloc.Define(inst)}; | 219 | ctx.Add("SEQ.F {}.x,{},{};SNE.S {}.x,{},0;", ret, lhs, rhs, ret, ret); |
| 229 | ctx.Add("SEQ.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret); | ||
| 230 | } | 220 | } |
| 231 | 221 | ||
| 232 | void EmitFPOrdEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 222 | void EmitFPOrdEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 233 | [[maybe_unused]] std::string_view rhs) { | 223 | [[maybe_unused]] Register rhs) { |
| 234 | throw NotImplementedException("GLASM instruction"); | 224 | throw NotImplementedException("GLASM instruction"); |
| 235 | } | 225 | } |
| 236 | 226 | ||
| 237 | void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 227 | void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 238 | [[maybe_unused]] std::string_view rhs) { | 228 | [[maybe_unused]] Register rhs) { |
| 239 | throw NotImplementedException("GLASM instruction"); | 229 | throw NotImplementedException("GLASM instruction"); |
| 240 | } | 230 | } |
| 241 | 231 | ||
| 242 | void EmitFPUnordEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 232 | void EmitFPUnordEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 243 | [[maybe_unused]] std::string_view rhs) { | 233 | [[maybe_unused]] ScalarF32 rhs) { |
| 244 | throw NotImplementedException("GLASM instruction"); | 234 | throw NotImplementedException("GLASM instruction"); |
| 245 | } | 235 | } |
| 246 | 236 | ||
| 247 | void EmitFPUnordEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 237 | void EmitFPUnordEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 248 | [[maybe_unused]] std::string_view rhs) { | 238 | [[maybe_unused]] Register rhs) { |
| 249 | throw NotImplementedException("GLASM instruction"); | 239 | throw NotImplementedException("GLASM instruction"); |
| 250 | } | 240 | } |
| 251 | 241 | ||
| 252 | void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 242 | void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 253 | [[maybe_unused]] std::string_view rhs) { | 243 | [[maybe_unused]] Register rhs) { |
| 254 | throw NotImplementedException("GLASM instruction"); | 244 | throw NotImplementedException("GLASM instruction"); |
| 255 | } | 245 | } |
| 256 | 246 | ||
| 257 | void EmitFPOrdNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 247 | void EmitFPOrdNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 258 | [[maybe_unused]] std::string_view rhs) { | 248 | [[maybe_unused]] ScalarF32 rhs) { |
| 259 | throw NotImplementedException("GLASM instruction"); | 249 | throw NotImplementedException("GLASM instruction"); |
| 260 | } | 250 | } |
| 261 | 251 | ||
| 262 | void EmitFPOrdNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 252 | void EmitFPOrdNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 263 | [[maybe_unused]] std::string_view rhs) { | 253 | [[maybe_unused]] Register rhs) { |
| 264 | throw NotImplementedException("GLASM instruction"); | 254 | throw NotImplementedException("GLASM instruction"); |
| 265 | } | 255 | } |
| 266 | 256 | ||
| 267 | void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 257 | void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 268 | [[maybe_unused]] std::string_view rhs) { | 258 | [[maybe_unused]] Register rhs) { |
| 269 | throw NotImplementedException("GLASM instruction"); | 259 | throw NotImplementedException("GLASM instruction"); |
| 270 | } | 260 | } |
| 271 | 261 | ||
| 272 | void EmitFPUnordNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 262 | void EmitFPUnordNotEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 273 | [[maybe_unused]] std::string_view rhs) { | 263 | [[maybe_unused]] ScalarF32 rhs) { |
| 274 | throw NotImplementedException("GLASM instruction"); | 264 | throw NotImplementedException("GLASM instruction"); |
| 275 | } | 265 | } |
| 276 | 266 | ||
| 277 | void EmitFPUnordNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 267 | void EmitFPUnordNotEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 278 | [[maybe_unused]] std::string_view rhs) { | 268 | [[maybe_unused]] Register rhs) { |
| 279 | throw NotImplementedException("GLASM instruction"); | 269 | throw NotImplementedException("GLASM instruction"); |
| 280 | } | 270 | } |
| 281 | 271 | ||
| 282 | void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 272 | void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 283 | [[maybe_unused]] std::string_view rhs) { | 273 | [[maybe_unused]] Register rhs) { |
| 284 | throw NotImplementedException("GLASM instruction"); | 274 | throw NotImplementedException("GLASM instruction"); |
| 285 | } | 275 | } |
| 286 | 276 | ||
| 287 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 277 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 288 | std::string_view rhs) { | 278 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 289 | const std::string ret{ctx.reg_alloc.Define(inst)}; | 279 | ctx.Add("SLT.F {}.x,{},{};SNE.S {}.x,{}.x,0;", ret, lhs, rhs, ret, ret); |
| 290 | ctx.Add("SLT.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret); | ||
| 291 | } | 280 | } |
| 292 | 281 | ||
| 293 | void EmitFPOrdLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 282 | void EmitFPOrdLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 294 | [[maybe_unused]] std::string_view rhs) { | 283 | [[maybe_unused]] Register rhs) { |
| 295 | throw NotImplementedException("GLASM instruction"); | 284 | throw NotImplementedException("GLASM instruction"); |
| 296 | } | 285 | } |
| 297 | 286 | ||
| 298 | void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 287 | void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 299 | [[maybe_unused]] std::string_view rhs) { | 288 | [[maybe_unused]] Register rhs) { |
| 300 | throw NotImplementedException("GLASM instruction"); | 289 | throw NotImplementedException("GLASM instruction"); |
| 301 | } | 290 | } |
| 302 | 291 | ||
| 303 | void EmitFPUnordLessThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 292 | void EmitFPUnordLessThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 304 | [[maybe_unused]] std::string_view rhs) { | 293 | [[maybe_unused]] ScalarF32 rhs) { |
| 305 | throw NotImplementedException("GLASM instruction"); | 294 | throw NotImplementedException("GLASM instruction"); |
| 306 | } | 295 | } |
| 307 | 296 | ||
| 308 | void EmitFPUnordLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs, | 297 | void EmitFPUnordLessThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 309 | [[maybe_unused]] std::string_view rhs) { | 298 | [[maybe_unused]] Register rhs) { |
| 310 | throw NotImplementedException("GLASM instruction"); | 299 | throw NotImplementedException("GLASM instruction"); |
| 311 | } | 300 | } |
| 312 | 301 | ||
| 313 | void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, | 302 | void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 314 | [[maybe_unused]] std::string_view lhs, | 303 | [[maybe_unused]] Register rhs) { |
| 315 | [[maybe_unused]] std::string_view rhs) { | ||
| 316 | throw NotImplementedException("GLASM instruction"); | 304 | throw NotImplementedException("GLASM instruction"); |
| 317 | } | 305 | } |
| 318 | 306 | ||
| 319 | void EmitFPOrdGreaterThan32([[maybe_unused]] EmitContext& ctx, | 307 | void EmitFPOrdGreaterThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 320 | [[maybe_unused]] std::string_view lhs, | 308 | [[maybe_unused]] ScalarF32 rhs) { |
| 321 | [[maybe_unused]] std::string_view rhs) { | ||
| 322 | throw NotImplementedException("GLASM instruction"); | 309 | throw NotImplementedException("GLASM instruction"); |
| 323 | } | 310 | } |
| 324 | 311 | ||
| 325 | void EmitFPOrdGreaterThan64([[maybe_unused]] EmitContext& ctx, | 312 | void EmitFPOrdGreaterThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 326 | [[maybe_unused]] std::string_view lhs, | 313 | [[maybe_unused]] Register rhs) { |
| 327 | [[maybe_unused]] std::string_view rhs) { | ||
| 328 | throw NotImplementedException("GLASM instruction"); | 314 | throw NotImplementedException("GLASM instruction"); |
| 329 | } | 315 | } |
| 330 | 316 | ||
| 331 | void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, | 317 | void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 332 | [[maybe_unused]] std::string_view lhs, | 318 | [[maybe_unused]] Register rhs) { |
| 333 | [[maybe_unused]] std::string_view rhs) { | ||
| 334 | throw NotImplementedException("GLASM instruction"); | 319 | throw NotImplementedException("GLASM instruction"); |
| 335 | } | 320 | } |
| 336 | 321 | ||
| 337 | void EmitFPUnordGreaterThan32([[maybe_unused]] EmitContext& ctx, | 322 | void EmitFPUnordGreaterThan32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 338 | [[maybe_unused]] std::string_view lhs, | 323 | [[maybe_unused]] ScalarF32 rhs) { |
| 339 | [[maybe_unused]] std::string_view rhs) { | ||
| 340 | throw NotImplementedException("GLASM instruction"); | 324 | throw NotImplementedException("GLASM instruction"); |
| 341 | } | 325 | } |
| 342 | 326 | ||
| 343 | void EmitFPUnordGreaterThan64([[maybe_unused]] EmitContext& ctx, | 327 | void EmitFPUnordGreaterThan64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 344 | [[maybe_unused]] std::string_view lhs, | 328 | [[maybe_unused]] Register rhs) { |
| 345 | [[maybe_unused]] std::string_view rhs) { | ||
| 346 | throw NotImplementedException("GLASM instruction"); | 329 | throw NotImplementedException("GLASM instruction"); |
| 347 | } | 330 | } |
| 348 | 331 | ||
| 349 | void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, | 332 | void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 350 | [[maybe_unused]] std::string_view lhs, | 333 | [[maybe_unused]] Register rhs) { |
| 351 | [[maybe_unused]] std::string_view rhs) { | ||
| 352 | throw NotImplementedException("GLASM instruction"); | 334 | throw NotImplementedException("GLASM instruction"); |
| 353 | } | 335 | } |
| 354 | 336 | ||
| 355 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 337 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) { |
| 356 | std::string_view rhs) { | 338 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 357 | const std::string ret{ctx.reg_alloc.Define(inst)}; | 339 | ctx.Add("SLE.F {}.x,{},{};SNE.S {}.x,{}.x,0;", ret, lhs, rhs, ret, ret); |
| 358 | ctx.Add("SLE.F {},{},{};SNE.S {},{},0;", ret, lhs, rhs, ret, ret); | ||
| 359 | } | 340 | } |
| 360 | 341 | ||
| 361 | void EmitFPOrdLessThanEqual64([[maybe_unused]] EmitContext& ctx, | 342 | void EmitFPOrdLessThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 362 | [[maybe_unused]] std::string_view lhs, | 343 | [[maybe_unused]] Register rhs) { |
| 363 | [[maybe_unused]] std::string_view rhs) { | ||
| 364 | throw NotImplementedException("GLASM instruction"); | 344 | throw NotImplementedException("GLASM instruction"); |
| 365 | } | 345 | } |
| 366 | 346 | ||
| 367 | void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, | 347 | void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 368 | [[maybe_unused]] std::string_view lhs, | 348 | [[maybe_unused]] Register rhs) { |
| 369 | [[maybe_unused]] std::string_view rhs) { | ||
| 370 | throw NotImplementedException("GLASM instruction"); | 349 | throw NotImplementedException("GLASM instruction"); |
| 371 | } | 350 | } |
| 372 | 351 | ||
| 373 | void EmitFPUnordLessThanEqual32([[maybe_unused]] EmitContext& ctx, | 352 | void EmitFPUnordLessThanEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 374 | [[maybe_unused]] std::string_view lhs, | 353 | [[maybe_unused]] ScalarF32 rhs) { |
| 375 | [[maybe_unused]] std::string_view rhs) { | ||
| 376 | throw NotImplementedException("GLASM instruction"); | 354 | throw NotImplementedException("GLASM instruction"); |
| 377 | } | 355 | } |
| 378 | 356 | ||
| 379 | void EmitFPUnordLessThanEqual64([[maybe_unused]] EmitContext& ctx, | 357 | void EmitFPUnordLessThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 380 | [[maybe_unused]] std::string_view lhs, | 358 | [[maybe_unused]] Register rhs) { |
| 381 | [[maybe_unused]] std::string_view rhs) { | ||
| 382 | throw NotImplementedException("GLASM instruction"); | 359 | throw NotImplementedException("GLASM instruction"); |
| 383 | } | 360 | } |
| 384 | 361 | ||
| 385 | void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, | 362 | void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 386 | [[maybe_unused]] std::string_view lhs, | 363 | [[maybe_unused]] Register rhs) { |
| 387 | [[maybe_unused]] std::string_view rhs) { | ||
| 388 | throw NotImplementedException("GLASM instruction"); | 364 | throw NotImplementedException("GLASM instruction"); |
| 389 | } | 365 | } |
| 390 | 366 | ||
| 391 | void EmitFPOrdGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, | 367 | void EmitFPOrdGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 lhs, |
| 392 | [[maybe_unused]] std::string_view lhs, | 368 | [[maybe_unused]] ScalarF32 rhs) { |
| 393 | [[maybe_unused]] std::string_view rhs) { | ||
| 394 | throw NotImplementedException("GLASM instruction"); | 369 | throw NotImplementedException("GLASM instruction"); |
| 395 | } | 370 | } |
| 396 | 371 | ||
| 397 | void EmitFPOrdGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, | 372 | void EmitFPOrdGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 398 | [[maybe_unused]] std::string_view lhs, | 373 | [[maybe_unused]] Register rhs) { |
| 399 | [[maybe_unused]] std::string_view rhs) { | ||
| 400 | throw NotImplementedException("GLASM instruction"); | 374 | throw NotImplementedException("GLASM instruction"); |
| 401 | } | 375 | } |
| 402 | 376 | ||
| 403 | void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, | 377 | void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 404 | [[maybe_unused]] std::string_view lhs, | 378 | [[maybe_unused]] Register rhs) { |
| 405 | [[maybe_unused]] std::string_view rhs) { | ||
| 406 | throw NotImplementedException("GLASM instruction"); | 379 | throw NotImplementedException("GLASM instruction"); |
| 407 | } | 380 | } |
| 408 | 381 | ||
| 409 | void EmitFPUnordGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, | 382 | void EmitFPUnordGreaterThanEqual32([[maybe_unused]] EmitContext& ctx, |
| 410 | [[maybe_unused]] std::string_view lhs, | 383 | [[maybe_unused]] ScalarF32 lhs, [[maybe_unused]] ScalarF32 rhs) { |
| 411 | [[maybe_unused]] std::string_view rhs) { | ||
| 412 | throw NotImplementedException("GLASM instruction"); | 384 | throw NotImplementedException("GLASM instruction"); |
| 413 | } | 385 | } |
| 414 | 386 | ||
| 415 | void EmitFPUnordGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, | 387 | void EmitFPUnordGreaterThanEqual64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs, |
| 416 | [[maybe_unused]] std::string_view lhs, | 388 | [[maybe_unused]] Register rhs) { |
| 417 | [[maybe_unused]] std::string_view rhs) { | ||
| 418 | throw NotImplementedException("GLASM instruction"); | 389 | throw NotImplementedException("GLASM instruction"); |
| 419 | } | 390 | } |
| 420 | 391 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index 222285021..6db76bf46 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -4,9 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <string_view> | ||
| 8 | |||
| 9 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | #include "shader_recompiler/backend/glasm/reg_alloc.h" | ||
| 10 | 9 | ||
| 11 | namespace Shader::IR { | 10 | namespace Shader::IR { |
| 12 | enum class Attribute : u64; | 11 | enum class Attribute : u64; |
| @@ -23,15 +22,14 @@ class EmitContext; | |||
| 23 | void EmitPhi(EmitContext& ctx, IR::Inst& inst); | 22 | void EmitPhi(EmitContext& ctx, IR::Inst& inst); |
| 24 | void EmitVoid(EmitContext& ctx); | 23 | void EmitVoid(EmitContext& ctx); |
| 25 | void EmitIdentity(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 24 | void EmitIdentity(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 26 | void EmitBranch(EmitContext& ctx, std::string_view label); | 25 | void EmitBranch(EmitContext& ctx); |
| 27 | void EmitBranchConditional(EmitContext& ctx, std::string_view condition, | 26 | void EmitBranchConditional(EmitContext& ctx); |
| 28 | std::string_view true_label, std::string_view false_label); | 27 | void EmitLoopMerge(EmitContext& ctx); |
| 29 | void EmitLoopMerge(EmitContext& ctx, std::string_view merge_label, std::string_view continue_label); | 28 | void EmitSelectionMerge(EmitContext& ctx); |
| 30 | void EmitSelectionMerge(EmitContext& ctx, std::string_view merge_label); | ||
| 31 | void EmitReturn(EmitContext& ctx); | 29 | void EmitReturn(EmitContext& ctx); |
| 32 | void EmitJoin(EmitContext& ctx); | 30 | void EmitJoin(EmitContext& ctx); |
| 33 | void EmitUnreachable(EmitContext& ctx); | 31 | void EmitUnreachable(EmitContext& ctx); |
| 34 | void EmitDemoteToHelperInvocation(EmitContext& ctx, std::string_view continue_label); | 32 | void EmitDemoteToHelperInvocation(EmitContext& ctx); |
| 35 | void EmitBarrier(EmitContext& ctx); | 33 | void EmitBarrier(EmitContext& ctx); |
| 36 | void EmitWorkgroupMemoryBarrier(EmitContext& ctx); | 34 | void EmitWorkgroupMemoryBarrier(EmitContext& ctx); |
| 37 | void EmitDeviceMemoryBarrier(EmitContext& ctx); | 35 | void EmitDeviceMemoryBarrier(EmitContext& ctx); |
| @@ -47,32 +45,22 @@ void EmitSetGotoVariable(EmitContext& ctx); | |||
| 47 | void EmitGetGotoVariable(EmitContext& ctx); | 45 | void EmitGetGotoVariable(EmitContext& ctx); |
| 48 | void EmitSetIndirectBranchVariable(EmitContext& ctx); | 46 | void EmitSetIndirectBranchVariable(EmitContext& ctx); |
| 49 | void EmitGetIndirectBranchVariable(EmitContext& ctx); | 47 | void EmitGetIndirectBranchVariable(EmitContext& ctx); |
| 50 | void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 48 | void EmitGetCbufU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 51 | const IR::Value& offset); | 49 | void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 52 | void EmitGetCbufS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 50 | void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 53 | const IR::Value& offset); | 51 | void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 54 | void EmitGetCbufU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 52 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 55 | const IR::Value& offset); | 53 | void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 56 | void EmitGetCbufS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 54 | void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset); |
| 57 | const IR::Value& offset); | 55 | void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, ScalarU32 vertex); |
| 58 | void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 56 | void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value, ScalarU32 vertex); |
| 59 | const IR::Value& offset); | 57 | void EmitGetAttributeIndexed(EmitContext& ctx, ScalarU32 offset, ScalarU32 vertex); |
| 60 | void EmitGetCbufF32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 58 | void EmitSetAttributeIndexed(EmitContext& ctx, ScalarU32 offset, ScalarF32 value, ScalarU32 vertex); |
| 61 | const IR::Value& offset); | ||
| 62 | void EmitGetCbufU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | ||
| 63 | const IR::Value& offset); | ||
| 64 | void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, | ||
| 65 | std::string_view vertex); | ||
| 66 | void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view value, | ||
| 67 | std::string_view vertex); | ||
| 68 | void EmitGetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view vertex); | ||
| 69 | void EmitSetAttributeIndexed(EmitContext& ctx, std::string_view offset, std::string_view value, | ||
| 70 | std::string_view vertex); | ||
| 71 | void EmitGetPatch(EmitContext& ctx, IR::Patch patch); | 59 | void EmitGetPatch(EmitContext& ctx, IR::Patch patch); |
| 72 | void EmitSetPatch(EmitContext& ctx, IR::Patch patch, std::string_view value); | 60 | void EmitSetPatch(EmitContext& ctx, IR::Patch patch, ScalarF32 value); |
| 73 | void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, std::string_view value); | 61 | void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, ScalarF32 value); |
| 74 | void EmitSetSampleMask(EmitContext& ctx, std::string_view value); | 62 | void EmitSetSampleMask(EmitContext& ctx, ScalarF32 value); |
| 75 | void EmitSetFragDepth(EmitContext& ctx, std::string_view value); | 63 | void EmitSetFragDepth(EmitContext& ctx, ScalarF32 value); |
| 76 | void EmitGetZFlag(EmitContext& ctx); | 64 | void EmitGetZFlag(EmitContext& ctx); |
| 77 | void EmitGetSFlag(EmitContext& ctx); | 65 | void EmitGetSFlag(EmitContext& ctx); |
| 78 | void EmitGetCFlag(EmitContext& ctx); | 66 | void EmitGetCFlag(EmitContext& ctx); |
| @@ -82,13 +70,13 @@ void EmitSetSFlag(EmitContext& ctx); | |||
| 82 | void EmitSetCFlag(EmitContext& ctx); | 70 | void EmitSetCFlag(EmitContext& ctx); |
| 83 | void EmitSetOFlag(EmitContext& ctx); | 71 | void EmitSetOFlag(EmitContext& ctx); |
| 84 | void EmitWorkgroupId(EmitContext& ctx); | 72 | void EmitWorkgroupId(EmitContext& ctx); |
| 85 | void EmitLocalInvocationId(EmitContext& ctx); | 73 | void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst); |
| 86 | void EmitInvocationId(EmitContext& ctx); | 74 | void EmitInvocationId(EmitContext& ctx); |
| 87 | void EmitSampleId(EmitContext& ctx); | 75 | void EmitSampleId(EmitContext& ctx); |
| 88 | void EmitIsHelperInvocation(EmitContext& ctx); | 76 | void EmitIsHelperInvocation(EmitContext& ctx); |
| 89 | void EmitYDirection(EmitContext& ctx); | 77 | void EmitYDirection(EmitContext& ctx); |
| 90 | void EmitLoadLocal(EmitContext& ctx, std::string_view word_offset); | 78 | void EmitLoadLocal(EmitContext& ctx, ScalarU32 word_offset); |
| 91 | void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_view value); | 79 | void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value); |
| 92 | void EmitUndefU1(EmitContext& ctx); | 80 | void EmitUndefU1(EmitContext& ctx); |
| 93 | void EmitUndefU8(EmitContext& ctx); | 81 | void EmitUndefU8(EmitContext& ctx); |
| 94 | void EmitUndefU16(EmitContext& ctx); | 82 | void EmitUndefU16(EmitContext& ctx); |
| @@ -98,368 +86,321 @@ void EmitLoadGlobalU8(EmitContext& ctx); | |||
| 98 | void EmitLoadGlobalS8(EmitContext& ctx); | 86 | void EmitLoadGlobalS8(EmitContext& ctx); |
| 99 | void EmitLoadGlobalU16(EmitContext& ctx); | 87 | void EmitLoadGlobalU16(EmitContext& ctx); |
| 100 | void EmitLoadGlobalS16(EmitContext& ctx); | 88 | void EmitLoadGlobalS16(EmitContext& ctx); |
| 101 | void EmitLoadGlobal32(EmitContext& ctx, std::string_view address); | 89 | void EmitLoadGlobal32(EmitContext& ctx, Register address); |
| 102 | void EmitLoadGlobal64(EmitContext& ctx, std::string_view address); | 90 | void EmitLoadGlobal64(EmitContext& ctx, Register address); |
| 103 | void EmitLoadGlobal128(EmitContext& ctx, std::string_view address); | 91 | void EmitLoadGlobal128(EmitContext& ctx, Register address); |
| 104 | void EmitWriteGlobalU8(EmitContext& ctx); | 92 | void EmitWriteGlobalU8(EmitContext& ctx); |
| 105 | void EmitWriteGlobalS8(EmitContext& ctx); | 93 | void EmitWriteGlobalS8(EmitContext& ctx); |
| 106 | void EmitWriteGlobalU16(EmitContext& ctx); | 94 | void EmitWriteGlobalU16(EmitContext& ctx); |
| 107 | void EmitWriteGlobalS16(EmitContext& ctx); | 95 | void EmitWriteGlobalS16(EmitContext& ctx); |
| 108 | void EmitWriteGlobal32(EmitContext& ctx, std::string_view address, std::string_view value); | 96 | void EmitWriteGlobal32(EmitContext& ctx, Register address, ScalarU32 value); |
| 109 | void EmitWriteGlobal64(EmitContext& ctx, std::string_view address, std::string_view value); | 97 | void EmitWriteGlobal64(EmitContext& ctx, Register address, Register value); |
| 110 | void EmitWriteGlobal128(EmitContext& ctx, std::string_view address, std::string_view value); | 98 | void EmitWriteGlobal128(EmitContext& ctx, Register address, Register value); |
| 111 | void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 99 | void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 112 | std::string_view offset); | 100 | ScalarU32 offset); |
| 113 | void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 101 | void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 114 | std::string_view offset); | 102 | ScalarU32 offset); |
| 115 | void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 103 | void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 116 | std::string_view offset); | 104 | ScalarU32 offset); |
| 117 | void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 105 | void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 118 | std::string_view offset); | 106 | ScalarU32 offset); |
| 119 | void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 107 | void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 120 | std::string_view offset); | 108 | ScalarU32 offset); |
| 121 | void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 109 | void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 122 | std::string_view offset); | 110 | ScalarU32 offset); |
| 123 | void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 111 | void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 124 | std::string_view offset); | 112 | ScalarU32 offset); |
| 125 | void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 113 | void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 126 | std::string_view value); | 114 | ScalarU32 value); |
| 127 | void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 115 | void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 128 | std::string_view value); | 116 | ScalarS32 value); |
| 129 | void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 117 | void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 130 | std::string_view value); | 118 | ScalarU32 value); |
| 131 | void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 119 | void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 132 | std::string_view value); | 120 | ScalarS32 value); |
| 133 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 121 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 134 | std::string_view value); | 122 | ScalarU32 value); |
| 135 | void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 123 | void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 136 | std::string_view value); | 124 | Register value); |
| 137 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 125 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 138 | std::string_view value); | 126 | Register value); |
| 139 | void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset); | 127 | void EmitLoadSharedU8(EmitContext& ctx, ScalarU32 offset); |
| 140 | void EmitLoadSharedS8(EmitContext& ctx, std::string_view offset); | 128 | void EmitLoadSharedS8(EmitContext& ctx, ScalarU32 offset); |
| 141 | void EmitLoadSharedU16(EmitContext& ctx, std::string_view offset); | 129 | void EmitLoadSharedU16(EmitContext& ctx, ScalarU32 offset); |
| 142 | void EmitLoadSharedS16(EmitContext& ctx, std::string_view offset); | 130 | void EmitLoadSharedS16(EmitContext& ctx, ScalarU32 offset); |
| 143 | void EmitLoadSharedU32(EmitContext& ctx, std::string_view offset); | 131 | void EmitLoadSharedU32(EmitContext& ctx, ScalarU32 offset); |
| 144 | void EmitLoadSharedU64(EmitContext& ctx, std::string_view offset); | 132 | void EmitLoadSharedU64(EmitContext& ctx, ScalarU32 offset); |
| 145 | void EmitLoadSharedU128(EmitContext& ctx, std::string_view offset); | 133 | void EmitLoadSharedU128(EmitContext& ctx, ScalarU32 offset); |
| 146 | void EmitWriteSharedU8(EmitContext& ctx, std::string_view offset, std::string_view value); | 134 | void EmitWriteSharedU8(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
| 147 | void EmitWriteSharedU16(EmitContext& ctx, std::string_view offset, std::string_view value); | 135 | void EmitWriteSharedU16(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
| 148 | void EmitWriteSharedU32(EmitContext& ctx, std::string_view offset, std::string_view value); | 136 | void EmitWriteSharedU32(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
| 149 | void EmitWriteSharedU64(EmitContext& ctx, std::string_view offset, std::string_view value); | 137 | void EmitWriteSharedU64(EmitContext& ctx, ScalarU32 offset, Register value); |
| 150 | void EmitWriteSharedU128(EmitContext& ctx, std::string_view offset, std::string_view value); | 138 | void EmitWriteSharedU128(EmitContext& ctx, ScalarU32 offset, Register value); |
| 151 | void EmitCompositeConstructU32x2(EmitContext& ctx, std::string_view e1, std::string_view e2); | 139 | void EmitCompositeConstructU32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, |
| 152 | void EmitCompositeConstructU32x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | 140 | const IR::Value& e2); |
| 153 | std::string_view e3); | 141 | void EmitCompositeConstructU32x3(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, |
| 154 | void EmitCompositeConstructU32x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | 142 | const IR::Value& e2, const IR::Value& e3); |
| 155 | std::string_view e3, std::string_view e4); | 143 | void EmitCompositeConstructU32x4(EmitContext& ctx, IR::Inst& inst, const IR::Value& e1, |
| 156 | void EmitCompositeExtractU32x2(EmitContext& ctx, std::string_view composite, u32 index); | 144 | const IR::Value& e2, const IR::Value& e3, const IR::Value& e4); |
| 157 | void EmitCompositeExtractU32x3(EmitContext& ctx, std::string_view composite, u32 index); | 145 | void EmitCompositeExtractU32x2(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index); |
| 158 | void EmitCompositeExtractU32x4(EmitContext& ctx, std::string_view composite, u32 index); | 146 | void EmitCompositeExtractU32x3(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index); |
| 159 | void EmitCompositeInsertU32x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 147 | void EmitCompositeExtractU32x4(EmitContext& ctx, IR::Inst& inst, Register composite, u32 index); |
| 160 | u32 index); | 148 | void EmitCompositeInsertU32x2(EmitContext& ctx, Register composite, ScalarU32 object, u32 index); |
| 161 | void EmitCompositeInsertU32x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 149 | void EmitCompositeInsertU32x3(EmitContext& ctx, Register composite, ScalarU32 object, u32 index); |
| 162 | u32 index); | 150 | void EmitCompositeInsertU32x4(EmitContext& ctx, Register composite, ScalarU32 object, u32 index); |
| 163 | void EmitCompositeInsertU32x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 151 | void EmitCompositeConstructF16x2(EmitContext& ctx, Register e1, Register e2); |
| 164 | u32 index); | 152 | void EmitCompositeConstructF16x3(EmitContext& ctx, Register e1, Register e2, Register e3); |
| 165 | void EmitCompositeConstructF16x2(EmitContext& ctx, std::string_view e1, std::string_view e2); | 153 | void EmitCompositeConstructF16x4(EmitContext& ctx, Register e1, Register e2, Register e3, |
| 166 | void EmitCompositeConstructF16x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | 154 | Register e4); |
| 167 | std::string_view e3); | 155 | void EmitCompositeExtractF16x2(EmitContext& ctx, Register composite, u32 index); |
| 168 | void EmitCompositeConstructF16x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | 156 | void EmitCompositeExtractF16x3(EmitContext& ctx, Register composite, u32 index); |
| 169 | std::string_view e3, std::string_view e4); | 157 | void EmitCompositeExtractF16x4(EmitContext& ctx, Register composite, u32 index); |
| 170 | void EmitCompositeExtractF16x2(EmitContext& ctx, std::string_view composite, u32 index); | 158 | void EmitCompositeInsertF16x2(EmitContext& ctx, Register composite, Register object, u32 index); |
| 171 | void EmitCompositeExtractF16x3(EmitContext& ctx, std::string_view composite, u32 index); | 159 | void EmitCompositeInsertF16x3(EmitContext& ctx, Register composite, Register object, u32 index); |
| 172 | void EmitCompositeExtractF16x4(EmitContext& ctx, std::string_view composite, u32 index); | 160 | void EmitCompositeInsertF16x4(EmitContext& ctx, Register composite, Register object, u32 index); |
| 173 | void EmitCompositeInsertF16x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 161 | void EmitCompositeConstructF32x2(EmitContext& ctx, ScalarF32 e1, ScalarF32 e2); |
| 174 | u32 index); | 162 | void EmitCompositeConstructF32x3(EmitContext& ctx, ScalarF32 e1, ScalarF32 e2, ScalarF32 e3); |
| 175 | void EmitCompositeInsertF16x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 163 | void EmitCompositeConstructF32x4(EmitContext& ctx, ScalarF32 e1, ScalarF32 e2, ScalarF32 e3, |
| 176 | u32 index); | 164 | ScalarF32 e4); |
| 177 | void EmitCompositeInsertF16x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 165 | void EmitCompositeExtractF32x2(EmitContext& ctx, Register composite, u32 index); |
| 178 | u32 index); | 166 | void EmitCompositeExtractF32x3(EmitContext& ctx, Register composite, u32 index); |
| 179 | void EmitCompositeConstructF32x2(EmitContext& ctx, std::string_view e1, std::string_view e2); | 167 | void EmitCompositeExtractF32x4(EmitContext& ctx, Register composite, u32 index); |
| 180 | void EmitCompositeConstructF32x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | 168 | void EmitCompositeInsertF32x2(EmitContext& ctx, Register composite, ScalarF32 object, u32 index); |
| 181 | std::string_view e3); | 169 | void EmitCompositeInsertF32x3(EmitContext& ctx, Register composite, ScalarF32 object, u32 index); |
| 182 | void EmitCompositeConstructF32x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | 170 | void EmitCompositeInsertF32x4(EmitContext& ctx, Register composite, ScalarF32 object, u32 index); |
| 183 | std::string_view e3, std::string_view e4); | ||
| 184 | void EmitCompositeExtractF32x2(EmitContext& ctx, std::string_view composite, u32 index); | ||
| 185 | void EmitCompositeExtractF32x3(EmitContext& ctx, std::string_view composite, u32 index); | ||
| 186 | void EmitCompositeExtractF32x4(EmitContext& ctx, std::string_view composite, u32 index); | ||
| 187 | void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 188 | u32 index); | ||
| 189 | void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 190 | u32 index); | ||
| 191 | void EmitCompositeInsertF32x4(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 192 | u32 index); | ||
| 193 | void EmitCompositeConstructF64x2(EmitContext& ctx); | 171 | void EmitCompositeConstructF64x2(EmitContext& ctx); |
| 194 | void EmitCompositeConstructF64x3(EmitContext& ctx); | 172 | void EmitCompositeConstructF64x3(EmitContext& ctx); |
| 195 | void EmitCompositeConstructF64x4(EmitContext& ctx); | 173 | void EmitCompositeConstructF64x4(EmitContext& ctx); |
| 196 | void EmitCompositeExtractF64x2(EmitContext& ctx); | 174 | void EmitCompositeExtractF64x2(EmitContext& ctx); |
| 197 | void EmitCompositeExtractF64x3(EmitContext& ctx); | 175 | void EmitCompositeExtractF64x3(EmitContext& ctx); |
| 198 | void EmitCompositeExtractF64x4(EmitContext& ctx); | 176 | void EmitCompositeExtractF64x4(EmitContext& ctx); |
| 199 | void EmitCompositeInsertF64x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 177 | void EmitCompositeInsertF64x2(EmitContext& ctx, Register composite, Register object, u32 index); |
| 200 | u32 index); | 178 | void EmitCompositeInsertF64x3(EmitContext& ctx, Register composite, Register object, u32 index); |
| 201 | void EmitCompositeInsertF64x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 179 | void EmitCompositeInsertF64x4(EmitContext& ctx, Register composite, Register object, u32 index); |
| 202 | u32 index); | 180 | void EmitSelectU1(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 203 | void EmitCompositeInsertF64x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 181 | void EmitSelectU8(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 204 | u32 index); | 182 | void EmitSelectU16(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 205 | void EmitSelectU1(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 183 | void EmitSelectU32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 206 | std::string_view false_value); | 184 | void EmitSelectU64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 207 | void EmitSelectU8(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 185 | void EmitSelectF16(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 208 | std::string_view false_value); | 186 | void EmitSelectF32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value); |
| 209 | void EmitSelectU16(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 187 | void EmitSelectF64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value); |
| 210 | std::string_view false_value); | ||
| 211 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | ||
| 212 | std::string_view true_value, std::string_view false_value); | ||
| 213 | void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view true_value, | ||
| 214 | std::string_view false_value); | ||
| 215 | void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, | ||
| 216 | std::string_view false_value); | ||
| 217 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | ||
| 218 | std::string_view true_value, std::string_view false_value); | ||
| 219 | void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value, | ||
| 220 | std::string_view false_value); | ||
| 221 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 188 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 222 | void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 189 | void EmitBitCastU32F32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 223 | void EmitBitCastU64F64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 190 | void EmitBitCastU64F64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 224 | void EmitBitCastF16U16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 191 | void EmitBitCastF16U16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 225 | void EmitBitCastF32U32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 192 | void EmitBitCastF32U32(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 226 | void EmitBitCastF64U64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 193 | void EmitBitCastF64U64(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
| 227 | void EmitPackUint2x32(EmitContext& ctx, std::string_view value); | 194 | void EmitPackUint2x32(EmitContext& ctx, Register value); |
| 228 | void EmitUnpackUint2x32(EmitContext& ctx, std::string_view value); | 195 | void EmitUnpackUint2x32(EmitContext& ctx, Register value); |
| 229 | void EmitPackFloat2x16(EmitContext& ctx, std::string_view value); | 196 | void EmitPackFloat2x16(EmitContext& ctx, Register value); |
| 230 | void EmitUnpackFloat2x16(EmitContext& ctx, std::string_view value); | 197 | void EmitUnpackFloat2x16(EmitContext& ctx, Register value); |
| 231 | void EmitPackHalf2x16(EmitContext& ctx, std::string_view value); | 198 | void EmitPackHalf2x16(EmitContext& ctx, Register value); |
| 232 | void EmitUnpackHalf2x16(EmitContext& ctx, std::string_view value); | 199 | void EmitUnpackHalf2x16(EmitContext& ctx, Register value); |
| 233 | void EmitPackDouble2x32(EmitContext& ctx, std::string_view value); | 200 | void EmitPackDouble2x32(EmitContext& ctx, Register value); |
| 234 | void EmitUnpackDouble2x32(EmitContext& ctx, std::string_view value); | 201 | void EmitUnpackDouble2x32(EmitContext& ctx, Register value); |
| 235 | void EmitGetZeroFromOp(EmitContext& ctx); | 202 | void EmitGetZeroFromOp(EmitContext& ctx); |
| 236 | void EmitGetSignFromOp(EmitContext& ctx); | 203 | void EmitGetSignFromOp(EmitContext& ctx); |
| 237 | void EmitGetCarryFromOp(EmitContext& ctx); | 204 | void EmitGetCarryFromOp(EmitContext& ctx); |
| 238 | void EmitGetOverflowFromOp(EmitContext& ctx); | 205 | void EmitGetOverflowFromOp(EmitContext& ctx); |
| 239 | void EmitGetSparseFromOp(EmitContext& ctx); | 206 | void EmitGetSparseFromOp(EmitContext& ctx); |
| 240 | void EmitGetInBoundsFromOp(EmitContext& ctx); | 207 | void EmitGetInBoundsFromOp(EmitContext& ctx); |
| 241 | void EmitFPAbs16(EmitContext& ctx, std::string_view value); | 208 | void EmitFPAbs16(EmitContext& ctx, Register value); |
| 242 | void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 209 | void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 243 | void EmitFPAbs64(EmitContext& ctx, std::string_view value); | 210 | void EmitFPAbs64(EmitContext& ctx, Register value); |
| 244 | void EmitFPAdd16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 211 | void EmitFPAdd16(EmitContext& ctx, IR::Inst& inst, Register a, Register b); |
| 245 | void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 212 | void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b); |
| 246 | void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 213 | void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, Register a, Register b); |
| 247 | void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b, | 214 | void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, Register a, Register b, Register c); |
| 248 | std::string_view c); | 215 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, ScalarF32 c); |
| 249 | void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b, | 216 | void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, Register a, Register b, Register c); |
| 250 | std::string_view c); | 217 | void EmitFPMax32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); |
| 251 | void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b, | 218 | void EmitFPMax64(EmitContext& ctx, Register a, Register b); |
| 252 | std::string_view c); | 219 | void EmitFPMin32(EmitContext& ctx, ScalarF32 a, ScalarF32 b); |
| 253 | void EmitFPMax32(EmitContext& ctx, std::string_view a, std::string_view b); | 220 | void EmitFPMin64(EmitContext& ctx, Register a, Register b); |
| 254 | void EmitFPMax64(EmitContext& ctx, std::string_view a, std::string_view b); | 221 | void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, Register a, Register b); |
| 255 | void EmitFPMin32(EmitContext& ctx, std::string_view a, std::string_view b); | 222 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b); |
| 256 | void EmitFPMin64(EmitContext& ctx, std::string_view a, std::string_view b); | 223 | void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, Register a, Register b); |
| 257 | void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 224 | void EmitFPNeg16(EmitContext& ctx, Register value); |
| 258 | void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 225 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value); |
| 259 | void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 226 | void EmitFPNeg64(EmitContext& ctx, Register value); |
| 260 | void EmitFPNeg16(EmitContext& ctx, std::string_view value); | 227 | void EmitFPSin(EmitContext& ctx, ScalarF32 value); |
| 261 | void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 228 | void EmitFPCos(EmitContext& ctx, ScalarF32 value); |
| 262 | void EmitFPNeg64(EmitContext& ctx, std::string_view value); | 229 | void EmitFPExp2(EmitContext& ctx, ScalarF32 value); |
| 263 | void EmitFPSin(EmitContext& ctx, std::string_view value); | 230 | void EmitFPLog2(EmitContext& ctx, ScalarF32 value); |
| 264 | void EmitFPCos(EmitContext& ctx, std::string_view value); | 231 | void EmitFPRecip32(EmitContext& ctx, ScalarF32 value); |
| 265 | void EmitFPExp2(EmitContext& ctx, std::string_view value); | 232 | void EmitFPRecip64(EmitContext& ctx, Register value); |
| 266 | void EmitFPLog2(EmitContext& ctx, std::string_view value); | 233 | void EmitFPRecipSqrt32(EmitContext& ctx, ScalarF32 value); |
| 267 | void EmitFPRecip32(EmitContext& ctx, std::string_view value); | 234 | void EmitFPRecipSqrt64(EmitContext& ctx, Register value); |
| 268 | void EmitFPRecip64(EmitContext& ctx, std::string_view value); | 235 | void EmitFPSqrt(EmitContext& ctx, ScalarF32 value); |
| 269 | void EmitFPRecipSqrt32(EmitContext& ctx, std::string_view value); | 236 | void EmitFPSaturate16(EmitContext& ctx, Register value); |
| 270 | void EmitFPRecipSqrt64(EmitContext& ctx, std::string_view value); | 237 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value); |
| 271 | void EmitFPSqrt(EmitContext& ctx, std::string_view value); | 238 | void EmitFPSaturate64(EmitContext& ctx, Register value); |
| 272 | void EmitFPSaturate16(EmitContext& ctx, std::string_view value); | 239 | void EmitFPClamp16(EmitContext& ctx, Register value, Register min_value, Register max_value); |
| 273 | void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 240 | void EmitFPClamp32(EmitContext& ctx, ScalarF32 value, ScalarF32 min_value, ScalarF32 max_value); |
| 274 | void EmitFPSaturate64(EmitContext& ctx, std::string_view value); | 241 | void EmitFPClamp64(EmitContext& ctx, Register value, Register min_value, Register max_value); |
| 275 | void EmitFPClamp16(EmitContext& ctx, std::string_view value, std::string_view min_value, | 242 | void EmitFPRoundEven16(EmitContext& ctx, Register value); |
| 276 | std::string_view max_value); | 243 | void EmitFPRoundEven32(EmitContext& ctx, ScalarF32 value); |
| 277 | void EmitFPClamp32(EmitContext& ctx, std::string_view value, std::string_view min_value, | 244 | void EmitFPRoundEven64(EmitContext& ctx, Register value); |
| 278 | std::string_view max_value); | 245 | void EmitFPFloor16(EmitContext& ctx, Register value); |
| 279 | void EmitFPClamp64(EmitContext& ctx, std::string_view value, std::string_view min_value, | 246 | void EmitFPFloor32(EmitContext& ctx, ScalarF32 value); |
| 280 | std::string_view max_value); | 247 | void EmitFPFloor64(EmitContext& ctx, Register value); |
| 281 | void EmitFPRoundEven16(EmitContext& ctx, std::string_view value); | 248 | void EmitFPCeil16(EmitContext& ctx, Register value); |
| 282 | void EmitFPRoundEven32(EmitContext& ctx, std::string_view value); | 249 | void EmitFPCeil32(EmitContext& ctx, ScalarF32 value); |
| 283 | void EmitFPRoundEven64(EmitContext& ctx, std::string_view value); | 250 | void EmitFPCeil64(EmitContext& ctx, Register value); |
| 284 | void EmitFPFloor16(EmitContext& ctx, std::string_view value); | 251 | void EmitFPTrunc16(EmitContext& ctx, Register value); |
| 285 | void EmitFPFloor32(EmitContext& ctx, std::string_view value); | 252 | void EmitFPTrunc32(EmitContext& ctx, ScalarF32 value); |
| 286 | void EmitFPFloor64(EmitContext& ctx, std::string_view value); | 253 | void EmitFPTrunc64(EmitContext& ctx, Register value); |
| 287 | void EmitFPCeil16(EmitContext& ctx, std::string_view value); | 254 | void EmitFPOrdEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 288 | void EmitFPCeil32(EmitContext& ctx, std::string_view value); | 255 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 289 | void EmitFPCeil64(EmitContext& ctx, std::string_view value); | 256 | void EmitFPOrdEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 290 | void EmitFPTrunc16(EmitContext& ctx, std::string_view value); | 257 | void EmitFPUnordEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 291 | void EmitFPTrunc32(EmitContext& ctx, std::string_view value); | 258 | void EmitFPUnordEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 292 | void EmitFPTrunc64(EmitContext& ctx, std::string_view value); | 259 | void EmitFPUnordEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 293 | void EmitFPOrdEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 260 | void EmitFPOrdNotEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 294 | void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 261 | void EmitFPOrdNotEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 295 | void EmitFPOrdEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 262 | void EmitFPOrdNotEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 296 | void EmitFPUnordEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 263 | void EmitFPUnordNotEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 297 | void EmitFPUnordEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 264 | void EmitFPUnordNotEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 298 | void EmitFPUnordEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 265 | void EmitFPUnordNotEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 299 | void EmitFPOrdNotEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 266 | void EmitFPOrdLessThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 300 | void EmitFPOrdNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 267 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 301 | void EmitFPOrdNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 268 | void EmitFPOrdLessThan64(EmitContext& ctx, Register lhs, Register rhs); |
| 302 | void EmitFPUnordNotEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 269 | void EmitFPUnordLessThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 303 | void EmitFPUnordNotEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 270 | void EmitFPUnordLessThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 304 | void EmitFPUnordNotEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 271 | void EmitFPUnordLessThan64(EmitContext& ctx, Register lhs, Register rhs); |
| 305 | void EmitFPOrdLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 272 | void EmitFPOrdGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 306 | void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 273 | void EmitFPOrdGreaterThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 307 | std::string_view rhs); | 274 | void EmitFPOrdGreaterThan64(EmitContext& ctx, Register lhs, Register rhs); |
| 308 | void EmitFPOrdLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 275 | void EmitFPUnordGreaterThan16(EmitContext& ctx, Register lhs, Register rhs); |
| 309 | void EmitFPUnordLessThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 276 | void EmitFPUnordGreaterThan32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 310 | void EmitFPUnordLessThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 277 | void EmitFPUnordGreaterThan64(EmitContext& ctx, Register lhs, Register rhs); |
| 311 | void EmitFPUnordLessThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 278 | void EmitFPOrdLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 312 | void EmitFPOrdGreaterThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 279 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs); |
| 313 | void EmitFPOrdGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 280 | void EmitFPOrdLessThanEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 314 | void EmitFPOrdGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 281 | void EmitFPUnordLessThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 315 | void EmitFPUnordGreaterThan16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 282 | void EmitFPUnordLessThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 316 | void EmitFPUnordGreaterThan32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 283 | void EmitFPUnordLessThanEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 317 | void EmitFPUnordGreaterThan64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 284 | void EmitFPOrdGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 318 | void EmitFPOrdLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 285 | void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 319 | void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 286 | void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 320 | std::string_view rhs); | 287 | void EmitFPUnordGreaterThanEqual16(EmitContext& ctx, Register lhs, Register rhs); |
| 321 | void EmitFPOrdLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 288 | void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, ScalarF32 lhs, ScalarF32 rhs); |
| 322 | void EmitFPUnordLessThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 289 | void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, Register lhs, Register rhs); |
| 323 | void EmitFPUnordLessThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 290 | void EmitFPIsNan16(EmitContext& ctx, Register value); |
| 324 | void EmitFPUnordLessThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 291 | void EmitFPIsNan32(EmitContext& ctx, ScalarF32 value); |
| 325 | void EmitFPOrdGreaterThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 292 | void EmitFPIsNan64(EmitContext& ctx, Register value); |
| 326 | void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 293 | void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 327 | void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 294 | void EmitIAdd64(EmitContext& ctx, Register a, Register b); |
| 328 | void EmitFPUnordGreaterThanEqual16(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 295 | void EmitISub32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 329 | void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 296 | void EmitISub64(EmitContext& ctx, Register a, Register b); |
| 330 | void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, std::string_view lhs, std::string_view rhs); | 297 | void EmitIMul32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 331 | void EmitFPIsNan16(EmitContext& ctx, std::string_view value); | 298 | void EmitINeg32(EmitContext& ctx, ScalarS32 value); |
| 332 | void EmitFPIsNan32(EmitContext& ctx, std::string_view value); | 299 | void EmitINeg64(EmitContext& ctx, Register value); |
| 333 | void EmitFPIsNan64(EmitContext& ctx, std::string_view value); | 300 | void EmitIAbs32(EmitContext& ctx, ScalarS32 value); |
| 334 | void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 301 | void EmitIAbs64(EmitContext& ctx, Register value); |
| 335 | void EmitIAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 302 | void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 shift); |
| 336 | void EmitISub32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 303 | void EmitShiftLeftLogical64(EmitContext& ctx, Register base, Register shift); |
| 337 | void EmitISub64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 304 | void EmitShiftRightLogical32(EmitContext& ctx, ScalarU32 base, ScalarU32 shift); |
| 338 | void EmitIMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 305 | void EmitShiftRightLogical64(EmitContext& ctx, Register base, Register shift); |
| 339 | void EmitINeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 306 | void EmitShiftRightArithmetic32(EmitContext& ctx, ScalarS32 base, ScalarS32 shift); |
| 340 | void EmitINeg64(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 307 | void EmitShiftRightArithmetic64(EmitContext& ctx, Register base, Register shift); |
| 341 | void EmitIAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 308 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 342 | void EmitIAbs64(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 309 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 343 | void EmitShiftLeftLogical32(EmitContext& ctx, std::string_view base, std::string_view shift); | 310 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b); |
| 344 | void EmitShiftLeftLogical64(EmitContext& ctx, std::string_view base, std::string_view shift); | 311 | void EmitBitFieldInsert(EmitContext& ctx, ScalarS32 base, ScalarS32 insert, ScalarS32 offset, |
| 345 | void EmitShiftRightLogical32(EmitContext& ctx, std::string_view base, std::string_view shift); | 312 | ScalarS32 count); |
| 346 | void EmitShiftRightLogical64(EmitContext& ctx, std::string_view base, std::string_view shift); | 313 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 offset, |
| 347 | void EmitShiftRightArithmetic32(EmitContext& ctx, std::string_view base, std::string_view shift); | 314 | ScalarS32 count); |
| 348 | void EmitShiftRightArithmetic64(EmitContext& ctx, std::string_view base, std::string_view shift); | 315 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 offset, |
| 349 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 316 | ScalarU32 count); |
| 350 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 317 | void EmitBitReverse32(EmitContext& ctx, ScalarS32 value); |
| 351 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 318 | void EmitBitCount32(EmitContext& ctx, ScalarS32 value); |
| 352 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 319 | void EmitBitwiseNot32(EmitContext& ctx, ScalarS32 value); |
| 353 | std::string_view insert, std::string_view offset, std::string_view count); | 320 | void EmitFindSMsb32(EmitContext& ctx, ScalarS32 value); |
| 354 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 321 | void EmitFindUMsb32(EmitContext& ctx, ScalarU32 value); |
| 355 | std::string_view offset, std::string_view count); | 322 | void EmitSMin32(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| 356 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 323 | void EmitUMin32(EmitContext& ctx, ScalarU32 a, ScalarU32 b); |
| 357 | std::string_view offset, std::string_view count); | 324 | void EmitSMax32(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| 358 | void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 325 | void EmitUMax32(EmitContext& ctx, ScalarU32 a, ScalarU32 b); |
| 359 | void EmitBitCount32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 326 | void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value, ScalarS32 min, ScalarS32 max); |
| 360 | void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 327 | void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 min, ScalarU32 max); |
| 361 | void EmitFindSMsb32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 328 | void EmitSLessThan(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 362 | void EmitFindUMsb32(EmitContext& ctx, IR::Inst& inst, std::string_view value); | 329 | void EmitULessThan(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); |
| 363 | void EmitSMin32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 330 | void EmitIEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 364 | void EmitUMin32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 331 | void EmitSLessThanEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 365 | void EmitSMax32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 332 | void EmitULessThanEqual(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); |
| 366 | void EmitUMax32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b); | 333 | void EmitSGreaterThan(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 367 | void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min, | 334 | void EmitUGreaterThan(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); |
| 368 | std::string_view max); | 335 | void EmitINotEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 369 | void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min, | 336 | void EmitSGreaterThanEqual(EmitContext& ctx, ScalarS32 lhs, ScalarS32 rhs); |
| 370 | std::string_view max); | 337 | void EmitUGreaterThanEqual(EmitContext& ctx, ScalarU32 lhs, ScalarU32 rhs); |
| 371 | void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 338 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 372 | void EmitULessThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 339 | void EmitSharedAtomicSMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value); |
| 373 | void EmitIEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 340 | void EmitSharedAtomicUMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 374 | void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 341 | void EmitSharedAtomicSMax32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value); |
| 375 | std::string_view rhs); | 342 | void EmitSharedAtomicUMax32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 376 | void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 343 | void EmitSharedAtomicInc32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 377 | std::string_view rhs); | 344 | void EmitSharedAtomicDec32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 378 | void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 345 | void EmitSharedAtomicAnd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 379 | void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 346 | void EmitSharedAtomicOr32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 380 | void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs); | 347 | void EmitSharedAtomicXor32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 381 | void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | 348 | void EmitSharedAtomicExchange32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value); |
| 382 | std::string_view rhs); | 349 | void EmitSharedAtomicExchange64(EmitContext& ctx, ScalarU32 pointer_offset, Register value); |
| 383 | void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, | ||
| 384 | std::string_view rhs); | ||
| 385 | void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 386 | std::string_view value); | ||
| 387 | void EmitSharedAtomicSMin32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 388 | std::string_view value); | ||
| 389 | void EmitSharedAtomicUMin32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 390 | std::string_view value); | ||
| 391 | void EmitSharedAtomicSMax32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 392 | std::string_view value); | ||
| 393 | void EmitSharedAtomicUMax32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 394 | std::string_view value); | ||
| 395 | void EmitSharedAtomicInc32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 396 | std::string_view value); | ||
| 397 | void EmitSharedAtomicDec32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 398 | std::string_view value); | ||
| 399 | void EmitSharedAtomicAnd32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 400 | std::string_view value); | ||
| 401 | void EmitSharedAtomicOr32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 402 | std::string_view value); | ||
| 403 | void EmitSharedAtomicXor32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 404 | std::string_view value); | ||
| 405 | void EmitSharedAtomicExchange32(EmitContext& ctx, std::string_view pointer_offset, | ||
| 406 | std::string_view value); | ||
| 407 | void EmitSharedAtomicExchange64(EmitContext& ctx, std::string_view pointer_offset, | ||
| 408 | std::string_view value); | ||
| 409 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 350 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 410 | std::string_view value); | 351 | ScalarU32 value); |
| 411 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 352 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 412 | std::string_view value); | 353 | ScalarS32 value); |
| 413 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 354 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 414 | std::string_view value); | 355 | ScalarU32 value); |
| 415 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 356 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 416 | std::string_view value); | 357 | ScalarS32 value); |
| 417 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 358 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 418 | std::string_view value); | 359 | ScalarU32 value); |
| 419 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 360 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 420 | std::string_view value); | 361 | ScalarU32 value); |
| 421 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 362 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 422 | std::string_view value); | 363 | ScalarU32 value); |
| 423 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 364 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 424 | std::string_view value); | 365 | ScalarU32 value); |
| 425 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 366 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 426 | std::string_view value); | 367 | ScalarU32 value); |
| 427 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 368 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 428 | std::string_view value); | 369 | ScalarU32 value); |
| 429 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, | 370 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, |
| 430 | const IR::Value& offset, std::string_view value); | 371 | const IR::Value& offset, ScalarU32 value); |
| 431 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 372 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 432 | std::string_view value); | 373 | Register value); |
| 433 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 374 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 434 | std::string_view value); | 375 | Register value); |
| 435 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 376 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 436 | std::string_view value); | 377 | Register value); |
| 437 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 378 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 438 | std::string_view value); | 379 | Register value); |
| 439 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 380 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 440 | std::string_view value); | 381 | Register value); |
| 441 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 382 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 442 | std::string_view value); | 383 | Register value); |
| 443 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 384 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 444 | std::string_view value); | 385 | Register value); |
| 445 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 386 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 446 | std::string_view value); | 387 | Register value); |
| 447 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, | 388 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, |
| 448 | const IR::Value& offset, std::string_view value); | 389 | const IR::Value& offset, Register value); |
| 449 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 390 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 450 | std::string_view value); | 391 | ScalarF32 value); |
| 451 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 392 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 452 | std::string_view value); | 393 | Register value); |
| 453 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 394 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 454 | std::string_view value); | 395 | Register value); |
| 455 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 396 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 456 | std::string_view value); | 397 | Register value); |
| 457 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 398 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 458 | std::string_view value); | 399 | Register value); |
| 459 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 400 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 460 | std::string_view value); | 401 | Register value); |
| 461 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 402 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 462 | std::string_view value); | 403 | Register value); |
| 463 | void EmitGlobalAtomicIAdd32(EmitContext& ctx); | 404 | void EmitGlobalAtomicIAdd32(EmitContext& ctx); |
| 464 | void EmitGlobalAtomicSMin32(EmitContext& ctx); | 405 | void EmitGlobalAtomicSMin32(EmitContext& ctx); |
| 465 | void EmitGlobalAtomicUMin32(EmitContext& ctx); | 406 | void EmitGlobalAtomicUMin32(EmitContext& ctx); |
| @@ -489,58 +430,58 @@ void EmitGlobalAtomicMinF16x2(EmitContext& ctx); | |||
| 489 | void EmitGlobalAtomicMinF32x2(EmitContext& ctx); | 430 | void EmitGlobalAtomicMinF32x2(EmitContext& ctx); |
| 490 | void EmitGlobalAtomicMaxF16x2(EmitContext& ctx); | 431 | void EmitGlobalAtomicMaxF16x2(EmitContext& ctx); |
| 491 | void EmitGlobalAtomicMaxF32x2(EmitContext& ctx); | 432 | void EmitGlobalAtomicMaxF32x2(EmitContext& ctx); |
| 492 | void EmitLogicalOr(EmitContext& ctx, std::string_view a, std::string_view b); | 433 | void EmitLogicalOr(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| 493 | void EmitLogicalAnd(EmitContext& ctx, std::string_view a, std::string_view b); | 434 | void EmitLogicalAnd(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| 494 | void EmitLogicalXor(EmitContext& ctx, std::string_view a, std::string_view b); | 435 | void EmitLogicalXor(EmitContext& ctx, ScalarS32 a, ScalarS32 b); |
| 495 | void EmitLogicalNot(EmitContext& ctx, std::string_view value); | 436 | void EmitLogicalNot(EmitContext& ctx, ScalarS32 value); |
| 496 | void EmitConvertS16F16(EmitContext& ctx, std::string_view value); | 437 | void EmitConvertS16F16(EmitContext& ctx, Register value); |
| 497 | void EmitConvertS16F32(EmitContext& ctx, std::string_view value); | 438 | void EmitConvertS16F32(EmitContext& ctx, Register value); |
| 498 | void EmitConvertS16F64(EmitContext& ctx, std::string_view value); | 439 | void EmitConvertS16F64(EmitContext& ctx, Register value); |
| 499 | void EmitConvertS32F16(EmitContext& ctx, std::string_view value); | 440 | void EmitConvertS32F16(EmitContext& ctx, Register value); |
| 500 | void EmitConvertS32F32(EmitContext& ctx, std::string_view value); | 441 | void EmitConvertS32F32(EmitContext& ctx, Register value); |
| 501 | void EmitConvertS32F64(EmitContext& ctx, std::string_view value); | 442 | void EmitConvertS32F64(EmitContext& ctx, Register value); |
| 502 | void EmitConvertS64F16(EmitContext& ctx, std::string_view value); | 443 | void EmitConvertS64F16(EmitContext& ctx, Register value); |
| 503 | void EmitConvertS64F32(EmitContext& ctx, std::string_view value); | 444 | void EmitConvertS64F32(EmitContext& ctx, Register value); |
| 504 | void EmitConvertS64F64(EmitContext& ctx, std::string_view value); | 445 | void EmitConvertS64F64(EmitContext& ctx, Register value); |
| 505 | void EmitConvertU16F16(EmitContext& ctx, std::string_view value); | 446 | void EmitConvertU16F16(EmitContext& ctx, Register value); |
| 506 | void EmitConvertU16F32(EmitContext& ctx, std::string_view value); | 447 | void EmitConvertU16F32(EmitContext& ctx, Register value); |
| 507 | void EmitConvertU16F64(EmitContext& ctx, std::string_view value); | 448 | void EmitConvertU16F64(EmitContext& ctx, Register value); |
| 508 | void EmitConvertU32F16(EmitContext& ctx, std::string_view value); | 449 | void EmitConvertU32F16(EmitContext& ctx, Register value); |
| 509 | void EmitConvertU32F32(EmitContext& ctx, std::string_view value); | 450 | void EmitConvertU32F32(EmitContext& ctx, Register value); |
| 510 | void EmitConvertU32F64(EmitContext& ctx, std::string_view value); | 451 | void EmitConvertU32F64(EmitContext& ctx, Register value); |
| 511 | void EmitConvertU64F16(EmitContext& ctx, std::string_view value); | 452 | void EmitConvertU64F16(EmitContext& ctx, Register value); |
| 512 | void EmitConvertU64F32(EmitContext& ctx, std::string_view value); | 453 | void EmitConvertU64F32(EmitContext& ctx, Register value); |
| 513 | void EmitConvertU64F64(EmitContext& ctx, std::string_view value); | 454 | void EmitConvertU64F64(EmitContext& ctx, Register value); |
| 514 | void EmitConvertU64U32(EmitContext& ctx, std::string_view value); | 455 | void EmitConvertU64U32(EmitContext& ctx, Register value); |
| 515 | void EmitConvertU32U64(EmitContext& ctx, std::string_view value); | 456 | void EmitConvertU32U64(EmitContext& ctx, Register value); |
| 516 | void EmitConvertF16F32(EmitContext& ctx, std::string_view value); | 457 | void EmitConvertF16F32(EmitContext& ctx, Register value); |
| 517 | void EmitConvertF32F16(EmitContext& ctx, std::string_view value); | 458 | void EmitConvertF32F16(EmitContext& ctx, Register value); |
| 518 | void EmitConvertF32F64(EmitContext& ctx, std::string_view value); | 459 | void EmitConvertF32F64(EmitContext& ctx, Register value); |
| 519 | void EmitConvertF64F32(EmitContext& ctx, std::string_view value); | 460 | void EmitConvertF64F32(EmitContext& ctx, Register value); |
| 520 | void EmitConvertF16S8(EmitContext& ctx, std::string_view value); | 461 | void EmitConvertF16S8(EmitContext& ctx, Register value); |
| 521 | void EmitConvertF16S16(EmitContext& ctx, std::string_view value); | 462 | void EmitConvertF16S16(EmitContext& ctx, Register value); |
| 522 | void EmitConvertF16S32(EmitContext& ctx, std::string_view value); | 463 | void EmitConvertF16S32(EmitContext& ctx, Register value); |
| 523 | void EmitConvertF16S64(EmitContext& ctx, std::string_view value); | 464 | void EmitConvertF16S64(EmitContext& ctx, Register value); |
| 524 | void EmitConvertF16U8(EmitContext& ctx, std::string_view value); | 465 | void EmitConvertF16U8(EmitContext& ctx, Register value); |
| 525 | void EmitConvertF16U16(EmitContext& ctx, std::string_view value); | 466 | void EmitConvertF16U16(EmitContext& ctx, Register value); |
| 526 | void EmitConvertF16U32(EmitContext& ctx, std::string_view value); | 467 | void EmitConvertF16U32(EmitContext& ctx, Register value); |
| 527 | void EmitConvertF16U64(EmitContext& ctx, std::string_view value); | 468 | void EmitConvertF16U64(EmitContext& ctx, Register value); |
| 528 | void EmitConvertF32S8(EmitContext& ctx, std::string_view value); | 469 | void EmitConvertF32S8(EmitContext& ctx, Register value); |
| 529 | void EmitConvertF32S16(EmitContext& ctx, std::string_view value); | 470 | void EmitConvertF32S16(EmitContext& ctx, Register value); |
| 530 | void EmitConvertF32S32(EmitContext& ctx, std::string_view value); | 471 | void EmitConvertF32S32(EmitContext& ctx, Register value); |
| 531 | void EmitConvertF32S64(EmitContext& ctx, std::string_view value); | 472 | void EmitConvertF32S64(EmitContext& ctx, Register value); |
| 532 | void EmitConvertF32U8(EmitContext& ctx, std::string_view value); | 473 | void EmitConvertF32U8(EmitContext& ctx, Register value); |
| 533 | void EmitConvertF32U16(EmitContext& ctx, std::string_view value); | 474 | void EmitConvertF32U16(EmitContext& ctx, Register value); |
| 534 | void EmitConvertF32U32(EmitContext& ctx, std::string_view value); | 475 | void EmitConvertF32U32(EmitContext& ctx, Register value); |
| 535 | void EmitConvertF32U64(EmitContext& ctx, std::string_view value); | 476 | void EmitConvertF32U64(EmitContext& ctx, Register value); |
| 536 | void EmitConvertF64S8(EmitContext& ctx, std::string_view value); | 477 | void EmitConvertF64S8(EmitContext& ctx, Register value); |
| 537 | void EmitConvertF64S16(EmitContext& ctx, std::string_view value); | 478 | void EmitConvertF64S16(EmitContext& ctx, Register value); |
| 538 | void EmitConvertF64S32(EmitContext& ctx, std::string_view value); | 479 | void EmitConvertF64S32(EmitContext& ctx, Register value); |
| 539 | void EmitConvertF64S64(EmitContext& ctx, std::string_view value); | 480 | void EmitConvertF64S64(EmitContext& ctx, Register value); |
| 540 | void EmitConvertF64U8(EmitContext& ctx, std::string_view value); | 481 | void EmitConvertF64U8(EmitContext& ctx, Register value); |
| 541 | void EmitConvertF64U16(EmitContext& ctx, std::string_view value); | 482 | void EmitConvertF64U16(EmitContext& ctx, Register value); |
| 542 | void EmitConvertF64U32(EmitContext& ctx, std::string_view value); | 483 | void EmitConvertF64U32(EmitContext& ctx, Register value); |
| 543 | void EmitConvertF64U64(EmitContext& ctx, std::string_view value); | 484 | void EmitConvertF64U64(EmitContext& ctx, Register value); |
| 544 | void EmitBindlessImageSampleImplicitLod(EmitContext&); | 485 | void EmitBindlessImageSampleImplicitLod(EmitContext&); |
| 545 | void EmitBindlessImageSampleExplicitLod(EmitContext&); | 486 | void EmitBindlessImageSampleExplicitLod(EmitContext&); |
| 546 | void EmitBindlessImageSampleDrefImplicitLod(EmitContext&); | 487 | void EmitBindlessImageSampleDrefImplicitLod(EmitContext&); |
| @@ -566,36 +507,29 @@ void EmitBoundImageGradient(EmitContext&); | |||
| 566 | void EmitBoundImageRead(EmitContext&); | 507 | void EmitBoundImageRead(EmitContext&); |
| 567 | void EmitBoundImageWrite(EmitContext&); | 508 | void EmitBoundImageWrite(EmitContext&); |
| 568 | void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 509 | void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 569 | std::string_view coords, std::string_view bias_lc, | 510 | Register coords, Register bias_lc, const IR::Value& offset); |
| 570 | const IR::Value& offset); | ||
| 571 | void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 511 | void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 572 | std::string_view coords, std::string_view lod_lc, | 512 | Register coords, Register lod_lc, const IR::Value& offset); |
| 573 | const IR::Value& offset); | ||
| 574 | void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 513 | void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 575 | std::string_view coords, std::string_view dref, | 514 | Register coords, Register dref, Register bias_lc, |
| 576 | std::string_view bias_lc, const IR::Value& offset); | 515 | const IR::Value& offset); |
| 577 | void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 516 | void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 578 | std::string_view coords, std::string_view dref, | 517 | Register coords, Register dref, Register lod_lc, |
| 579 | std::string_view lod_lc, const IR::Value& offset); | 518 | const IR::Value& offset); |
| 580 | void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 519 | void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 581 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2); | 520 | const IR::Value& offset, const IR::Value& offset2); |
| 582 | void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 521 | void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 583 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2, | 522 | const IR::Value& offset, const IR::Value& offset2, Register dref); |
| 584 | std::string_view dref); | 523 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 585 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 524 | Register offset, Register lod, Register ms); |
| 586 | std::string_view coords, std::string_view offset, std::string_view lod, | ||
| 587 | std::string_view ms); | ||
| 588 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 525 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 589 | std::string_view lod); | 526 | Register lod); |
| 590 | void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 527 | void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords); |
| 591 | std::string_view coords); | 528 | void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 592 | void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 529 | Register derivates, Register offset, Register lod_clamp); |
| 593 | std::string_view coords, std::string_view derivates, std::string_view offset, | 530 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords); |
| 594 | std::string_view lod_clamp); | 531 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 595 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 532 | Register color); |
| 596 | std::string_view coords); | ||
| 597 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | ||
| 598 | std::string_view coords, std::string_view color); | ||
| 599 | void EmitBindlessImageAtomicIAdd32(EmitContext&); | 533 | void EmitBindlessImageAtomicIAdd32(EmitContext&); |
| 600 | void EmitBindlessImageAtomicSMin32(EmitContext&); | 534 | void EmitBindlessImageAtomicSMin32(EmitContext&); |
| 601 | void EmitBindlessImageAtomicUMin32(EmitContext&); | 535 | void EmitBindlessImageAtomicUMin32(EmitContext&); |
| @@ -619,53 +553,49 @@ void EmitBoundImageAtomicOr32(EmitContext&); | |||
| 619 | void EmitBoundImageAtomicXor32(EmitContext&); | 553 | void EmitBoundImageAtomicXor32(EmitContext&); |
| 620 | void EmitBoundImageAtomicExchange32(EmitContext&); | 554 | void EmitBoundImageAtomicExchange32(EmitContext&); |
| 621 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 555 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 622 | std::string_view coords, std::string_view value); | 556 | Register coords, ScalarU32 value); |
| 623 | void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 557 | void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 624 | std::string_view coords, std::string_view value); | 558 | Register coords, ScalarS32 value); |
| 625 | void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 559 | void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 626 | std::string_view coords, std::string_view value); | 560 | Register coords, ScalarU32 value); |
| 627 | void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 561 | void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 628 | std::string_view coords, std::string_view value); | 562 | Register coords, ScalarS32 value); |
| 629 | void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 563 | void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 630 | std::string_view coords, std::string_view value); | 564 | Register coords, ScalarU32 value); |
| 631 | void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 565 | void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 632 | std::string_view coords, std::string_view value); | 566 | ScalarU32 value); |
| 633 | void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 567 | void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 634 | std::string_view coords, std::string_view value); | 568 | ScalarU32 value); |
| 635 | void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 569 | void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 636 | std::string_view coords, std::string_view value); | 570 | ScalarU32 value); |
| 637 | void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 571 | void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 638 | std::string_view coords, std::string_view value); | 572 | ScalarU32 value); |
| 639 | void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 573 | void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 640 | std::string_view coords, std::string_view value); | 574 | ScalarU32 value); |
| 641 | void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 575 | void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 642 | std::string_view coords, std::string_view value); | 576 | Register coords, ScalarU32 value); |
| 643 | void EmitLaneId(EmitContext& ctx); | 577 | void EmitLaneId(EmitContext& ctx); |
| 644 | void EmitVoteAll(EmitContext& ctx, std::string_view pred); | 578 | void EmitVoteAll(EmitContext& ctx, ScalarS32 pred); |
| 645 | void EmitVoteAny(EmitContext& ctx, std::string_view pred); | 579 | void EmitVoteAny(EmitContext& ctx, ScalarS32 pred); |
| 646 | void EmitVoteEqual(EmitContext& ctx, std::string_view pred); | 580 | void EmitVoteEqual(EmitContext& ctx, ScalarS32 pred); |
| 647 | void EmitSubgroupBallot(EmitContext& ctx, std::string_view pred); | 581 | void EmitSubgroupBallot(EmitContext& ctx, ScalarS32 pred); |
| 648 | void EmitSubgroupEqMask(EmitContext& ctx); | 582 | void EmitSubgroupEqMask(EmitContext& ctx); |
| 649 | void EmitSubgroupLtMask(EmitContext& ctx); | 583 | void EmitSubgroupLtMask(EmitContext& ctx); |
| 650 | void EmitSubgroupLeMask(EmitContext& ctx); | 584 | void EmitSubgroupLeMask(EmitContext& ctx); |
| 651 | void EmitSubgroupGtMask(EmitContext& ctx); | 585 | void EmitSubgroupGtMask(EmitContext& ctx); |
| 652 | void EmitSubgroupGeMask(EmitContext& ctx); | 586 | void EmitSubgroupGeMask(EmitContext& ctx); |
| 653 | void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 587 | void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 654 | std::string_view index, std::string_view clamp, | 588 | ScalarU32 clamp, ScalarU32 segmentation_mask); |
| 655 | std::string_view segmentation_mask); | 589 | void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 656 | void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view index, | 590 | ScalarU32 clamp, ScalarU32 segmentation_mask); |
| 657 | std::string_view clamp, std::string_view segmentation_mask); | 591 | void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 658 | void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 592 | ScalarU32 clamp, ScalarU32 segmentation_mask); |
| 659 | std::string_view index, std::string_view clamp, | 593 | void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 660 | std::string_view segmentation_mask); | 594 | ScalarU32 clamp, ScalarU32 segmentation_mask); |
| 661 | void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 595 | void EmitFSwizzleAdd(EmitContext& ctx, ScalarF32 op_a, ScalarF32 op_b, ScalarU32 swizzle); |
| 662 | std::string_view index, std::string_view clamp, | 596 | void EmitDPdxFine(EmitContext& ctx, ScalarF32 op_a); |
| 663 | std::string_view segmentation_mask); | 597 | void EmitDPdyFine(EmitContext& ctx, ScalarF32 op_a); |
| 664 | void EmitFSwizzleAdd(EmitContext& ctx, std::string_view op_a, std::string_view op_b, | 598 | void EmitDPdxCoarse(EmitContext& ctx, ScalarF32 op_a); |
| 665 | std::string_view swizzle); | 599 | void EmitDPdyCoarse(EmitContext& ctx, ScalarF32 op_a); |
| 666 | void EmitDPdxFine(EmitContext& ctx, std::string_view op_a); | ||
| 667 | void EmitDPdyFine(EmitContext& ctx, std::string_view op_a); | ||
| 668 | void EmitDPdxCoarse(EmitContext& ctx, std::string_view op_a); | ||
| 669 | void EmitDPdyCoarse(EmitContext& ctx, std::string_view op_a); | ||
| 670 | 600 | ||
| 671 | } // namespace Shader::Backend::GLASM | 601 | } // namespace Shader::Backend::GLASM |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp index 579806c38..7b88d6f02 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |||
| @@ -2,239 +2,209 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <string_view> | ||
| 6 | |||
| 7 | #include "shader_recompiler/backend/glasm/emit_context.h" | 5 | #include "shader_recompiler/backend/glasm/emit_context.h" |
| 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | 6 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" |
| 9 | #include "shader_recompiler/frontend/ir/value.h" | 7 | #include "shader_recompiler/frontend/ir/value.h" |
| 10 | 8 | ||
| 11 | namespace Shader::Backend::GLASM { | 9 | namespace Shader::Backend::GLASM { |
| 12 | 10 | ||
| 13 | void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 11 | void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 14 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 12 | ctx.Add("ADD.S {}.x,{},{};", inst, a, b); |
| 15 | ctx.Add("ADD.U {},{},{};", inst, a, b); | ||
| 16 | } | 13 | } |
| 17 | 14 | ||
| 18 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 15 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, |
| 19 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 16 | [[maybe_unused]] Register b) { |
| 20 | throw NotImplementedException("GLASM instruction"); | 17 | throw NotImplementedException("GLASM instruction"); |
| 21 | } | 18 | } |
| 22 | 19 | ||
| 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 20 | void EmitISub32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 24 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 21 | ctx.Add("SUB.S {}.x,{},{};", inst, a, b); |
| 25 | ctx.Add("SUB.U {},{},{};", inst, a, b); | ||
| 26 | } | 22 | } |
| 27 | 23 | ||
| 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 24 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register a, |
| 29 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 25 | [[maybe_unused]] Register b) { |
| 30 | throw NotImplementedException("GLASM instruction"); | 26 | throw NotImplementedException("GLASM instruction"); |
| 31 | } | 27 | } |
| 32 | 28 | ||
| 33 | void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 29 | void EmitIMul32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 34 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 30 | ctx.Add("MUL.S {}.x,{},{};", inst, a, b); |
| 35 | throw NotImplementedException("GLASM instruction"); | ||
| 36 | } | 31 | } |
| 37 | 32 | ||
| 38 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 33 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 39 | [[maybe_unused]] std::string_view value) { | ||
| 40 | throw NotImplementedException("GLASM instruction"); | 34 | throw NotImplementedException("GLASM instruction"); |
| 41 | } | 35 | } |
| 42 | 36 | ||
| 43 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 37 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 44 | [[maybe_unused]] std::string_view value) { | ||
| 45 | throw NotImplementedException("GLASM instruction"); | 38 | throw NotImplementedException("GLASM instruction"); |
| 46 | } | 39 | } |
| 47 | 40 | ||
| 48 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 41 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 49 | [[maybe_unused]] std::string_view value) { | ||
| 50 | throw NotImplementedException("GLASM instruction"); | 42 | throw NotImplementedException("GLASM instruction"); |
| 51 | } | 43 | } |
| 52 | 44 | ||
| 53 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 45 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) { |
| 54 | [[maybe_unused]] std::string_view value) { | ||
| 55 | throw NotImplementedException("GLASM instruction"); | 46 | throw NotImplementedException("GLASM instruction"); |
| 56 | } | 47 | } |
| 57 | 48 | ||
| 58 | void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, | 49 | void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 shift) { |
| 59 | [[maybe_unused]] std::string_view base, | 50 | ctx.Add("SHL.U {}.x,{},{};", inst, base, shift); |
| 60 | [[maybe_unused]] std::string_view shift) { | ||
| 61 | throw NotImplementedException("GLASM instruction"); | ||
| 62 | } | 51 | } |
| 63 | 52 | ||
| 64 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, | 53 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register base, |
| 65 | [[maybe_unused]] std::string_view base, | 54 | [[maybe_unused]] Register shift) { |
| 66 | [[maybe_unused]] std::string_view shift) { | ||
| 67 | throw NotImplementedException("GLASM instruction"); | 55 | throw NotImplementedException("GLASM instruction"); |
| 68 | } | 56 | } |
| 69 | 57 | ||
| 70 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, | 58 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 base, |
| 71 | [[maybe_unused]] std::string_view base, | 59 | [[maybe_unused]] ScalarU32 shift) { |
| 72 | [[maybe_unused]] std::string_view shift) { | ||
| 73 | throw NotImplementedException("GLASM instruction"); | 60 | throw NotImplementedException("GLASM instruction"); |
| 74 | } | 61 | } |
| 75 | 62 | ||
| 76 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, | 63 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register base, |
| 77 | [[maybe_unused]] std::string_view base, | 64 | [[maybe_unused]] Register shift) { |
| 78 | [[maybe_unused]] std::string_view shift) { | ||
| 79 | throw NotImplementedException("GLASM instruction"); | 65 | throw NotImplementedException("GLASM instruction"); |
| 80 | } | 66 | } |
| 81 | 67 | ||
| 82 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, | 68 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 base, |
| 83 | [[maybe_unused]] std::string_view base, | 69 | [[maybe_unused]] ScalarS32 shift) { |
| 84 | [[maybe_unused]] std::string_view shift) { | ||
| 85 | throw NotImplementedException("GLASM instruction"); | 70 | throw NotImplementedException("GLASM instruction"); |
| 86 | } | 71 | } |
| 87 | 72 | ||
| 88 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, | 73 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register base, |
| 89 | [[maybe_unused]] std::string_view base, | 74 | [[maybe_unused]] Register shift) { |
| 90 | [[maybe_unused]] std::string_view shift) { | ||
| 91 | throw NotImplementedException("GLASM instruction"); | 75 | throw NotImplementedException("GLASM instruction"); |
| 92 | } | 76 | } |
| 93 | 77 | ||
| 94 | void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 78 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 95 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 79 | ctx.Add("AND.S {}.x,{},{};", inst, a, b); |
| 96 | ctx.Add("AND {},{},{};", inst, a, b); | ||
| 97 | } | 80 | } |
| 98 | 81 | ||
| 99 | void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 82 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 100 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 83 | ctx.Add("OR.S {}.x,{},{};", inst, a, b); |
| 101 | ctx.Add("OR {},{},{};", inst, a, b); | ||
| 102 | } | 84 | } |
| 103 | 85 | ||
| 104 | void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 86 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) { |
| 105 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 87 | ctx.Add("XOR.S {}.x,{},{};", inst, a, b); |
| 106 | ctx.Add("XOR {},{},{};", inst, a, b); | ||
| 107 | } | 88 | } |
| 108 | 89 | ||
| 109 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 90 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 base, |
| 110 | std::string_view insert, std::string_view offset, std::string_view count) { | 91 | [[maybe_unused]] ScalarS32 insert, [[maybe_unused]] ScalarS32 offset, |
| 111 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); | 92 | [[maybe_unused]] ScalarS32 count) { |
| 112 | ctx.Add("BFI.U {},RC,{},{};", inst, insert, base); | 93 | throw NotImplementedException("GLASM instruction"); |
| 113 | } | 94 | } |
| 114 | 95 | ||
| 115 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 96 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 116 | std::string_view offset, std::string_view count) { | 97 | [[maybe_unused]] ScalarS32 base, [[maybe_unused]] ScalarS32 offset, |
| 117 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); | 98 | [[maybe_unused]] ScalarS32 count) { |
| 118 | ctx.Add("BFE.S {},RC,{};", inst, base); | 99 | throw NotImplementedException("GLASM instruction"); |
| 119 | } | 100 | } |
| 120 | 101 | ||
| 121 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base, | 102 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 122 | std::string_view offset, std::string_view count) { | 103 | [[maybe_unused]] ScalarU32 base, [[maybe_unused]] ScalarU32 offset, |
| 123 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); | 104 | [[maybe_unused]] ScalarU32 count) { |
| 124 | ctx.Add("BFE.U {},RC,{};", inst, base); | 105 | throw NotImplementedException("GLASM instruction"); |
| 125 | } | 106 | } |
| 126 | 107 | ||
| 127 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 108 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 128 | [[maybe_unused]] std::string_view value) { | 109 | throw NotImplementedException("GLASM instruction"); |
| 129 | ctx.Add("BFR {},{};", inst, value); | ||
| 130 | } | 110 | } |
| 131 | 111 | ||
| 132 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 112 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 133 | [[maybe_unused]] std::string_view value) { | ||
| 134 | throw NotImplementedException("GLASM instruction"); | 113 | throw NotImplementedException("GLASM instruction"); |
| 135 | } | 114 | } |
| 136 | 115 | ||
| 137 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 116 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 138 | [[maybe_unused]] std::string_view value) { | 117 | throw NotImplementedException("GLASM instruction"); |
| 139 | ctx.Add("NOT {},{};", inst, value); | ||
| 140 | } | 118 | } |
| 141 | 119 | ||
| 142 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 120 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 143 | [[maybe_unused]] std::string_view value) { | ||
| 144 | throw NotImplementedException("GLASM instruction"); | 121 | throw NotImplementedException("GLASM instruction"); |
| 145 | } | 122 | } |
| 146 | 123 | ||
| 147 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 124 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 value) { |
| 148 | [[maybe_unused]] std::string_view value) { | ||
| 149 | throw NotImplementedException("GLASM instruction"); | 125 | throw NotImplementedException("GLASM instruction"); |
| 150 | } | 126 | } |
| 151 | 127 | ||
| 152 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 128 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 a, |
| 153 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 129 | [[maybe_unused]] ScalarS32 b) { |
| 154 | throw NotImplementedException("GLASM instruction"); | 130 | throw NotImplementedException("GLASM instruction"); |
| 155 | } | 131 | } |
| 156 | 132 | ||
| 157 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 133 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 a, |
| 158 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 134 | [[maybe_unused]] ScalarU32 b) { |
| 159 | throw NotImplementedException("GLASM instruction"); | 135 | throw NotImplementedException("GLASM instruction"); |
| 160 | } | 136 | } |
| 161 | 137 | ||
| 162 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 138 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 a, |
| 163 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 139 | [[maybe_unused]] ScalarS32 b) { |
| 164 | throw NotImplementedException("GLASM instruction"); | 140 | throw NotImplementedException("GLASM instruction"); |
| 165 | } | 141 | } |
| 166 | 142 | ||
| 167 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 143 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 a, |
| 168 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 144 | [[maybe_unused]] ScalarU32 b) { |
| 169 | throw NotImplementedException("GLASM instruction"); | 145 | throw NotImplementedException("GLASM instruction"); |
| 170 | } | 146 | } |
| 171 | 147 | ||
| 172 | void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 148 | void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 173 | [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, | 149 | [[maybe_unused]] ScalarS32 value, [[maybe_unused]] ScalarS32 min, |
| 174 | [[maybe_unused]] std::string_view max) { | 150 | [[maybe_unused]] ScalarS32 max) { |
| 175 | throw NotImplementedException("GLASM instruction"); | 151 | throw NotImplementedException("GLASM instruction"); |
| 176 | } | 152 | } |
| 177 | 153 | ||
| 178 | void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 154 | void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 179 | [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, | 155 | [[maybe_unused]] ScalarU32 value, [[maybe_unused]] ScalarU32 min, |
| 180 | [[maybe_unused]] std::string_view max) { | 156 | [[maybe_unused]] ScalarU32 max) { |
| 181 | throw NotImplementedException("GLASM instruction"); | 157 | throw NotImplementedException("GLASM instruction"); |
| 182 | } | 158 | } |
| 183 | 159 | ||
| 184 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 160 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 185 | [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) { | 161 | [[maybe_unused]] ScalarS32 rhs) { |
| 186 | ctx.Add("SLT.S {},{},{};", inst, lhs, rhs); | 162 | throw NotImplementedException("GLASM instruction"); |
| 187 | } | 163 | } |
| 188 | 164 | ||
| 189 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 165 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, |
| 190 | [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) { | 166 | [[maybe_unused]] ScalarU32 rhs) { |
| 191 | ctx.Add("SLT.U {},{},{};", inst, lhs, rhs); | 167 | throw NotImplementedException("GLASM instruction"); |
| 192 | } | 168 | } |
| 193 | 169 | ||
| 194 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 170 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 195 | [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) { | 171 | [[maybe_unused]] ScalarS32 rhs) { |
| 196 | ctx.Add("SEQ {},{},{};", inst, lhs, rhs); | 172 | throw NotImplementedException("GLASM instruction"); |
| 197 | } | 173 | } |
| 198 | 174 | ||
| 199 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 175 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 200 | [[maybe_unused]] std::string_view lhs, | 176 | [[maybe_unused]] ScalarS32 rhs) { |
| 201 | [[maybe_unused]] std::string_view rhs) { | 177 | throw NotImplementedException("GLASM instruction"); |
| 202 | ctx.Add("SLE.S {},{},{};", inst, lhs, rhs); | ||
| 203 | } | 178 | } |
| 204 | 179 | ||
| 205 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 180 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, |
| 206 | [[maybe_unused]] std::string_view lhs, | 181 | [[maybe_unused]] ScalarU32 rhs) { |
| 207 | [[maybe_unused]] std::string_view rhs) { | 182 | throw NotImplementedException("GLASM instruction"); |
| 208 | ctx.Add("SLE.U {},{},{};", inst, lhs, rhs); | ||
| 209 | } | 183 | } |
| 210 | 184 | ||
| 211 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 185 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 212 | [[maybe_unused]] std::string_view lhs, | 186 | [[maybe_unused]] ScalarS32 rhs) { |
| 213 | [[maybe_unused]] std::string_view rhs) { | 187 | throw NotImplementedException("GLASM instruction"); |
| 214 | ctx.Add("SGT.S {},{},{};", inst, lhs, rhs); | ||
| 215 | } | 188 | } |
| 216 | 189 | ||
| 217 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 190 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, |
| 218 | [[maybe_unused]] std::string_view lhs, | 191 | [[maybe_unused]] ScalarU32 rhs) { |
| 219 | [[maybe_unused]] std::string_view rhs) { | 192 | throw NotImplementedException("GLASM instruction"); |
| 220 | ctx.Add("SGT.U {},{},{};", inst, lhs, rhs); | ||
| 221 | } | 193 | } |
| 222 | 194 | ||
| 223 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 195 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 224 | [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) { | 196 | [[maybe_unused]] ScalarS32 rhs) { |
| 225 | ctx.Add("SNE.U {},{},{};", inst, lhs, rhs); | 197 | throw NotImplementedException("GLASM instruction"); |
| 226 | } | 198 | } |
| 227 | 199 | ||
| 228 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 200 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, |
| 229 | [[maybe_unused]] std::string_view lhs, | 201 | [[maybe_unused]] ScalarS32 rhs) { |
| 230 | [[maybe_unused]] std::string_view rhs) { | 202 | throw NotImplementedException("GLASM instruction"); |
| 231 | ctx.Add("SGE.S {},{},{};", inst, lhs, rhs); | ||
| 232 | } | 203 | } |
| 233 | 204 | ||
| 234 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 205 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, |
| 235 | [[maybe_unused]] std::string_view lhs, | 206 | [[maybe_unused]] ScalarU32 rhs) { |
| 236 | [[maybe_unused]] std::string_view rhs) { | 207 | throw NotImplementedException("GLASM instruction"); |
| 237 | ctx.Add("SGE.U {},{},{};", inst, lhs, rhs); | ||
| 238 | } | 208 | } |
| 239 | 209 | ||
| 240 | } // namespace Shader::Backend::GLASM | 210 | } // 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 9e38a1bdf..8ef0f7c17 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | namespace Shader::Backend::GLASM { | 12 | namespace Shader::Backend::GLASM { |
| 13 | namespace { | 13 | namespace { |
| 14 | void StorageOp(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 14 | void StorageOp(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 15 | std::string_view then_expr, std::string_view else_expr = {}) { | 15 | std::string_view then_expr, std::string_view else_expr = {}) { |
| 16 | // Operate on bindless SSBO, call the expression with bounds checking | 16 | // Operate on bindless SSBO, call the expression with bounds checking |
| 17 | // address = c[binding].xy | 17 | // address = c[binding].xy |
| @@ -23,20 +23,21 @@ void StorageOp(EmitContext& ctx, const IR::Value& binding, std::string_view offs | |||
| 23 | "SLT.U.CC RC.x,{},c[{}].z;", // cc = offset < length | 23 | "SLT.U.CC RC.x,{},c[{}].z;", // cc = offset < length |
| 24 | sb_binding, offset, offset, sb_binding); | 24 | sb_binding, offset, offset, sb_binding); |
| 25 | if (else_expr.empty()) { | 25 | if (else_expr.empty()) { |
| 26 | ctx.Add("{}", then_expr); | 26 | ctx.Add("IF NE.x;{}ENDIF;", then_expr); |
| 27 | } else { | 27 | } else { |
| 28 | ctx.Add("IF NE.x;{}ELSE;{}ENDIF;", then_expr, else_expr); | 28 | ctx.Add("IF NE.x;{}ELSE;{}ENDIF;", then_expr, else_expr); |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | void Store(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 32 | template <typename ValueType> |
| 33 | std::string_view value, std::string_view size) { | 33 | void Store(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, ValueType value, |
| 34 | std::string_view size) { | ||
| 34 | StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, value)); | 35 | StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, value)); |
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | void Load(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, std::string_view offset, | 38 | void Load(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, ScalarU32 offset, |
| 38 | std::string_view size) { | 39 | std::string_view size) { |
| 39 | const std::string ret{ctx.reg_alloc.Define(inst)}; | 40 | const Register ret{ctx.reg_alloc.Define(inst)}; |
| 40 | StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, ret), | 41 | StorageOp(ctx, binding, offset, fmt::format("STORE.{} {},LC.x;", size, ret), |
| 41 | fmt::format("MOV.U {},{{0,0,0,0}};", ret)); | 42 | fmt::format("MOV.U {},{{0,0,0,0}};", ret)); |
| 42 | } | 43 | } |
| @@ -58,18 +59,15 @@ void EmitLoadGlobalS16([[maybe_unused]] EmitContext& ctx) { | |||
| 58 | throw NotImplementedException("GLASM instruction"); | 59 | throw NotImplementedException("GLASM instruction"); |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | void EmitLoadGlobal32([[maybe_unused]] EmitContext& ctx, | 62 | void EmitLoadGlobal32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address) { |
| 62 | [[maybe_unused]] std::string_view address) { | ||
| 63 | throw NotImplementedException("GLASM instruction"); | 63 | throw NotImplementedException("GLASM instruction"); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | void EmitLoadGlobal64([[maybe_unused]] EmitContext& ctx, | 66 | void EmitLoadGlobal64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address) { |
| 67 | [[maybe_unused]] std::string_view address) { | ||
| 68 | throw NotImplementedException("GLASM instruction"); | 67 | throw NotImplementedException("GLASM instruction"); |
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | void EmitLoadGlobal128([[maybe_unused]] EmitContext& ctx, | 70 | void EmitLoadGlobal128([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address) { |
| 72 | [[maybe_unused]] std::string_view address) { | ||
| 73 | throw NotImplementedException("GLASM instruction"); | 71 | throw NotImplementedException("GLASM instruction"); |
| 74 | } | 72 | } |
| 75 | 73 | ||
| @@ -89,89 +87,88 @@ void EmitWriteGlobalS16([[maybe_unused]] EmitContext& ctx) { | |||
| 89 | throw NotImplementedException("GLASM instruction"); | 87 | throw NotImplementedException("GLASM instruction"); |
| 90 | } | 88 | } |
| 91 | 89 | ||
| 92 | void EmitWriteGlobal32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view address, | 90 | void EmitWriteGlobal32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address, |
| 93 | [[maybe_unused]] std::string_view value) { | 91 | [[maybe_unused]] ScalarU32 value) { |
| 94 | throw NotImplementedException("GLASM instruction"); | 92 | throw NotImplementedException("GLASM instruction"); |
| 95 | } | 93 | } |
| 96 | 94 | ||
| 97 | void EmitWriteGlobal64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view address, | 95 | void EmitWriteGlobal64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address, |
| 98 | [[maybe_unused]] std::string_view value) { | 96 | [[maybe_unused]] Register value) { |
| 99 | throw NotImplementedException("GLASM instruction"); | 97 | throw NotImplementedException("GLASM instruction"); |
| 100 | } | 98 | } |
| 101 | 99 | ||
| 102 | void EmitWriteGlobal128([[maybe_unused]] EmitContext& ctx, | 100 | void EmitWriteGlobal128([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register address, |
| 103 | [[maybe_unused]] std::string_view address, | 101 | [[maybe_unused]] Register value) { |
| 104 | [[maybe_unused]] std::string_view value) { | ||
| 105 | throw NotImplementedException("GLASM instruction"); | 102 | throw NotImplementedException("GLASM instruction"); |
| 106 | } | 103 | } |
| 107 | 104 | ||
| 108 | void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 105 | void EmitLoadStorageU8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 109 | std::string_view offset) { | 106 | ScalarU32 offset) { |
| 110 | Load(ctx, inst, binding, offset, "U8"); | 107 | Load(ctx, inst, binding, offset, "U8"); |
| 111 | } | 108 | } |
| 112 | 109 | ||
| 113 | void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 110 | void EmitLoadStorageS8(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 114 | std::string_view offset) { | 111 | ScalarU32 offset) { |
| 115 | Load(ctx, inst, binding, offset, "S8"); | 112 | Load(ctx, inst, binding, offset, "S8"); |
| 116 | } | 113 | } |
| 117 | 114 | ||
| 118 | void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 115 | void EmitLoadStorageU16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 119 | std::string_view offset) { | 116 | ScalarU32 offset) { |
| 120 | Load(ctx, inst, binding, offset, "U16"); | 117 | Load(ctx, inst, binding, offset, "U16"); |
| 121 | } | 118 | } |
| 122 | 119 | ||
| 123 | void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 120 | void EmitLoadStorageS16(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 124 | std::string_view offset) { | 121 | ScalarU32 offset) { |
| 125 | Load(ctx, inst, binding, offset, "S16"); | 122 | Load(ctx, inst, binding, offset, "S16"); |
| 126 | } | 123 | } |
| 127 | 124 | ||
| 128 | void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 125 | void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 129 | std::string_view offset) { | 126 | ScalarU32 offset) { |
| 130 | Load(ctx, inst, binding, offset, "U32"); | 127 | Load(ctx, inst, binding, offset, "U32"); |
| 131 | } | 128 | } |
| 132 | 129 | ||
| 133 | void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 130 | void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 134 | std::string_view offset) { | 131 | ScalarU32 offset) { |
| 135 | Load(ctx, inst, binding, offset, "U32X2"); | 132 | Load(ctx, inst, binding, offset, "U32X2"); |
| 136 | } | 133 | } |
| 137 | 134 | ||
| 138 | void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, | 135 | void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, |
| 139 | std::string_view offset) { | 136 | ScalarU32 offset) { |
| 140 | Load(ctx, inst, binding, offset, "U32X4"); | 137 | Load(ctx, inst, binding, offset, "U32X4"); |
| 141 | } | 138 | } |
| 142 | 139 | ||
| 143 | void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 140 | void EmitWriteStorageU8(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 144 | std::string_view value) { | 141 | ScalarU32 value) { |
| 145 | Store(ctx, binding, offset, value, "U8"); | 142 | Store(ctx, binding, offset, value, "U8"); |
| 146 | } | 143 | } |
| 147 | 144 | ||
| 148 | void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 145 | void EmitWriteStorageS8(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 149 | std::string_view value) { | 146 | ScalarS32 value) { |
| 150 | Store(ctx, binding, offset, value, "S8"); | 147 | Store(ctx, binding, offset, value, "S8"); |
| 151 | } | 148 | } |
| 152 | 149 | ||
| 153 | void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 150 | void EmitWriteStorageU16(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 154 | std::string_view value) { | 151 | ScalarU32 value) { |
| 155 | Store(ctx, binding, offset, value, "U16"); | 152 | Store(ctx, binding, offset, value, "U16"); |
| 156 | } | 153 | } |
| 157 | 154 | ||
| 158 | void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 155 | void EmitWriteStorageS16(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 159 | std::string_view value) { | 156 | ScalarS32 value) { |
| 160 | Store(ctx, binding, offset, value, "S16"); | 157 | Store(ctx, binding, offset, value, "S16"); |
| 161 | } | 158 | } |
| 162 | 159 | ||
| 163 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 160 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 164 | std::string_view value) { | 161 | ScalarU32 value) { |
| 165 | Store(ctx, binding, offset, value, "U32"); | 162 | Store(ctx, binding, offset, value, "U32"); |
| 166 | } | 163 | } |
| 167 | 164 | ||
| 168 | void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 165 | void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 169 | std::string_view value) { | 166 | Register value) { |
| 170 | Store(ctx, binding, offset, value, "U32X2"); | 167 | Store(ctx, binding, offset, value, "U32X2"); |
| 171 | } | 168 | } |
| 172 | 169 | ||
| 173 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, std::string_view offset, | 170 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 174 | std::string_view value) { | 171 | Register value) { |
| 175 | Store(ctx, binding, offset, value, "U32X4"); | 172 | Store(ctx, binding, offset, value, "U32X4"); |
| 176 | } | 173 | } |
| 177 | 174 | ||
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 32eb87837..08de3f92f 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -25,21 +25,19 @@ void EmitVoid(EmitContext& ctx) { | |||
| 25 | NotImplemented(); | 25 | NotImplemented(); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | void EmitBranch(EmitContext& ctx, std::string_view label) { | 28 | void EmitBranch(EmitContext& ctx) { |
| 29 | NotImplemented(); | 29 | NotImplemented(); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | void EmitBranchConditional(EmitContext& ctx, std::string_view condition, | 32 | void EmitBranchConditional(EmitContext& ctx) { |
| 33 | std::string_view true_label, std::string_view false_label) { | ||
| 34 | NotImplemented(); | 33 | NotImplemented(); |
| 35 | } | 34 | } |
| 36 | 35 | ||
| 37 | void EmitLoopMerge(EmitContext& ctx, std::string_view merge_label, | 36 | void EmitLoopMerge(EmitContext& ctx) { |
| 38 | std::string_view continue_label) { | ||
| 39 | NotImplemented(); | 37 | NotImplemented(); |
| 40 | } | 38 | } |
| 41 | 39 | ||
| 42 | void EmitSelectionMerge(EmitContext& ctx, std::string_view merge_label) { | 40 | void EmitSelectionMerge(EmitContext& ctx) { |
| 43 | NotImplemented(); | 41 | NotImplemented(); |
| 44 | } | 42 | } |
| 45 | 43 | ||
| @@ -55,7 +53,7 @@ void EmitUnreachable(EmitContext& ctx) { | |||
| 55 | NotImplemented(); | 53 | NotImplemented(); |
| 56 | } | 54 | } |
| 57 | 55 | ||
| 58 | void EmitDemoteToHelperInvocation(EmitContext& ctx, std::string_view continue_label) { | 56 | void EmitDemoteToHelperInvocation(EmitContext& ctx) { |
| 59 | NotImplemented(); | 57 | NotImplemented(); |
| 60 | } | 58 | } |
| 61 | 59 | ||
| @@ -155,8 +153,8 @@ void EmitWorkgroupId(EmitContext& ctx) { | |||
| 155 | NotImplemented(); | 153 | NotImplemented(); |
| 156 | } | 154 | } |
| 157 | 155 | ||
| 158 | void EmitLocalInvocationId(EmitContext& ctx) { | 156 | void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst) { |
| 159 | NotImplemented(); | 157 | ctx.Add("MOV.S {},invocation.localid;", inst); |
| 160 | } | 158 | } |
| 161 | 159 | ||
| 162 | void EmitInvocationId(EmitContext& ctx) { | 160 | void EmitInvocationId(EmitContext& ctx) { |
| @@ -175,11 +173,11 @@ void EmitYDirection(EmitContext& ctx) { | |||
| 175 | NotImplemented(); | 173 | NotImplemented(); |
| 176 | } | 174 | } |
| 177 | 175 | ||
| 178 | void EmitLoadLocal(EmitContext& ctx, std::string_view word_offset) { | 176 | void EmitLoadLocal(EmitContext& ctx, ScalarU32 word_offset) { |
| 179 | NotImplemented(); | 177 | NotImplemented(); |
| 180 | } | 178 | } |
| 181 | 179 | ||
| 182 | void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_view value) { | 180 | void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value) { |
| 183 | NotImplemented(); | 181 | NotImplemented(); |
| 184 | } | 182 | } |
| 185 | 183 | ||
| @@ -203,245 +201,127 @@ void EmitUndefU64(EmitContext& ctx) { | |||
| 203 | NotImplemented(); | 201 | NotImplemented(); |
| 204 | } | 202 | } |
| 205 | 203 | ||
| 206 | void EmitLoadSharedU8(EmitContext& ctx, std::string_view offset) { | 204 | void EmitLoadSharedU8(EmitContext& ctx, ScalarU32 offset) { |
| 207 | NotImplemented(); | ||
| 208 | } | ||
| 209 | |||
| 210 | void EmitLoadSharedS8(EmitContext& ctx, std::string_view offset) { | ||
| 211 | NotImplemented(); | ||
| 212 | } | ||
| 213 | |||
| 214 | void EmitLoadSharedU16(EmitContext& ctx, std::string_view offset) { | ||
| 215 | NotImplemented(); | ||
| 216 | } | ||
| 217 | |||
| 218 | void EmitLoadSharedS16(EmitContext& ctx, std::string_view offset) { | ||
| 219 | NotImplemented(); | ||
| 220 | } | ||
| 221 | |||
| 222 | void EmitLoadSharedU32(EmitContext& ctx, std::string_view offset) { | ||
| 223 | NotImplemented(); | ||
| 224 | } | ||
| 225 | |||
| 226 | void EmitLoadSharedU64(EmitContext& ctx, std::string_view offset) { | ||
| 227 | NotImplemented(); | ||
| 228 | } | ||
| 229 | |||
| 230 | void EmitLoadSharedU128(EmitContext& ctx, std::string_view offset) { | ||
| 231 | NotImplemented(); | ||
| 232 | } | ||
| 233 | |||
| 234 | void EmitWriteSharedU8(EmitContext& ctx, std::string_view offset, std::string_view value) { | ||
| 235 | NotImplemented(); | ||
| 236 | } | ||
| 237 | |||
| 238 | void EmitWriteSharedU16(EmitContext& ctx, std::string_view offset, std::string_view value) { | ||
| 239 | NotImplemented(); | ||
| 240 | } | ||
| 241 | |||
| 242 | void EmitWriteSharedU32(EmitContext& ctx, std::string_view offset, std::string_view value) { | ||
| 243 | NotImplemented(); | ||
| 244 | } | ||
| 245 | |||
| 246 | void EmitWriteSharedU64(EmitContext& ctx, std::string_view offset, std::string_view value) { | ||
| 247 | NotImplemented(); | ||
| 248 | } | ||
| 249 | |||
| 250 | void EmitWriteSharedU128(EmitContext& ctx, std::string_view offset, std::string_view value) { | ||
| 251 | NotImplemented(); | ||
| 252 | } | ||
| 253 | |||
| 254 | void EmitCompositeConstructU32x2(EmitContext& ctx, std::string_view e1, std::string_view e2) { | ||
| 255 | NotImplemented(); | ||
| 256 | } | ||
| 257 | |||
| 258 | void EmitCompositeConstructU32x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | ||
| 259 | std::string_view e3) { | ||
| 260 | NotImplemented(); | ||
| 261 | } | ||
| 262 | |||
| 263 | void EmitCompositeConstructU32x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | ||
| 264 | std::string_view e3, std::string_view e4) { | ||
| 265 | NotImplemented(); | ||
| 266 | } | ||
| 267 | |||
| 268 | void EmitCompositeExtractU32x2(EmitContext& ctx, std::string_view composite, u32 index) { | ||
| 269 | NotImplemented(); | ||
| 270 | } | ||
| 271 | |||
| 272 | void EmitCompositeExtractU32x3(EmitContext& ctx, std::string_view composite, u32 index) { | ||
| 273 | NotImplemented(); | ||
| 274 | } | ||
| 275 | |||
| 276 | void EmitCompositeExtractU32x4(EmitContext& ctx, std::string_view composite, u32 index) { | ||
| 277 | NotImplemented(); | ||
| 278 | } | ||
| 279 | |||
| 280 | void EmitCompositeInsertU32x2(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 281 | u32 index) { | ||
| 282 | NotImplemented(); | ||
| 283 | } | ||
| 284 | |||
| 285 | void EmitCompositeInsertU32x3(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 286 | u32 index) { | ||
| 287 | NotImplemented(); | ||
| 288 | } | ||
| 289 | |||
| 290 | void EmitCompositeInsertU32x4(EmitContext& ctx, std::string_view composite, std::string_view object, | ||
| 291 | u32 index) { | ||
| 292 | NotImplemented(); | ||
| 293 | } | ||
| 294 | |||
| 295 | void EmitCompositeConstructF16x2(EmitContext& ctx, std::string_view e1, std::string_view e2) { | ||
| 296 | NotImplemented(); | ||
| 297 | } | ||
| 298 | |||
| 299 | void EmitCompositeConstructF16x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | ||
| 300 | std::string_view e3) { | ||
| 301 | NotImplemented(); | ||
| 302 | } | ||
| 303 | |||
| 304 | void EmitCompositeConstructF16x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | ||
| 305 | std::string_view e3, std::string_view e4) { | ||
| 306 | NotImplemented(); | ||
| 307 | } | ||
| 308 | |||
| 309 | void EmitCompositeExtractF16x2(EmitContext& ctx, std::string_view composite, u32 index) { | ||
| 310 | NotImplemented(); | ||
| 311 | } | ||
| 312 | |||
| 313 | void EmitCompositeExtractF16x3(EmitContext& ctx, std::string_view composite, u32 index) { | ||
| 314 | NotImplemented(); | 205 | NotImplemented(); |
| 315 | } | 206 | } |
| 316 | 207 | ||
| 317 | void EmitCompositeExtractF16x4(EmitContext& ctx, std::string_view composite, u32 index) { | 208 | void EmitLoadSharedS8(EmitContext& ctx, ScalarU32 offset) { |
| 318 | NotImplemented(); | 209 | NotImplemented(); |
| 319 | } | 210 | } |
| 320 | 211 | ||
| 321 | void EmitCompositeInsertF16x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 212 | void EmitLoadSharedU16(EmitContext& ctx, ScalarU32 offset) { |
| 322 | u32 index) { | ||
| 323 | NotImplemented(); | 213 | NotImplemented(); |
| 324 | } | 214 | } |
| 325 | 215 | ||
| 326 | void EmitCompositeInsertF16x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 216 | void EmitLoadSharedS16(EmitContext& ctx, ScalarU32 offset) { |
| 327 | u32 index) { | ||
| 328 | NotImplemented(); | 217 | NotImplemented(); |
| 329 | } | 218 | } |
| 330 | 219 | ||
| 331 | void EmitCompositeInsertF16x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 220 | void EmitLoadSharedU32(EmitContext& ctx, ScalarU32 offset) { |
| 332 | u32 index) { | ||
| 333 | NotImplemented(); | 221 | NotImplemented(); |
| 334 | } | 222 | } |
| 335 | 223 | ||
| 336 | void EmitCompositeConstructF32x2(EmitContext& ctx, std::string_view e1, std::string_view e2) { | 224 | void EmitLoadSharedU64(EmitContext& ctx, ScalarU32 offset) { |
| 337 | NotImplemented(); | 225 | NotImplemented(); |
| 338 | } | 226 | } |
| 339 | 227 | ||
| 340 | void EmitCompositeConstructF32x3(EmitContext& ctx, std::string_view e1, std::string_view e2, | 228 | void EmitLoadSharedU128(EmitContext& ctx, ScalarU32 offset) { |
| 341 | std::string_view e3) { | ||
| 342 | NotImplemented(); | 229 | NotImplemented(); |
| 343 | } | 230 | } |
| 344 | 231 | ||
| 345 | void EmitCompositeConstructF32x4(EmitContext& ctx, std::string_view e1, std::string_view e2, | 232 | void EmitWriteSharedU8(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 346 | std::string_view e3, std::string_view e4) { | ||
| 347 | NotImplemented(); | 233 | NotImplemented(); |
| 348 | } | 234 | } |
| 349 | 235 | ||
| 350 | void EmitCompositeExtractF32x2(EmitContext& ctx, std::string_view composite, u32 index) { | 236 | void EmitWriteSharedU16(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 351 | NotImplemented(); | 237 | NotImplemented(); |
| 352 | } | 238 | } |
| 353 | 239 | ||
| 354 | void EmitCompositeExtractF32x3(EmitContext& ctx, std::string_view composite, u32 index) { | 240 | void EmitWriteSharedU32(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 355 | NotImplemented(); | 241 | NotImplemented(); |
| 356 | } | 242 | } |
| 357 | 243 | ||
| 358 | void EmitCompositeExtractF32x4(EmitContext& ctx, std::string_view composite, u32 index) { | 244 | void EmitWriteSharedU64(EmitContext& ctx, ScalarU32 offset, Register value) { |
| 359 | NotImplemented(); | 245 | NotImplemented(); |
| 360 | } | 246 | } |
| 361 | 247 | ||
| 362 | void EmitCompositeInsertF32x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 248 | void EmitWriteSharedU128(EmitContext& ctx, ScalarU32 offset, Register value) { |
| 363 | u32 index) { | ||
| 364 | NotImplemented(); | 249 | NotImplemented(); |
| 365 | } | 250 | } |
| 366 | 251 | ||
| 367 | void EmitCompositeInsertF32x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 252 | void EmitSelectU1(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { |
| 368 | u32 index) { | ||
| 369 | NotImplemented(); | 253 | NotImplemented(); |
| 370 | } | 254 | } |
| 371 | 255 | ||
| 372 | void EmitCompositeInsertF32x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 256 | void EmitSelectU8(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { |
| 373 | u32 index) { | ||
| 374 | NotImplemented(); | 257 | NotImplemented(); |
| 375 | } | 258 | } |
| 376 | 259 | ||
| 377 | void EmitCompositeConstructF64x2(EmitContext& ctx) { | 260 | void EmitSelectU16(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { |
| 378 | NotImplemented(); | 261 | NotImplemented(); |
| 379 | } | 262 | } |
| 380 | 263 | ||
| 381 | void EmitCompositeConstructF64x3(EmitContext& ctx) { | 264 | void EmitSelectU32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { |
| 382 | NotImplemented(); | 265 | NotImplemented(); |
| 383 | } | 266 | } |
| 384 | 267 | ||
| 385 | void EmitCompositeConstructF64x4(EmitContext& ctx) { | 268 | void EmitSelectU64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { |
| 386 | NotImplemented(); | 269 | NotImplemented(); |
| 387 | } | 270 | } |
| 388 | 271 | ||
| 389 | void EmitCompositeExtractF64x2(EmitContext& ctx) { | 272 | void EmitSelectF16(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { |
| 390 | NotImplemented(); | 273 | NotImplemented(); |
| 391 | } | 274 | } |
| 392 | 275 | ||
| 393 | void EmitCompositeExtractF64x3(EmitContext& ctx) { | 276 | void EmitSelectF32(EmitContext& ctx, ScalarS32 cond, ScalarS32 true_value, ScalarS32 false_value) { |
| 394 | NotImplemented(); | 277 | NotImplemented(); |
| 395 | } | 278 | } |
| 396 | 279 | ||
| 397 | void EmitCompositeExtractF64x4(EmitContext& ctx) { | 280 | void EmitSelectF64(EmitContext& ctx, ScalarS32 cond, Register true_value, Register false_value) { |
| 398 | NotImplemented(); | 281 | NotImplemented(); |
| 399 | } | 282 | } |
| 400 | 283 | ||
| 401 | void EmitCompositeInsertF64x2(EmitContext& ctx, std::string_view composite, std::string_view object, | 284 | void EmitSelectF16(EmitContext& ctx, Register cond, Register true_value, Register false_value) { |
| 402 | u32 index) { | ||
| 403 | NotImplemented(); | 285 | NotImplemented(); |
| 404 | } | 286 | } |
| 405 | 287 | ||
| 406 | void EmitCompositeInsertF64x3(EmitContext& ctx, std::string_view composite, std::string_view object, | 288 | void EmitSelectF32(EmitContext& ctx, Register cond, Register true_value, Register false_value) { |
| 407 | u32 index) { | ||
| 408 | NotImplemented(); | 289 | NotImplemented(); |
| 409 | } | 290 | } |
| 410 | 291 | ||
| 411 | void EmitCompositeInsertF64x4(EmitContext& ctx, std::string_view composite, std::string_view object, | 292 | void EmitSelectF64(EmitContext& ctx, Register cond, Register true_value, Register false_value) { |
| 412 | u32 index) { | ||
| 413 | NotImplemented(); | 293 | NotImplemented(); |
| 414 | } | 294 | } |
| 415 | 295 | ||
| 416 | void EmitPackUint2x32(EmitContext& ctx, std::string_view value) { | 296 | void EmitPackUint2x32(EmitContext& ctx, Register value) { |
| 417 | NotImplemented(); | 297 | NotImplemented(); |
| 418 | } | 298 | } |
| 419 | 299 | ||
| 420 | void EmitUnpackUint2x32(EmitContext& ctx, std::string_view value) { | 300 | void EmitUnpackUint2x32(EmitContext& ctx, Register value) { |
| 421 | NotImplemented(); | 301 | NotImplemented(); |
| 422 | } | 302 | } |
| 423 | 303 | ||
| 424 | void EmitPackFloat2x16(EmitContext& ctx, std::string_view value) { | 304 | void EmitPackFloat2x16(EmitContext& ctx, Register value) { |
| 425 | NotImplemented(); | 305 | NotImplemented(); |
| 426 | } | 306 | } |
| 427 | 307 | ||
| 428 | void EmitUnpackFloat2x16(EmitContext& ctx, std::string_view value) { | 308 | void EmitUnpackFloat2x16(EmitContext& ctx, Register value) { |
| 429 | NotImplemented(); | 309 | NotImplemented(); |
| 430 | } | 310 | } |
| 431 | 311 | ||
| 432 | void EmitPackHalf2x16(EmitContext& ctx, std::string_view value) { | 312 | void EmitPackHalf2x16(EmitContext& ctx, Register value) { |
| 433 | NotImplemented(); | 313 | NotImplemented(); |
| 434 | } | 314 | } |
| 435 | 315 | ||
| 436 | void EmitUnpackHalf2x16(EmitContext& ctx, std::string_view value) { | 316 | void EmitUnpackHalf2x16(EmitContext& ctx, Register value) { |
| 437 | NotImplemented(); | 317 | NotImplemented(); |
| 438 | } | 318 | } |
| 439 | 319 | ||
| 440 | void EmitPackDouble2x32(EmitContext& ctx, std::string_view value) { | 320 | void EmitPackDouble2x32(EmitContext& ctx, Register value) { |
| 441 | NotImplemented(); | 321 | NotImplemented(); |
| 442 | } | 322 | } |
| 443 | 323 | ||
| 444 | void EmitUnpackDouble2x32(EmitContext& ctx, std::string_view value) { | 324 | void EmitUnpackDouble2x32(EmitContext& ctx, Register value) { |
| 445 | NotImplemented(); | 325 | NotImplemented(); |
| 446 | } | 326 | } |
| 447 | 327 | ||
| @@ -469,210 +349,198 @@ void EmitGetInBoundsFromOp(EmitContext& ctx) { | |||
| 469 | NotImplemented(); | 349 | NotImplemented(); |
| 470 | } | 350 | } |
| 471 | 351 | ||
| 472 | void EmitFPIsNan16(EmitContext& ctx, std::string_view value) { | 352 | void EmitFPIsNan16(EmitContext& ctx, Register value) { |
| 473 | NotImplemented(); | 353 | NotImplemented(); |
| 474 | } | 354 | } |
| 475 | 355 | ||
| 476 | void EmitFPIsNan32(EmitContext& ctx, std::string_view value) { | 356 | void EmitFPIsNan32(EmitContext& ctx, ScalarF32 value) { |
| 477 | NotImplemented(); | 357 | NotImplemented(); |
| 478 | } | 358 | } |
| 479 | 359 | ||
| 480 | void EmitFPIsNan64(EmitContext& ctx, std::string_view value) { | 360 | void EmitFPIsNan64(EmitContext& ctx, Register value) { |
| 481 | NotImplemented(); | 361 | NotImplemented(); |
| 482 | } | 362 | } |
| 483 | 363 | ||
| 484 | void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string_view pointer_offset, | 364 | void EmitSharedAtomicIAdd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 485 | std::string_view value) { | ||
| 486 | NotImplemented(); | 365 | NotImplemented(); |
| 487 | } | 366 | } |
| 488 | 367 | ||
| 489 | void EmitSharedAtomicSMin32(EmitContext& ctx, std::string_view pointer_offset, | 368 | void EmitSharedAtomicSMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value) { |
| 490 | std::string_view value) { | ||
| 491 | NotImplemented(); | 369 | NotImplemented(); |
| 492 | } | 370 | } |
| 493 | 371 | ||
| 494 | void EmitSharedAtomicUMin32(EmitContext& ctx, std::string_view pointer_offset, | 372 | void EmitSharedAtomicUMin32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 495 | std::string_view value) { | ||
| 496 | NotImplemented(); | 373 | NotImplemented(); |
| 497 | } | 374 | } |
| 498 | 375 | ||
| 499 | void EmitSharedAtomicSMax32(EmitContext& ctx, std::string_view pointer_offset, | 376 | void EmitSharedAtomicSMax32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarS32 value) { |
| 500 | std::string_view value) { | ||
| 501 | NotImplemented(); | 377 | NotImplemented(); |
| 502 | } | 378 | } |
| 503 | 379 | ||
| 504 | void EmitSharedAtomicUMax32(EmitContext& ctx, std::string_view pointer_offset, | 380 | void EmitSharedAtomicUMax32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 505 | std::string_view value) { | ||
| 506 | NotImplemented(); | 381 | NotImplemented(); |
| 507 | } | 382 | } |
| 508 | 383 | ||
| 509 | void EmitSharedAtomicInc32(EmitContext& ctx, std::string_view pointer_offset, | 384 | void EmitSharedAtomicInc32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 510 | std::string_view value) { | ||
| 511 | NotImplemented(); | 385 | NotImplemented(); |
| 512 | } | 386 | } |
| 513 | 387 | ||
| 514 | void EmitSharedAtomicDec32(EmitContext& ctx, std::string_view pointer_offset, | 388 | void EmitSharedAtomicDec32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 515 | std::string_view value) { | ||
| 516 | NotImplemented(); | 389 | NotImplemented(); |
| 517 | } | 390 | } |
| 518 | 391 | ||
| 519 | void EmitSharedAtomicAnd32(EmitContext& ctx, std::string_view pointer_offset, | 392 | void EmitSharedAtomicAnd32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 520 | std::string_view value) { | ||
| 521 | NotImplemented(); | 393 | NotImplemented(); |
| 522 | } | 394 | } |
| 523 | 395 | ||
| 524 | void EmitSharedAtomicOr32(EmitContext& ctx, std::string_view pointer_offset, | 396 | void EmitSharedAtomicOr32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 525 | std::string_view value) { | ||
| 526 | NotImplemented(); | 397 | NotImplemented(); |
| 527 | } | 398 | } |
| 528 | 399 | ||
| 529 | void EmitSharedAtomicXor32(EmitContext& ctx, std::string_view pointer_offset, | 400 | void EmitSharedAtomicXor32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 530 | std::string_view value) { | ||
| 531 | NotImplemented(); | 401 | NotImplemented(); |
| 532 | } | 402 | } |
| 533 | 403 | ||
| 534 | void EmitSharedAtomicExchange32(EmitContext& ctx, std::string_view pointer_offset, | 404 | void EmitSharedAtomicExchange32(EmitContext& ctx, ScalarU32 pointer_offset, ScalarU32 value) { |
| 535 | std::string_view value) { | ||
| 536 | NotImplemented(); | 405 | NotImplemented(); |
| 537 | } | 406 | } |
| 538 | 407 | ||
| 539 | void EmitSharedAtomicExchange64(EmitContext& ctx, std::string_view pointer_offset, | 408 | void EmitSharedAtomicExchange64(EmitContext& ctx, ScalarU32 pointer_offset, Register value) { |
| 540 | std::string_view value) { | ||
| 541 | NotImplemented(); | 409 | NotImplemented(); |
| 542 | } | 410 | } |
| 543 | 411 | ||
| 544 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 412 | void EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 545 | std::string_view value) { | 413 | ScalarU32 value) { |
| 546 | NotImplemented(); | 414 | NotImplemented(); |
| 547 | } | 415 | } |
| 548 | 416 | ||
| 549 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 417 | void EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 550 | std::string_view value) { | 418 | ScalarS32 value) { |
| 551 | NotImplemented(); | 419 | NotImplemented(); |
| 552 | } | 420 | } |
| 553 | 421 | ||
| 554 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 422 | void EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 555 | std::string_view value) { | 423 | ScalarU32 value) { |
| 556 | NotImplemented(); | 424 | NotImplemented(); |
| 557 | } | 425 | } |
| 558 | 426 | ||
| 559 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 427 | void EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 560 | std::string_view value) { | 428 | ScalarS32 value) { |
| 561 | NotImplemented(); | 429 | NotImplemented(); |
| 562 | } | 430 | } |
| 563 | 431 | ||
| 564 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 432 | void EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 565 | std::string_view value) { | 433 | ScalarU32 value) { |
| 566 | NotImplemented(); | 434 | NotImplemented(); |
| 567 | } | 435 | } |
| 568 | 436 | ||
| 569 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 437 | void EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 570 | std::string_view value) { | 438 | ScalarU32 value) { |
| 571 | NotImplemented(); | 439 | NotImplemented(); |
| 572 | } | 440 | } |
| 573 | 441 | ||
| 574 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 442 | void EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 575 | std::string_view value) { | 443 | ScalarU32 value) { |
| 576 | NotImplemented(); | 444 | NotImplemented(); |
| 577 | } | 445 | } |
| 578 | 446 | ||
| 579 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 447 | void EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 580 | std::string_view value) { | 448 | ScalarU32 value) { |
| 581 | NotImplemented(); | 449 | NotImplemented(); |
| 582 | } | 450 | } |
| 583 | 451 | ||
| 584 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 452 | void EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 585 | std::string_view value) { | 453 | ScalarU32 value) { |
| 586 | NotImplemented(); | 454 | NotImplemented(); |
| 587 | } | 455 | } |
| 588 | 456 | ||
| 589 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 457 | void EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 590 | std::string_view value) { | 458 | ScalarU32 value) { |
| 591 | NotImplemented(); | 459 | NotImplemented(); |
| 592 | } | 460 | } |
| 593 | 461 | ||
| 594 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, | 462 | void EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, |
| 595 | const IR::Value& offset, std::string_view value) { | 463 | const IR::Value& offset, ScalarU32 value) { |
| 596 | NotImplemented(); | 464 | NotImplemented(); |
| 597 | } | 465 | } |
| 598 | 466 | ||
| 599 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 467 | void EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 600 | std::string_view value) { | 468 | Register value) { |
| 601 | NotImplemented(); | 469 | NotImplemented(); |
| 602 | } | 470 | } |
| 603 | 471 | ||
| 604 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 472 | void EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 605 | std::string_view value) { | 473 | Register value) { |
| 606 | NotImplemented(); | 474 | NotImplemented(); |
| 607 | } | 475 | } |
| 608 | 476 | ||
| 609 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 477 | void EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 610 | std::string_view value) { | 478 | Register value) { |
| 611 | NotImplemented(); | 479 | NotImplemented(); |
| 612 | } | 480 | } |
| 613 | 481 | ||
| 614 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 482 | void EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 615 | std::string_view value) { | 483 | Register value) { |
| 616 | NotImplemented(); | 484 | NotImplemented(); |
| 617 | } | 485 | } |
| 618 | 486 | ||
| 619 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 487 | void EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 620 | std::string_view value) { | 488 | Register value) { |
| 621 | NotImplemented(); | 489 | NotImplemented(); |
| 622 | } | 490 | } |
| 623 | 491 | ||
| 624 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 492 | void EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 625 | std::string_view value) { | 493 | Register value) { |
| 626 | NotImplemented(); | 494 | NotImplemented(); |
| 627 | } | 495 | } |
| 628 | 496 | ||
| 629 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 497 | void EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 630 | std::string_view value) { | 498 | Register value) { |
| 631 | NotImplemented(); | 499 | NotImplemented(); |
| 632 | } | 500 | } |
| 633 | 501 | ||
| 634 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 502 | void EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 635 | std::string_view value) { | 503 | Register value) { |
| 636 | NotImplemented(); | 504 | NotImplemented(); |
| 637 | } | 505 | } |
| 638 | 506 | ||
| 639 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, | 507 | void EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, |
| 640 | const IR::Value& offset, std::string_view value) { | 508 | const IR::Value& offset, Register value) { |
| 641 | NotImplemented(); | 509 | NotImplemented(); |
| 642 | } | 510 | } |
| 643 | 511 | ||
| 644 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 512 | void EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 645 | std::string_view value) { | 513 | ScalarF32 value) { |
| 646 | NotImplemented(); | 514 | NotImplemented(); |
| 647 | } | 515 | } |
| 648 | 516 | ||
| 649 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 517 | void EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 650 | std::string_view value) { | 518 | Register value) { |
| 651 | NotImplemented(); | 519 | NotImplemented(); |
| 652 | } | 520 | } |
| 653 | 521 | ||
| 654 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 522 | void EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 655 | std::string_view value) { | 523 | Register value) { |
| 656 | NotImplemented(); | 524 | NotImplemented(); |
| 657 | } | 525 | } |
| 658 | 526 | ||
| 659 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 527 | void EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 660 | std::string_view value) { | 528 | Register value) { |
| 661 | NotImplemented(); | 529 | NotImplemented(); |
| 662 | } | 530 | } |
| 663 | 531 | ||
| 664 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 532 | void EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 665 | std::string_view value) { | 533 | Register value) { |
| 666 | NotImplemented(); | 534 | NotImplemented(); |
| 667 | } | 535 | } |
| 668 | 536 | ||
| 669 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 537 | void EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 670 | std::string_view value) { | 538 | Register value) { |
| 671 | NotImplemented(); | 539 | NotImplemented(); |
| 672 | } | 540 | } |
| 673 | 541 | ||
| 674 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 542 | void EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 675 | std::string_view value) { | 543 | Register value) { |
| 676 | NotImplemented(); | 544 | NotImplemented(); |
| 677 | } | 545 | } |
| 678 | 546 | ||
| @@ -792,211 +660,211 @@ void EmitGlobalAtomicMaxF32x2(EmitContext& ctx) { | |||
| 792 | NotImplemented(); | 660 | NotImplemented(); |
| 793 | } | 661 | } |
| 794 | 662 | ||
| 795 | void EmitLogicalOr(EmitContext& ctx, std::string_view a, std::string_view b) { | 663 | void EmitLogicalOr(EmitContext& ctx, ScalarS32 a, ScalarS32 b) { |
| 796 | NotImplemented(); | 664 | NotImplemented(); |
| 797 | } | 665 | } |
| 798 | 666 | ||
| 799 | void EmitLogicalAnd(EmitContext& ctx, std::string_view a, std::string_view b) { | 667 | void EmitLogicalAnd(EmitContext& ctx, ScalarS32 a, ScalarS32 b) { |
| 800 | NotImplemented(); | 668 | NotImplemented(); |
| 801 | } | 669 | } |
| 802 | 670 | ||
| 803 | void EmitLogicalXor(EmitContext& ctx, std::string_view a, std::string_view b) { | 671 | void EmitLogicalXor(EmitContext& ctx, ScalarS32 a, ScalarS32 b) { |
| 804 | NotImplemented(); | 672 | NotImplemented(); |
| 805 | } | 673 | } |
| 806 | 674 | ||
| 807 | void EmitLogicalNot(EmitContext& ctx, std::string_view value) { | 675 | void EmitLogicalNot(EmitContext& ctx, ScalarS32 value) { |
| 808 | NotImplemented(); | 676 | NotImplemented(); |
| 809 | } | 677 | } |
| 810 | 678 | ||
| 811 | void EmitConvertS16F16(EmitContext& ctx, std::string_view value) { | 679 | void EmitConvertS16F16(EmitContext& ctx, Register value) { |
| 812 | NotImplemented(); | 680 | NotImplemented(); |
| 813 | } | 681 | } |
| 814 | 682 | ||
| 815 | void EmitConvertS16F32(EmitContext& ctx, std::string_view value) { | 683 | void EmitConvertS16F32(EmitContext& ctx, Register value) { |
| 816 | NotImplemented(); | 684 | NotImplemented(); |
| 817 | } | 685 | } |
| 818 | 686 | ||
| 819 | void EmitConvertS16F64(EmitContext& ctx, std::string_view value) { | 687 | void EmitConvertS16F64(EmitContext& ctx, Register value) { |
| 820 | NotImplemented(); | 688 | NotImplemented(); |
| 821 | } | 689 | } |
| 822 | 690 | ||
| 823 | void EmitConvertS32F16(EmitContext& ctx, std::string_view value) { | 691 | void EmitConvertS32F16(EmitContext& ctx, Register value) { |
| 824 | NotImplemented(); | 692 | NotImplemented(); |
| 825 | } | 693 | } |
| 826 | 694 | ||
| 827 | void EmitConvertS32F32(EmitContext& ctx, std::string_view value) { | 695 | void EmitConvertS32F32(EmitContext& ctx, Register value) { |
| 828 | NotImplemented(); | 696 | NotImplemented(); |
| 829 | } | 697 | } |
| 830 | 698 | ||
| 831 | void EmitConvertS32F64(EmitContext& ctx, std::string_view value) { | 699 | void EmitConvertS32F64(EmitContext& ctx, Register value) { |
| 832 | NotImplemented(); | 700 | NotImplemented(); |
| 833 | } | 701 | } |
| 834 | 702 | ||
| 835 | void EmitConvertS64F16(EmitContext& ctx, std::string_view value) { | 703 | void EmitConvertS64F16(EmitContext& ctx, Register value) { |
| 836 | NotImplemented(); | 704 | NotImplemented(); |
| 837 | } | 705 | } |
| 838 | 706 | ||
| 839 | void EmitConvertS64F32(EmitContext& ctx, std::string_view value) { | 707 | void EmitConvertS64F32(EmitContext& ctx, Register value) { |
| 840 | NotImplemented(); | 708 | NotImplemented(); |
| 841 | } | 709 | } |
| 842 | 710 | ||
| 843 | void EmitConvertS64F64(EmitContext& ctx, std::string_view value) { | 711 | void EmitConvertS64F64(EmitContext& ctx, Register value) { |
| 844 | NotImplemented(); | 712 | NotImplemented(); |
| 845 | } | 713 | } |
| 846 | 714 | ||
| 847 | void EmitConvertU16F16(EmitContext& ctx, std::string_view value) { | 715 | void EmitConvertU16F16(EmitContext& ctx, Register value) { |
| 848 | NotImplemented(); | 716 | NotImplemented(); |
| 849 | } | 717 | } |
| 850 | 718 | ||
| 851 | void EmitConvertU16F32(EmitContext& ctx, std::string_view value) { | 719 | void EmitConvertU16F32(EmitContext& ctx, Register value) { |
| 852 | NotImplemented(); | 720 | NotImplemented(); |
| 853 | } | 721 | } |
| 854 | 722 | ||
| 855 | void EmitConvertU16F64(EmitContext& ctx, std::string_view value) { | 723 | void EmitConvertU16F64(EmitContext& ctx, Register value) { |
| 856 | NotImplemented(); | 724 | NotImplemented(); |
| 857 | } | 725 | } |
| 858 | 726 | ||
| 859 | void EmitConvertU32F16(EmitContext& ctx, std::string_view value) { | 727 | void EmitConvertU32F16(EmitContext& ctx, Register value) { |
| 860 | NotImplemented(); | 728 | NotImplemented(); |
| 861 | } | 729 | } |
| 862 | 730 | ||
| 863 | void EmitConvertU32F32(EmitContext& ctx, std::string_view value) { | 731 | void EmitConvertU32F32(EmitContext& ctx, Register value) { |
| 864 | NotImplemented(); | 732 | NotImplemented(); |
| 865 | } | 733 | } |
| 866 | 734 | ||
| 867 | void EmitConvertU32F64(EmitContext& ctx, std::string_view value) { | 735 | void EmitConvertU32F64(EmitContext& ctx, Register value) { |
| 868 | NotImplemented(); | 736 | NotImplemented(); |
| 869 | } | 737 | } |
| 870 | 738 | ||
| 871 | void EmitConvertU64F16(EmitContext& ctx, std::string_view value) { | 739 | void EmitConvertU64F16(EmitContext& ctx, Register value) { |
| 872 | NotImplemented(); | 740 | NotImplemented(); |
| 873 | } | 741 | } |
| 874 | 742 | ||
| 875 | void EmitConvertU64F32(EmitContext& ctx, std::string_view value) { | 743 | void EmitConvertU64F32(EmitContext& ctx, Register value) { |
| 876 | NotImplemented(); | 744 | NotImplemented(); |
| 877 | } | 745 | } |
| 878 | 746 | ||
| 879 | void EmitConvertU64F64(EmitContext& ctx, std::string_view value) { | 747 | void EmitConvertU64F64(EmitContext& ctx, Register value) { |
| 880 | NotImplemented(); | 748 | NotImplemented(); |
| 881 | } | 749 | } |
| 882 | 750 | ||
| 883 | void EmitConvertU64U32(EmitContext& ctx, std::string_view value) { | 751 | void EmitConvertU64U32(EmitContext& ctx, Register value) { |
| 884 | NotImplemented(); | 752 | NotImplemented(); |
| 885 | } | 753 | } |
| 886 | 754 | ||
| 887 | void EmitConvertU32U64(EmitContext& ctx, std::string_view value) { | 755 | void EmitConvertU32U64(EmitContext& ctx, Register value) { |
| 888 | NotImplemented(); | 756 | NotImplemented(); |
| 889 | } | 757 | } |
| 890 | 758 | ||
| 891 | void EmitConvertF16F32(EmitContext& ctx, std::string_view value) { | 759 | void EmitConvertF16F32(EmitContext& ctx, Register value) { |
| 892 | NotImplemented(); | 760 | NotImplemented(); |
| 893 | } | 761 | } |
| 894 | 762 | ||
| 895 | void EmitConvertF32F16(EmitContext& ctx, std::string_view value) { | 763 | void EmitConvertF32F16(EmitContext& ctx, Register value) { |
| 896 | NotImplemented(); | 764 | NotImplemented(); |
| 897 | } | 765 | } |
| 898 | 766 | ||
| 899 | void EmitConvertF32F64(EmitContext& ctx, std::string_view value) { | 767 | void EmitConvertF32F64(EmitContext& ctx, Register value) { |
| 900 | NotImplemented(); | 768 | NotImplemented(); |
| 901 | } | 769 | } |
| 902 | 770 | ||
| 903 | void EmitConvertF64F32(EmitContext& ctx, std::string_view value) { | 771 | void EmitConvertF64F32(EmitContext& ctx, Register value) { |
| 904 | NotImplemented(); | 772 | NotImplemented(); |
| 905 | } | 773 | } |
| 906 | 774 | ||
| 907 | void EmitConvertF16S8(EmitContext& ctx, std::string_view value) { | 775 | void EmitConvertF16S8(EmitContext& ctx, Register value) { |
| 908 | NotImplemented(); | 776 | NotImplemented(); |
| 909 | } | 777 | } |
| 910 | 778 | ||
| 911 | void EmitConvertF16S16(EmitContext& ctx, std::string_view value) { | 779 | void EmitConvertF16S16(EmitContext& ctx, Register value) { |
| 912 | NotImplemented(); | 780 | NotImplemented(); |
| 913 | } | 781 | } |
| 914 | 782 | ||
| 915 | void EmitConvertF16S32(EmitContext& ctx, std::string_view value) { | 783 | void EmitConvertF16S32(EmitContext& ctx, Register value) { |
| 916 | NotImplemented(); | 784 | NotImplemented(); |
| 917 | } | 785 | } |
| 918 | 786 | ||
| 919 | void EmitConvertF16S64(EmitContext& ctx, std::string_view value) { | 787 | void EmitConvertF16S64(EmitContext& ctx, Register value) { |
| 920 | NotImplemented(); | 788 | NotImplemented(); |
| 921 | } | 789 | } |
| 922 | 790 | ||
| 923 | void EmitConvertF16U8(EmitContext& ctx, std::string_view value) { | 791 | void EmitConvertF16U8(EmitContext& ctx, Register value) { |
| 924 | NotImplemented(); | 792 | NotImplemented(); |
| 925 | } | 793 | } |
| 926 | 794 | ||
| 927 | void EmitConvertF16U16(EmitContext& ctx, std::string_view value) { | 795 | void EmitConvertF16U16(EmitContext& ctx, Register value) { |
| 928 | NotImplemented(); | 796 | NotImplemented(); |
| 929 | } | 797 | } |
| 930 | 798 | ||
| 931 | void EmitConvertF16U32(EmitContext& ctx, std::string_view value) { | 799 | void EmitConvertF16U32(EmitContext& ctx, Register value) { |
| 932 | NotImplemented(); | 800 | NotImplemented(); |
| 933 | } | 801 | } |
| 934 | 802 | ||
| 935 | void EmitConvertF16U64(EmitContext& ctx, std::string_view value) { | 803 | void EmitConvertF16U64(EmitContext& ctx, Register value) { |
| 936 | NotImplemented(); | 804 | NotImplemented(); |
| 937 | } | 805 | } |
| 938 | 806 | ||
| 939 | void EmitConvertF32S8(EmitContext& ctx, std::string_view value) { | 807 | void EmitConvertF32S8(EmitContext& ctx, Register value) { |
| 940 | NotImplemented(); | 808 | NotImplemented(); |
| 941 | } | 809 | } |
| 942 | 810 | ||
| 943 | void EmitConvertF32S16(EmitContext& ctx, std::string_view value) { | 811 | void EmitConvertF32S16(EmitContext& ctx, Register value) { |
| 944 | NotImplemented(); | 812 | NotImplemented(); |
| 945 | } | 813 | } |
| 946 | 814 | ||
| 947 | void EmitConvertF32S32(EmitContext& ctx, std::string_view value) { | 815 | void EmitConvertF32S32(EmitContext& ctx, Register value) { |
| 948 | NotImplemented(); | 816 | NotImplemented(); |
| 949 | } | 817 | } |
| 950 | 818 | ||
| 951 | void EmitConvertF32S64(EmitContext& ctx, std::string_view value) { | 819 | void EmitConvertF32S64(EmitContext& ctx, Register value) { |
| 952 | NotImplemented(); | 820 | NotImplemented(); |
| 953 | } | 821 | } |
| 954 | 822 | ||
| 955 | void EmitConvertF32U8(EmitContext& ctx, std::string_view value) { | 823 | void EmitConvertF32U8(EmitContext& ctx, Register value) { |
| 956 | NotImplemented(); | 824 | NotImplemented(); |
| 957 | } | 825 | } |
| 958 | 826 | ||
| 959 | void EmitConvertF32U16(EmitContext& ctx, std::string_view value) { | 827 | void EmitConvertF32U16(EmitContext& ctx, Register value) { |
| 960 | NotImplemented(); | 828 | NotImplemented(); |
| 961 | } | 829 | } |
| 962 | 830 | ||
| 963 | void EmitConvertF32U32(EmitContext& ctx, std::string_view value) { | 831 | void EmitConvertF32U32(EmitContext& ctx, Register value) { |
| 964 | NotImplemented(); | 832 | NotImplemented(); |
| 965 | } | 833 | } |
| 966 | 834 | ||
| 967 | void EmitConvertF32U64(EmitContext& ctx, std::string_view value) { | 835 | void EmitConvertF32U64(EmitContext& ctx, Register value) { |
| 968 | NotImplemented(); | 836 | NotImplemented(); |
| 969 | } | 837 | } |
| 970 | 838 | ||
| 971 | void EmitConvertF64S8(EmitContext& ctx, std::string_view value) { | 839 | void EmitConvertF64S8(EmitContext& ctx, Register value) { |
| 972 | NotImplemented(); | 840 | NotImplemented(); |
| 973 | } | 841 | } |
| 974 | 842 | ||
| 975 | void EmitConvertF64S16(EmitContext& ctx, std::string_view value) { | 843 | void EmitConvertF64S16(EmitContext& ctx, Register value) { |
| 976 | NotImplemented(); | 844 | NotImplemented(); |
| 977 | } | 845 | } |
| 978 | 846 | ||
| 979 | void EmitConvertF64S32(EmitContext& ctx, std::string_view value) { | 847 | void EmitConvertF64S32(EmitContext& ctx, Register value) { |
| 980 | NotImplemented(); | 848 | NotImplemented(); |
| 981 | } | 849 | } |
| 982 | 850 | ||
| 983 | void EmitConvertF64S64(EmitContext& ctx, std::string_view value) { | 851 | void EmitConvertF64S64(EmitContext& ctx, Register value) { |
| 984 | NotImplemented(); | 852 | NotImplemented(); |
| 985 | } | 853 | } |
| 986 | 854 | ||
| 987 | void EmitConvertF64U8(EmitContext& ctx, std::string_view value) { | 855 | void EmitConvertF64U8(EmitContext& ctx, Register value) { |
| 988 | NotImplemented(); | 856 | NotImplemented(); |
| 989 | } | 857 | } |
| 990 | 858 | ||
| 991 | void EmitConvertF64U16(EmitContext& ctx, std::string_view value) { | 859 | void EmitConvertF64U16(EmitContext& ctx, Register value) { |
| 992 | NotImplemented(); | 860 | NotImplemented(); |
| 993 | } | 861 | } |
| 994 | 862 | ||
| 995 | void EmitConvertF64U32(EmitContext& ctx, std::string_view value) { | 863 | void EmitConvertF64U32(EmitContext& ctx, Register value) { |
| 996 | NotImplemented(); | 864 | NotImplemented(); |
| 997 | } | 865 | } |
| 998 | 866 | ||
| 999 | void EmitConvertF64U64(EmitContext& ctx, std::string_view value) { | 867 | void EmitConvertF64U64(EmitContext& ctx, Register value) { |
| 1000 | NotImplemented(); | 868 | NotImplemented(); |
| 1001 | } | 869 | } |
| 1002 | 870 | ||
| @@ -1097,69 +965,62 @@ void EmitBoundImageWrite(EmitContext&) { | |||
| 1097 | } | 965 | } |
| 1098 | 966 | ||
| 1099 | void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 967 | void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1100 | std::string_view coords, std::string_view bias_lc, | 968 | Register coords, Register bias_lc, const IR::Value& offset) { |
| 1101 | const IR::Value& offset) { | ||
| 1102 | NotImplemented(); | 969 | NotImplemented(); |
| 1103 | } | 970 | } |
| 1104 | 971 | ||
| 1105 | void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 972 | void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1106 | std::string_view coords, std::string_view lod_lc, | 973 | Register coords, Register lod_lc, const IR::Value& offset) { |
| 1107 | const IR::Value& offset) { | ||
| 1108 | NotImplemented(); | 974 | NotImplemented(); |
| 1109 | } | 975 | } |
| 1110 | 976 | ||
| 1111 | void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 977 | void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1112 | std::string_view coords, std::string_view dref, | 978 | Register coords, Register dref, Register bias_lc, |
| 1113 | std::string_view bias_lc, const IR::Value& offset) { | 979 | const IR::Value& offset) { |
| 1114 | NotImplemented(); | 980 | NotImplemented(); |
| 1115 | } | 981 | } |
| 1116 | 982 | ||
| 1117 | void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 983 | void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1118 | std::string_view coords, std::string_view dref, | 984 | Register coords, Register dref, Register lod_lc, |
| 1119 | std::string_view lod_lc, const IR::Value& offset) { | 985 | const IR::Value& offset) { |
| 1120 | NotImplemented(); | 986 | NotImplemented(); |
| 1121 | } | 987 | } |
| 1122 | 988 | ||
| 1123 | void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 989 | void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1124 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2) { | 990 | const IR::Value& offset, const IR::Value& offset2) { |
| 1125 | NotImplemented(); | 991 | NotImplemented(); |
| 1126 | } | 992 | } |
| 1127 | 993 | ||
| 1128 | void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 994 | void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1129 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2, | 995 | const IR::Value& offset, const IR::Value& offset2, Register dref) { |
| 1130 | std::string_view dref) { | ||
| 1131 | NotImplemented(); | 996 | NotImplemented(); |
| 1132 | } | 997 | } |
| 1133 | 998 | ||
| 1134 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 999 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1135 | std::string_view coords, std::string_view offset, std::string_view lod, | 1000 | Register offset, Register lod, Register ms) { |
| 1136 | std::string_view ms) { | ||
| 1137 | NotImplemented(); | 1001 | NotImplemented(); |
| 1138 | } | 1002 | } |
| 1139 | 1003 | ||
| 1140 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1004 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1141 | std::string_view lod) { | 1005 | Register lod) { |
| 1142 | NotImplemented(); | 1006 | NotImplemented(); |
| 1143 | } | 1007 | } |
| 1144 | 1008 | ||
| 1145 | void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1009 | void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords) { |
| 1146 | std::string_view coords) { | ||
| 1147 | NotImplemented(); | 1010 | NotImplemented(); |
| 1148 | } | 1011 | } |
| 1149 | 1012 | ||
| 1150 | void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1013 | void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1151 | std::string_view coords, std::string_view derivates, std::string_view offset, | 1014 | Register derivates, Register offset, Register lod_clamp) { |
| 1152 | std::string_view lod_clamp) { | ||
| 1153 | NotImplemented(); | 1015 | NotImplemented(); |
| 1154 | } | 1016 | } |
| 1155 | 1017 | ||
| 1156 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1018 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords) { |
| 1157 | std::string_view coords) { | ||
| 1158 | NotImplemented(); | 1019 | NotImplemented(); |
| 1159 | } | 1020 | } |
| 1160 | 1021 | ||
| 1161 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1022 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1162 | std::string_view coords, std::string_view color) { | 1023 | Register color) { |
| 1163 | NotImplemented(); | 1024 | NotImplemented(); |
| 1164 | } | 1025 | } |
| 1165 | 1026 | ||
| @@ -1252,57 +1113,57 @@ void EmitBoundImageAtomicExchange32(EmitContext&) { | |||
| 1252 | } | 1113 | } |
| 1253 | 1114 | ||
| 1254 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1115 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1255 | std::string_view coords, std::string_view value) { | 1116 | Register coords, ScalarU32 value) { |
| 1256 | NotImplemented(); | 1117 | NotImplemented(); |
| 1257 | } | 1118 | } |
| 1258 | 1119 | ||
| 1259 | void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1120 | void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1260 | std::string_view coords, std::string_view value) { | 1121 | Register coords, ScalarS32 value) { |
| 1261 | NotImplemented(); | 1122 | NotImplemented(); |
| 1262 | } | 1123 | } |
| 1263 | 1124 | ||
| 1264 | void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1125 | void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1265 | std::string_view coords, std::string_view value) { | 1126 | Register coords, ScalarU32 value) { |
| 1266 | NotImplemented(); | 1127 | NotImplemented(); |
| 1267 | } | 1128 | } |
| 1268 | 1129 | ||
| 1269 | void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1130 | void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1270 | std::string_view coords, std::string_view value) { | 1131 | Register coords, ScalarS32 value) { |
| 1271 | NotImplemented(); | 1132 | NotImplemented(); |
| 1272 | } | 1133 | } |
| 1273 | 1134 | ||
| 1274 | void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1135 | void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1275 | std::string_view coords, std::string_view value) { | 1136 | Register coords, ScalarU32 value) { |
| 1276 | NotImplemented(); | 1137 | NotImplemented(); |
| 1277 | } | 1138 | } |
| 1278 | 1139 | ||
| 1279 | void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1140 | void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1280 | std::string_view coords, std::string_view value) { | 1141 | ScalarU32 value) { |
| 1281 | NotImplemented(); | 1142 | NotImplemented(); |
| 1282 | } | 1143 | } |
| 1283 | 1144 | ||
| 1284 | void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1145 | void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1285 | std::string_view coords, std::string_view value) { | 1146 | ScalarU32 value) { |
| 1286 | NotImplemented(); | 1147 | NotImplemented(); |
| 1287 | } | 1148 | } |
| 1288 | 1149 | ||
| 1289 | void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1150 | void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1290 | std::string_view coords, std::string_view value) { | 1151 | ScalarU32 value) { |
| 1291 | NotImplemented(); | 1152 | NotImplemented(); |
| 1292 | } | 1153 | } |
| 1293 | 1154 | ||
| 1294 | void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1155 | void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1295 | std::string_view coords, std::string_view value) { | 1156 | ScalarU32 value) { |
| 1296 | NotImplemented(); | 1157 | NotImplemented(); |
| 1297 | } | 1158 | } |
| 1298 | 1159 | ||
| 1299 | void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1160 | void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coords, |
| 1300 | std::string_view coords, std::string_view value) { | 1161 | ScalarU32 value) { |
| 1301 | NotImplemented(); | 1162 | NotImplemented(); |
| 1302 | } | 1163 | } |
| 1303 | 1164 | ||
| 1304 | void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 1165 | void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 1305 | std::string_view coords, std::string_view value) { | 1166 | Register coords, ScalarU32 value) { |
| 1306 | NotImplemented(); | 1167 | NotImplemented(); |
| 1307 | } | 1168 | } |
| 1308 | 1169 | ||
| @@ -1310,19 +1171,19 @@ void EmitLaneId(EmitContext& ctx) { | |||
| 1310 | NotImplemented(); | 1171 | NotImplemented(); |
| 1311 | } | 1172 | } |
| 1312 | 1173 | ||
| 1313 | void EmitVoteAll(EmitContext& ctx, std::string_view pred) { | 1174 | void EmitVoteAll(EmitContext& ctx, ScalarS32 pred) { |
| 1314 | NotImplemented(); | 1175 | NotImplemented(); |
| 1315 | } | 1176 | } |
| 1316 | 1177 | ||
| 1317 | void EmitVoteAny(EmitContext& ctx, std::string_view pred) { | 1178 | void EmitVoteAny(EmitContext& ctx, ScalarS32 pred) { |
| 1318 | NotImplemented(); | 1179 | NotImplemented(); |
| 1319 | } | 1180 | } |
| 1320 | 1181 | ||
| 1321 | void EmitVoteEqual(EmitContext& ctx, std::string_view pred) { | 1182 | void EmitVoteEqual(EmitContext& ctx, ScalarS32 pred) { |
| 1322 | NotImplemented(); | 1183 | NotImplemented(); |
| 1323 | } | 1184 | } |
| 1324 | 1185 | ||
| 1325 | void EmitSubgroupBallot(EmitContext& ctx, std::string_view pred) { | 1186 | void EmitSubgroupBallot(EmitContext& ctx, ScalarS32 pred) { |
| 1326 | NotImplemented(); | 1187 | NotImplemented(); |
| 1327 | } | 1188 | } |
| 1328 | 1189 | ||
| @@ -1346,47 +1207,43 @@ void EmitSubgroupGeMask(EmitContext& ctx) { | |||
| 1346 | NotImplemented(); | 1207 | NotImplemented(); |
| 1347 | } | 1208 | } |
| 1348 | 1209 | ||
| 1349 | void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 1210 | void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 1350 | std::string_view index, std::string_view clamp, | 1211 | ScalarU32 clamp, ScalarU32 segmentation_mask) { |
| 1351 | std::string_view segmentation_mask) { | ||
| 1352 | NotImplemented(); | 1212 | NotImplemented(); |
| 1353 | } | 1213 | } |
| 1354 | 1214 | ||
| 1355 | void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view index, | 1215 | void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 1356 | std::string_view clamp, std::string_view segmentation_mask) { | 1216 | ScalarU32 clamp, ScalarU32 segmentation_mask) { |
| 1357 | NotImplemented(); | 1217 | NotImplemented(); |
| 1358 | } | 1218 | } |
| 1359 | 1219 | ||
| 1360 | void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 1220 | void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 1361 | std::string_view index, std::string_view clamp, | 1221 | ScalarU32 clamp, ScalarU32 segmentation_mask) { |
| 1362 | std::string_view segmentation_mask) { | ||
| 1363 | NotImplemented(); | 1222 | NotImplemented(); |
| 1364 | } | 1223 | } |
| 1365 | 1224 | ||
| 1366 | void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string_view value, | 1225 | void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, |
| 1367 | std::string_view index, std::string_view clamp, | 1226 | ScalarU32 clamp, ScalarU32 segmentation_mask) { |
| 1368 | std::string_view segmentation_mask) { | ||
| 1369 | NotImplemented(); | 1227 | NotImplemented(); |
| 1370 | } | 1228 | } |
| 1371 | 1229 | ||
| 1372 | void EmitFSwizzleAdd(EmitContext& ctx, std::string_view op_a, std::string_view op_b, | 1230 | void EmitFSwizzleAdd(EmitContext& ctx, ScalarF32 op_a, ScalarF32 op_b, ScalarU32 swizzle) { |
| 1373 | std::string_view swizzle) { | ||
| 1374 | NotImplemented(); | 1231 | NotImplemented(); |
| 1375 | } | 1232 | } |
| 1376 | 1233 | ||
| 1377 | void EmitDPdxFine(EmitContext& ctx, std::string_view op_a) { | 1234 | void EmitDPdxFine(EmitContext& ctx, ScalarF32 op_a) { |
| 1378 | NotImplemented(); | 1235 | NotImplemented(); |
| 1379 | } | 1236 | } |
| 1380 | 1237 | ||
| 1381 | void EmitDPdyFine(EmitContext& ctx, std::string_view op_a) { | 1238 | void EmitDPdyFine(EmitContext& ctx, ScalarF32 op_a) { |
| 1382 | NotImplemented(); | 1239 | NotImplemented(); |
| 1383 | } | 1240 | } |
| 1384 | 1241 | ||
| 1385 | void EmitDPdxCoarse(EmitContext& ctx, std::string_view op_a) { | 1242 | void EmitDPdxCoarse(EmitContext& ctx, ScalarF32 op_a) { |
| 1386 | NotImplemented(); | 1243 | NotImplemented(); |
| 1387 | } | 1244 | } |
| 1388 | 1245 | ||
| 1389 | void EmitDPdyCoarse(EmitContext& ctx, std::string_view op_a) { | 1246 | void EmitDPdyCoarse(EmitContext& ctx, ScalarF32 op_a) { |
| 1390 | NotImplemented(); | 1247 | NotImplemented(); |
| 1391 | } | 1248 | } |
| 1392 | 1249 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp index 16f6c33f3..e69de29bb 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <string_view> | ||
| 6 | |||
| 7 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 9 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 10 | |||
| 11 | namespace Shader::Backend::GLASM { | ||
| 12 | |||
| 13 | void EmitSelectU1(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 14 | throw NotImplementedException("GLASM instruction"); | ||
| 15 | } | ||
| 16 | |||
| 17 | void EmitSelectU8(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 18 | throw NotImplementedException("GLASM instruction"); | ||
| 19 | } | ||
| 20 | |||
| 21 | void EmitSelectU16(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 22 | throw NotImplementedException("GLASM instruction"); | ||
| 23 | } | ||
| 24 | |||
| 25 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | ||
| 26 | std::string_view true_value, std::string_view false_value) { | ||
| 27 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 28 | } | ||
| 29 | |||
| 30 | void EmitSelectU64(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 31 | throw NotImplementedException("GLASM instruction"); | ||
| 32 | } | ||
| 33 | |||
| 34 | void EmitSelectF16(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 35 | throw NotImplementedException("GLASM instruction"); | ||
| 36 | } | ||
| 37 | |||
| 38 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | ||
| 39 | std::string_view true_value, std::string_view false_value) { | ||
| 40 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 41 | } | ||
| 42 | |||
| 43 | void EmitSelectF64(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 44 | throw NotImplementedException("GLASM instruction"); | ||
| 45 | } | ||
| 46 | } // namespace Shader::Backend::GLASM | ||
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.cpp b/src/shader_recompiler/backend/glasm/reg_alloc.cpp index e198dd522..030b48d83 100644 --- a/src/shader_recompiler/backend/glasm/reg_alloc.cpp +++ b/src/shader_recompiler/backend/glasm/reg_alloc.cpp | |||
| @@ -12,53 +12,61 @@ | |||
| 12 | #include "shader_recompiler/frontend/ir/value.h" | 12 | #include "shader_recompiler/frontend/ir/value.h" |
| 13 | 13 | ||
| 14 | namespace Shader::Backend::GLASM { | 14 | namespace Shader::Backend::GLASM { |
| 15 | namespace { | 15 | |
| 16 | std::string Representation(Id id) { | 16 | Register RegAlloc::Define(IR::Inst& inst) { |
| 17 | if (id.is_condition_code != 0) { | 17 | const Id id{Alloc()}; |
| 18 | throw NotImplementedException("Condition code"); | 18 | inst.SetDefinition<Id>(id); |
| 19 | } | 19 | Register ret; |
| 20 | if (id.is_spill != 0) { | 20 | ret.type = Type::Register; |
| 21 | throw NotImplementedException("Spilling"); | 21 | ret.id = id; |
| 22 | } | 22 | return ret; |
| 23 | const u32 index{static_cast<u32>(id.index)}; | ||
| 24 | return fmt::format("R{}.x", index); | ||
| 25 | } | 23 | } |
| 26 | 24 | ||
| 27 | std::string ImmValue(const IR::Value& value) { | 25 | Value RegAlloc::Consume(const IR::Value& value) { |
| 26 | if (!value.IsImmediate()) { | ||
| 27 | return Consume(*value.InstRecursive()); | ||
| 28 | } | ||
| 29 | Value ret; | ||
| 28 | switch (value.Type()) { | 30 | switch (value.Type()) { |
| 29 | case IR::Type::U1: | 31 | case IR::Type::U1: |
| 30 | return value.U1() ? "-1" : "0"; | 32 | ret.type = Type::U32; |
| 33 | ret.imm_u32 = value.U1() ? 0xffffffff : 0; | ||
| 34 | break; | ||
| 31 | case IR::Type::U32: | 35 | case IR::Type::U32: |
| 32 | return fmt::format("{}", value.U32()); | 36 | ret.type = Type::U32; |
| 37 | ret.imm_u32 = value.U32(); | ||
| 38 | break; | ||
| 33 | case IR::Type::F32: | 39 | case IR::Type::F32: |
| 34 | return fmt::format("{}", value.F32()); | 40 | ret.type = Type::F32; |
| 41 | ret.imm_f32 = value.F32(); | ||
| 42 | break; | ||
| 35 | default: | 43 | default: |
| 36 | throw NotImplementedException("Immediate type {}", value.Type()); | 44 | throw NotImplementedException("Immediate type {}", value.Type()); |
| 37 | } | 45 | } |
| 46 | return ret; | ||
| 38 | } | 47 | } |
| 39 | } // Anonymous namespace | ||
| 40 | 48 | ||
| 41 | std::string RegAlloc::Define(IR::Inst& inst) { | 49 | Register RegAlloc::AllocReg() { |
| 42 | const Id id{Alloc()}; | 50 | Register ret; |
| 43 | inst.SetDefinition<Id>(id); | 51 | ret.type = Type::Register; |
| 44 | return Representation(id); | 52 | ret.id = Alloc(); |
| 53 | return ret; | ||
| 45 | } | 54 | } |
| 46 | 55 | ||
| 47 | std::string RegAlloc::Consume(const IR::Value& value) { | 56 | void RegAlloc::FreeReg(Register reg) { |
| 48 | if (value.IsImmediate()) { | 57 | Free(reg.id); |
| 49 | return ImmValue(value); | ||
| 50 | } else { | ||
| 51 | return Consume(*value.InstRecursive()); | ||
| 52 | } | ||
| 53 | } | 58 | } |
| 54 | 59 | ||
| 55 | std::string RegAlloc::Consume(IR::Inst& inst) { | 60 | Value RegAlloc::Consume(IR::Inst& inst) { |
| 56 | const Id id{inst.Definition<Id>()}; | 61 | const Id id{inst.Definition<Id>()}; |
| 57 | inst.DestructiveRemoveUsage(); | 62 | inst.DestructiveRemoveUsage(); |
| 58 | if (!inst.HasUses()) { | 63 | if (!inst.HasUses()) { |
| 59 | Free(id); | 64 | Free(id); |
| 60 | } | 65 | } |
| 61 | return Representation(inst.Definition<Id>()); | 66 | Value ret; |
| 67 | ret.type = Type::Register; | ||
| 68 | ret.id = id; | ||
| 69 | return ret; | ||
| 62 | } | 70 | } |
| 63 | 71 | ||
| 64 | Id RegAlloc::Alloc() { | 72 | Id RegAlloc::Alloc() { |
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.h b/src/shader_recompiler/backend/glasm/reg_alloc.h index f73aa3348..ef0b6697f 100644 --- a/src/shader_recompiler/backend/glasm/reg_alloc.h +++ b/src/shader_recompiler/backend/glasm/reg_alloc.h | |||
| @@ -6,8 +6,12 @@ | |||
| 6 | 6 | ||
| 7 | #include <bitset> | 7 | #include <bitset> |
| 8 | 8 | ||
| 9 | #include <fmt/format.h> | ||
| 10 | |||
| 11 | #include "common/bit_cast.h" | ||
| 9 | #include "common/bit_field.h" | 12 | #include "common/bit_field.h" |
| 10 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | #include "shader_recompiler/exception.h" | ||
| 11 | 15 | ||
| 12 | namespace Shader::IR { | 16 | namespace Shader::IR { |
| 13 | class Inst; | 17 | class Inst; |
| @@ -18,6 +22,13 @@ namespace Shader::Backend::GLASM { | |||
| 18 | 22 | ||
| 19 | class EmitContext; | 23 | class EmitContext; |
| 20 | 24 | ||
| 25 | enum class Type : u32 { | ||
| 26 | Register, | ||
| 27 | U32, | ||
| 28 | S32, | ||
| 29 | F32, | ||
| 30 | }; | ||
| 31 | |||
| 21 | struct Id { | 32 | struct Id { |
| 22 | union { | 33 | union { |
| 23 | u32 raw; | 34 | u32 raw; |
| @@ -25,15 +36,62 @@ struct Id { | |||
| 25 | BitField<30, 1, u32> is_spill; | 36 | BitField<30, 1, u32> is_spill; |
| 26 | BitField<31, 1, u32> is_condition_code; | 37 | BitField<31, 1, u32> is_condition_code; |
| 27 | }; | 38 | }; |
| 39 | |||
| 40 | bool operator==(Id rhs) const noexcept { | ||
| 41 | return raw == rhs.raw; | ||
| 42 | } | ||
| 43 | bool operator!=(Id rhs) const noexcept { | ||
| 44 | return !operator==(rhs); | ||
| 45 | } | ||
| 28 | }; | 46 | }; |
| 47 | static_assert(sizeof(Id) == sizeof(u32)); | ||
| 48 | |||
| 49 | struct Value { | ||
| 50 | Type type; | ||
| 51 | union { | ||
| 52 | Id id; | ||
| 53 | u32 imm_u32; | ||
| 54 | s32 imm_s32; | ||
| 55 | f32 imm_f32; | ||
| 56 | }; | ||
| 57 | |||
| 58 | bool operator==(const Value& rhs) const noexcept { | ||
| 59 | if (type != rhs.type) { | ||
| 60 | return false; | ||
| 61 | } | ||
| 62 | switch (type) { | ||
| 63 | case Type::Register: | ||
| 64 | return id == rhs.id; | ||
| 65 | case Type::U32: | ||
| 66 | return imm_u32 == rhs.imm_u32; | ||
| 67 | case Type::S32: | ||
| 68 | return imm_s32 == rhs.imm_s32; | ||
| 69 | case Type::F32: | ||
| 70 | return Common::BitCast<u32>(imm_f32) == Common::BitCast<u32>(rhs.imm_f32); | ||
| 71 | } | ||
| 72 | return false; | ||
| 73 | } | ||
| 74 | bool operator!=(const Value& rhs) const noexcept { | ||
| 75 | return !operator==(rhs); | ||
| 76 | } | ||
| 77 | }; | ||
| 78 | struct Register : Value {}; | ||
| 79 | struct ScalarRegister : Value {}; | ||
| 80 | struct ScalarU32 : Value {}; | ||
| 81 | struct ScalarS32 : Value {}; | ||
| 82 | struct ScalarF32 : Value {}; | ||
| 29 | 83 | ||
| 30 | class RegAlloc { | 84 | class RegAlloc { |
| 31 | public: | 85 | public: |
| 32 | RegAlloc(EmitContext& ctx_) : ctx{ctx_} {} | 86 | RegAlloc(EmitContext& ctx_) : ctx{ctx_} {} |
| 33 | 87 | ||
| 34 | std::string Define(IR::Inst& inst); | 88 | Register Define(IR::Inst& inst); |
| 89 | |||
| 90 | Value Consume(const IR::Value& value); | ||
| 91 | |||
| 92 | Register AllocReg(); | ||
| 35 | 93 | ||
| 36 | std::string Consume(const IR::Value& value); | 94 | void FreeReg(Register reg); |
| 37 | 95 | ||
| 38 | [[nodiscard]] size_t NumUsedRegisters() const noexcept { | 96 | [[nodiscard]] size_t NumUsedRegisters() const noexcept { |
| 39 | return num_used_registers; | 97 | return num_used_registers; |
| @@ -43,16 +101,132 @@ private: | |||
| 43 | static constexpr size_t NUM_REGS = 4096; | 101 | static constexpr size_t NUM_REGS = 4096; |
| 44 | static constexpr size_t NUM_ELEMENTS = 4; | 102 | static constexpr size_t NUM_ELEMENTS = 4; |
| 45 | 103 | ||
| 46 | EmitContext& ctx; | 104 | Value Consume(IR::Inst& inst); |
| 47 | |||
| 48 | std::string Consume(IR::Inst& inst); | ||
| 49 | 105 | ||
| 50 | Id Alloc(); | 106 | Id Alloc(); |
| 51 | 107 | ||
| 52 | void Free(Id id); | 108 | void Free(Id id); |
| 53 | 109 | ||
| 110 | EmitContext& ctx; | ||
| 54 | size_t num_used_registers{}; | 111 | size_t num_used_registers{}; |
| 55 | std::bitset<NUM_REGS> register_use{}; | 112 | std::bitset<NUM_REGS> register_use{}; |
| 56 | }; | 113 | }; |
| 57 | 114 | ||
| 115 | template <bool scalar, typename FormatContext> | ||
| 116 | auto FormatTo(FormatContext& ctx, Id id) { | ||
| 117 | if (id.is_condition_code != 0) { | ||
| 118 | throw NotImplementedException("Condition code emission"); | ||
| 119 | } | ||
| 120 | if (id.is_spill != 0) { | ||
| 121 | throw NotImplementedException("Spill emission"); | ||
| 122 | } | ||
| 123 | if constexpr (scalar) { | ||
| 124 | return fmt::format_to(ctx.out(), "R{}.x", id.index.Value()); | ||
| 125 | } else { | ||
| 126 | return fmt::format_to(ctx.out(), "R{}", id.index.Value()); | ||
| 127 | } | ||
| 128 | } | ||
| 129 | |||
| 58 | } // namespace Shader::Backend::GLASM | 130 | } // namespace Shader::Backend::GLASM |
| 131 | |||
| 132 | template <> | ||
| 133 | struct fmt::formatter<Shader::Backend::GLASM::Id> { | ||
| 134 | constexpr auto parse(format_parse_context& ctx) { | ||
| 135 | return ctx.begin(); | ||
| 136 | } | ||
| 137 | template <typename FormatContext> | ||
| 138 | auto format(Shader::Backend::GLASM::Id id, FormatContext& ctx) { | ||
| 139 | return FormatTo<true>(ctx, id); | ||
| 140 | } | ||
| 141 | }; | ||
| 142 | |||
| 143 | template <> | ||
| 144 | struct fmt::formatter<Shader::Backend::GLASM::Register> { | ||
| 145 | constexpr auto parse(format_parse_context& ctx) { | ||
| 146 | return ctx.begin(); | ||
| 147 | } | ||
| 148 | template <typename FormatContext> | ||
| 149 | auto format(const Shader::Backend::GLASM::Register& value, FormatContext& ctx) { | ||
| 150 | if (value.type != Shader::Backend::GLASM::Type::Register) { | ||
| 151 | throw Shader::InvalidArgument("Register value type is not register"); | ||
| 152 | } | ||
| 153 | return FormatTo<false>(ctx, value.id); | ||
| 154 | } | ||
| 155 | }; | ||
| 156 | |||
| 157 | template <> | ||
| 158 | struct fmt::formatter<Shader::Backend::GLASM::ScalarRegister> { | ||
| 159 | constexpr auto parse(format_parse_context& ctx) { | ||
| 160 | return ctx.begin(); | ||
| 161 | } | ||
| 162 | template <typename FormatContext> | ||
| 163 | auto format(const Shader::Backend::GLASM::ScalarRegister& value, FormatContext& ctx) { | ||
| 164 | if (value.type != Shader::Backend::GLASM::Type::Register) { | ||
| 165 | throw Shader::InvalidArgument("Register value type is not register"); | ||
| 166 | } | ||
| 167 | return FormatTo<true>(ctx, value.id); | ||
| 168 | } | ||
| 169 | }; | ||
| 170 | |||
| 171 | template <> | ||
| 172 | struct fmt::formatter<Shader::Backend::GLASM::ScalarU32> { | ||
| 173 | constexpr auto parse(format_parse_context& ctx) { | ||
| 174 | return ctx.begin(); | ||
| 175 | } | ||
| 176 | template <typename FormatContext> | ||
| 177 | auto format(const Shader::Backend::GLASM::ScalarU32& value, FormatContext& ctx) { | ||
| 178 | switch (value.type) { | ||
| 179 | case Shader::Backend::GLASM::Type::Register: | ||
| 180 | return FormatTo<true>(ctx, value.id); | ||
| 181 | case Shader::Backend::GLASM::Type::U32: | ||
| 182 | return fmt::format_to(ctx.out(), "{}", value.imm_u32); | ||
| 183 | case Shader::Backend::GLASM::Type::S32: | ||
| 184 | return fmt::format_to(ctx.out(), "{}", static_cast<u32>(value.imm_s32)); | ||
| 185 | case Shader::Backend::GLASM::Type::F32: | ||
| 186 | return fmt::format_to(ctx.out(), "{}", Common::BitCast<u32>(value.imm_f32)); | ||
| 187 | } | ||
| 188 | throw Shader::InvalidArgument("Invalid value type {}", value.type); | ||
| 189 | } | ||
| 190 | }; | ||
| 191 | |||
| 192 | template <> | ||
| 193 | struct fmt::formatter<Shader::Backend::GLASM::ScalarS32> { | ||
| 194 | constexpr auto parse(format_parse_context& ctx) { | ||
| 195 | return ctx.begin(); | ||
| 196 | } | ||
| 197 | template <typename FormatContext> | ||
| 198 | auto format(const Shader::Backend::GLASM::ScalarS32& value, FormatContext& ctx) { | ||
| 199 | switch (value.type) { | ||
| 200 | case Shader::Backend::GLASM::Type::Register: | ||
| 201 | return FormatTo<true>(ctx, value.id); | ||
| 202 | case Shader::Backend::GLASM::Type::U32: | ||
| 203 | return fmt::format_to(ctx.out(), "{}", static_cast<s32>(value.imm_u32)); | ||
| 204 | case Shader::Backend::GLASM::Type::S32: | ||
| 205 | return fmt::format_to(ctx.out(), "{}", value.imm_s32); | ||
| 206 | case Shader::Backend::GLASM::Type::F32: | ||
| 207 | return fmt::format_to(ctx.out(), "{}", Common::BitCast<s32>(value.imm_f32)); | ||
| 208 | } | ||
| 209 | throw Shader::InvalidArgument("Invalid value type {}", value.type); | ||
| 210 | } | ||
| 211 | }; | ||
| 212 | |||
| 213 | template <> | ||
| 214 | struct fmt::formatter<Shader::Backend::GLASM::ScalarF32> { | ||
| 215 | constexpr auto parse(format_parse_context& ctx) { | ||
| 216 | return ctx.begin(); | ||
| 217 | } | ||
| 218 | template <typename FormatContext> | ||
| 219 | auto format(const Shader::Backend::GLASM::ScalarF32& value, FormatContext& ctx) { | ||
| 220 | switch (value.type) { | ||
| 221 | case Shader::Backend::GLASM::Type::Register: | ||
| 222 | return FormatTo<true>(ctx, value.id); | ||
| 223 | case Shader::Backend::GLASM::Type::U32: | ||
| 224 | return fmt::format_to(ctx.out(), "{}", Common::BitCast<u32>(value.imm_u32)); | ||
| 225 | case Shader::Backend::GLASM::Type::S32: | ||
| 226 | return fmt::format_to(ctx.out(), "{}", Common::BitCast<s32>(value.imm_s32)); | ||
| 227 | case Shader::Backend::GLASM::Type::F32: | ||
| 228 | return fmt::format_to(ctx.out(), "{}", value.imm_f32); | ||
| 229 | } | ||
| 230 | throw Shader::InvalidArgument("Invalid value type {}", value.type); | ||
| 231 | } | ||
| 232 | }; | ||