560ed8ab4c9bd7a87f276e04598222208e994ae3
[kazan.git] / src / spirv_to_llvm / spirv_to_llvm.cpp
1 /*
2 * Copyright 2017 Jacob Lifshay
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in all
12 * copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 *
22 */
23 #include "spirv_to_llvm.h"
24 #include "util/optional.h"
25 #include "util/variant.h"
26 #include "util/enum.h"
27 #include <functional>
28 #include <list>
29 #include <iostream>
30
31 namespace vulkan_cpu
32 {
33 namespace spirv_to_llvm
34 {
35 using namespace spirv;
36
37 namespace
38 {
39 constexpr bool is_power_of_2(std::uint64_t v) noexcept
40 {
41 return (v & (v - 1)) == 0 && v != 0;
42 }
43
44 constexpr std::size_t get_padding_size(std::size_t current_position,
45 std::size_t needed_alignment) noexcept
46 {
47 assert(is_power_of_2(needed_alignment));
48 return -current_position & (needed_alignment - 1);
49 }
50 }
51
52 void Struct_type_descriptor::complete_type()
53 {
54 for(auto &decoration : decorations)
55 {
56 switch(decoration.value)
57 {
58 case Decoration::relaxed_precision:
59 #warning finish implementing Decoration::relaxed_precision
60 break;
61 case Decoration::spec_id:
62 #warning finish implementing Decoration::spec_id
63 break;
64 case Decoration::block:
65 #warning finish implementing Decoration::block
66 continue;
67 case Decoration::buffer_block:
68 #warning finish implementing Decoration::buffer_block
69 break;
70 case Decoration::row_major:
71 #warning finish implementing Decoration::row_major
72 break;
73 case Decoration::col_major:
74 #warning finish implementing Decoration::col_major
75 break;
76 case Decoration::array_stride:
77 #warning finish implementing Decoration::array_stride
78 break;
79 case Decoration::matrix_stride:
80 #warning finish implementing Decoration::matrix_stride
81 break;
82 case Decoration::glsl_shared:
83 #warning finish implementing Decoration::glsl_shared
84 break;
85 case Decoration::glsl_packed:
86 #warning finish implementing Decoration::glsl_packed
87 break;
88 case Decoration::c_packed:
89 #warning finish implementing Decoration::c_packed
90 break;
91 case Decoration::built_in:
92 #warning finish implementing Decoration::built_in
93 break;
94 case Decoration::no_perspective:
95 #warning finish implementing Decoration::no_perspective
96 break;
97 case Decoration::flat:
98 #warning finish implementing Decoration::flat
99 break;
100 case Decoration::patch:
101 #warning finish implementing Decoration::patch
102 break;
103 case Decoration::centroid:
104 #warning finish implementing Decoration::centroid
105 break;
106 case Decoration::sample:
107 #warning finish implementing Decoration::sample
108 break;
109 case Decoration::invariant:
110 #warning finish implementing Decoration::invariant
111 break;
112 case Decoration::restrict:
113 #warning finish implementing Decoration::restrict
114 break;
115 case Decoration::aliased:
116 #warning finish implementing Decoration::aliased
117 break;
118 case Decoration::volatile_:
119 #warning finish implementing Decoration::volatile_
120 break;
121 case Decoration::constant:
122 #warning finish implementing Decoration::constant
123 break;
124 case Decoration::coherent:
125 #warning finish implementing Decoration::coherent
126 break;
127 case Decoration::non_writable:
128 #warning finish implementing Decoration::non_writable
129 break;
130 case Decoration::non_readable:
131 #warning finish implementing Decoration::non_readable
132 break;
133 case Decoration::uniform:
134 #warning finish implementing Decoration::uniform
135 break;
136 case Decoration::saturated_conversion:
137 #warning finish implementing Decoration::saturated_conversion
138 break;
139 case Decoration::stream:
140 #warning finish implementing Decoration::stream
141 break;
142 case Decoration::location:
143 #warning finish implementing Decoration::location
144 break;
145 case Decoration::component:
146 #warning finish implementing Decoration::component
147 break;
148 case Decoration::index:
149 #warning finish implementing Decoration::index
150 break;
151 case Decoration::binding:
152 #warning finish implementing Decoration::binding
153 break;
154 case Decoration::descriptor_set:
155 #warning finish implementing Decoration::descriptor_set
156 break;
157 case Decoration::offset:
158 #warning finish implementing Decoration::offset
159 break;
160 case Decoration::xfb_buffer:
161 #warning finish implementing Decoration::xfb_buffer
162 break;
163 case Decoration::xfb_stride:
164 #warning finish implementing Decoration::xfb_stride
165 break;
166 case Decoration::func_param_attr:
167 #warning finish implementing Decoration::func_param_attr
168 break;
169 case Decoration::fp_rounding_mode:
170 #warning finish implementing Decoration::fp_rounding_mode
171 break;
172 case Decoration::fp_fast_math_mode:
173 #warning finish implementing Decoration::fp_fast_math_mode
174 break;
175 case Decoration::linkage_attributes:
176 #warning finish implementing Decoration::linkage_attributes
177 break;
178 case Decoration::no_contraction:
179 #warning finish implementing Decoration::no_contraction
180 break;
181 case Decoration::input_attachment_index:
182 #warning finish implementing Decoration::input_attachment_index
183 break;
184 case Decoration::alignment:
185 #warning finish implementing Decoration::alignment
186 break;
187 case Decoration::max_byte_offset:
188 #warning finish implementing Decoration::max_byte_offset
189 break;
190 case Decoration::alignment_id:
191 #warning finish implementing Decoration::alignment_id
192 break;
193 case Decoration::max_byte_offset_id:
194 #warning finish implementing Decoration::max_byte_offset_id
195 break;
196 case Decoration::override_coverage_nv:
197 #warning finish implementing Decoration::override_coverage_nv
198 break;
199 case Decoration::passthrough_nv:
200 #warning finish implementing Decoration::passthrough_nv
201 break;
202 case Decoration::viewport_relative_nv:
203 #warning finish implementing Decoration::viewport_relative_nv
204 break;
205 case Decoration::secondary_viewport_relative_nv:
206 #warning finish implementing Decoration::secondary_viewport_relative_nv
207 break;
208 }
209 throw Parser_error(instruction_start_index,
210 instruction_start_index,
211 "unimplemented decoration on OpTypeStruct: "
212 + std::string(get_enumerant_name(decoration.value)));
213 }
214 struct Member_descriptor
215 {
216 std::size_t alignment;
217 std::size_t size;
218 ::LLVMTypeRef type;
219 explicit Member_descriptor(std::size_t alignment,
220 std::size_t size,
221 ::LLVMTypeRef type) noexcept : alignment(alignment),
222 size(size),
223 type(type)
224 {
225 }
226 };
227 std::vector<Member_descriptor> member_descriptors;
228 member_descriptors.reserve(members.size());
229 std::size_t total_alignment = 1;
230 for(auto &member : members)
231 {
232 for(auto &decoration : member.decorations)
233 {
234 switch(decoration.value)
235 {
236 case Decoration::relaxed_precision:
237 #warning finish implementing Decoration::relaxed_precision
238 break;
239 case Decoration::spec_id:
240 #warning finish implementing Decoration::spec_id
241 break;
242 case Decoration::block:
243 #warning finish implementing Decoration::block
244 break;
245 case Decoration::buffer_block:
246 #warning finish implementing Decoration::buffer_block
247 break;
248 case Decoration::row_major:
249 #warning finish implementing Decoration::row_major
250 break;
251 case Decoration::col_major:
252 #warning finish implementing Decoration::col_major
253 break;
254 case Decoration::array_stride:
255 #warning finish implementing Decoration::array_stride
256 break;
257 case Decoration::matrix_stride:
258 #warning finish implementing Decoration::matrix_stride
259 break;
260 case Decoration::glsl_shared:
261 #warning finish implementing Decoration::glsl_shared
262 break;
263 case Decoration::glsl_packed:
264 #warning finish implementing Decoration::glsl_packed
265 break;
266 case Decoration::c_packed:
267 #warning finish implementing Decoration::c_packed
268 break;
269 case Decoration::built_in:
270 #warning finish implementing Decoration::built_in
271 continue;
272 case Decoration::no_perspective:
273 #warning finish implementing Decoration::no_perspective
274 break;
275 case Decoration::flat:
276 #warning finish implementing Decoration::flat
277 break;
278 case Decoration::patch:
279 #warning finish implementing Decoration::patch
280 break;
281 case Decoration::centroid:
282 #warning finish implementing Decoration::centroid
283 break;
284 case Decoration::sample:
285 #warning finish implementing Decoration::sample
286 break;
287 case Decoration::invariant:
288 #warning finish implementing Decoration::invariant
289 break;
290 case Decoration::restrict:
291 #warning finish implementing Decoration::restrict
292 break;
293 case Decoration::aliased:
294 #warning finish implementing Decoration::aliased
295 break;
296 case Decoration::volatile_:
297 #warning finish implementing Decoration::volatile_
298 break;
299 case Decoration::constant:
300 #warning finish implementing Decoration::constant
301 break;
302 case Decoration::coherent:
303 #warning finish implementing Decoration::coherent
304 break;
305 case Decoration::non_writable:
306 #warning finish implementing Decoration::non_writable
307 break;
308 case Decoration::non_readable:
309 #warning finish implementing Decoration::non_readable
310 break;
311 case Decoration::uniform:
312 #warning finish implementing Decoration::uniform
313 break;
314 case Decoration::saturated_conversion:
315 #warning finish implementing Decoration::saturated_conversion
316 break;
317 case Decoration::stream:
318 #warning finish implementing Decoration::stream
319 break;
320 case Decoration::location:
321 continue;
322 case Decoration::component:
323 #warning finish implementing Decoration::component
324 break;
325 case Decoration::index:
326 #warning finish implementing Decoration::index
327 break;
328 case Decoration::binding:
329 #warning finish implementing Decoration::binding
330 break;
331 case Decoration::descriptor_set:
332 #warning finish implementing Decoration::descriptor_set
333 break;
334 case Decoration::offset:
335 #warning finish implementing Decoration::offset
336 break;
337 case Decoration::xfb_buffer:
338 #warning finish implementing Decoration::xfb_buffer
339 break;
340 case Decoration::xfb_stride:
341 #warning finish implementing Decoration::xfb_stride
342 break;
343 case Decoration::func_param_attr:
344 #warning finish implementing Decoration::func_param_attr
345 break;
346 case Decoration::fp_rounding_mode:
347 #warning finish implementing Decoration::fp_rounding_mode
348 break;
349 case Decoration::fp_fast_math_mode:
350 #warning finish implementing Decoration::fp_fast_math_mode
351 break;
352 case Decoration::linkage_attributes:
353 #warning finish implementing Decoration::linkage_attributes
354 break;
355 case Decoration::no_contraction:
356 #warning finish implementing Decoration::no_contraction
357 break;
358 case Decoration::input_attachment_index:
359 #warning finish implementing Decoration::input_attachment_index
360 break;
361 case Decoration::alignment:
362 #warning finish implementing Decoration::alignment
363 break;
364 case Decoration::max_byte_offset:
365 #warning finish implementing Decoration::max_byte_offset
366 break;
367 case Decoration::alignment_id:
368 #warning finish implementing Decoration::alignment_id
369 break;
370 case Decoration::max_byte_offset_id:
371 #warning finish implementing Decoration::max_byte_offset_id
372 break;
373 case Decoration::override_coverage_nv:
374 #warning finish implementing Decoration::override_coverage_nv
375 break;
376 case Decoration::passthrough_nv:
377 #warning finish implementing Decoration::passthrough_nv
378 break;
379 case Decoration::viewport_relative_nv:
380 #warning finish implementing Decoration::viewport_relative_nv
381 break;
382 case Decoration::secondary_viewport_relative_nv:
383 #warning finish implementing Decoration::secondary_viewport_relative_nv
384 break;
385 }
386 throw Parser_error(instruction_start_index,
387 instruction_start_index,
388 "unimplemented member decoration on OpTypeStruct: "
389 + std::string(get_enumerant_name(decoration.value)));
390 }
391 auto member_type = member.type->get_or_make_type();
392 if(::LLVMGetTypeKind(member_type.type) == ::LLVMStructTypeKind
393 && ::LLVMIsOpaqueStruct(member_type.type))
394 {
395 if(dynamic_cast<const Struct_type_descriptor *>(member.type.get()))
396 throw Parser_error(instruction_start_index,
397 instruction_start_index,
398 "recursive struct has infinite size");
399 throw Parser_error(instruction_start_index,
400 instruction_start_index,
401 "struct can't have opaque struct members");
402 }
403 assert(is_power_of_2(member_type.alignment));
404 std::size_t size = ::LLVMABISizeOfType(target_data, member_type.type);
405 if(member_type.alignment > total_alignment)
406 total_alignment = member_type.alignment;
407 member_descriptors.push_back(
408 Member_descriptor(member_type.alignment, size, member_type.type));
409 }
410 assert(member_descriptors.size() == members.size());
411 assert(is_power_of_2(total_alignment));
412 std::size_t current_offset = 0;
413 std::vector<::LLVMTypeRef> member_types;
414 member_types.reserve(members.size() * 2);
415 if(!members.empty())
416 {
417 for(std::size_t member_index = 0; member_index < members.size(); member_index++)
418 {
419 members[member_index].llvm_member_index = member_types.size();
420 #warning finish Struct_type_descriptor::complete_type
421 member_types.push_back(member_descriptors[member_index].type);
422 current_offset += member_descriptors[member_index].size;
423 std::size_t next_alignment = member_index + 1 < members.size() ?
424 member_descriptors[member_index + 1].alignment :
425 total_alignment;
426 auto padding_size = get_padding_size(current_offset, next_alignment);
427 if(padding_size != 0)
428 {
429 member_types.push_back(
430 ::LLVMArrayType(::LLVMInt8TypeInContext(context), padding_size));
431 current_offset += padding_size;
432 }
433 }
434 }
435 else
436 {
437 member_types.push_back(::LLVMInt8TypeInContext(context)); // so it isn't empty
438 }
439 constexpr bool is_packed = true;
440 ::LLVMStructSetBody(type.type, member_types.data(), member_types.size(), is_packed);
441 type.alignment = total_alignment;
442 is_complete = true;
443 }
444
445 namespace
446 {
447 enum class Stage
448 {
449 calculate_types,
450 generate_code,
451 };
452
453 vulkan_cpu_util_generate_enum_traits(Stage, Stage::calculate_types, Stage::generate_code);
454
455 static_assert(util::Enum_traits<Stage>::is_compact, "");
456 }
457
458 class Spirv_to_llvm : public Parser_callbacks
459 {
460 Spirv_to_llvm(const Spirv_to_llvm &) = delete;
461 Spirv_to_llvm &operator=(const Spirv_to_llvm &) = delete;
462
463 private:
464 struct Op_string_state
465 {
466 Literal_string value;
467 };
468 struct Op_ext_inst_import_state
469 {
470 };
471 struct Op_entry_point_state
472 {
473 Op_entry_point entry_point;
474 std::size_t instruction_start_index;
475 util::optional<Execution_mode_with_parameters> execution_mode;
476 };
477 struct Name
478 {
479 std::string name;
480 };
481 struct Input_variable_state
482 {
483 std::shared_ptr<Type_descriptor> type;
484 std::size_t member_index;
485 };
486 struct Output_variable_state
487 {
488 std::shared_ptr<Type_descriptor> type;
489 std::size_t member_index;
490 };
491 typedef util::variant<util::monostate, Input_variable_state, Output_variable_state>
492 Variable_state;
493 struct Function_state
494 {
495 struct Entry_block
496 {
497 ::LLVMBasicBlockRef entry_block;
498 ::LLVMValueRef io_struct;
499 ::LLVMValueRef inputs_struct;
500 ::LLVMValueRef outputs_struct;
501 explicit Entry_block(::LLVMBasicBlockRef entry_block,
502 ::LLVMValueRef io_struct,
503 ::LLVMValueRef inputs_struct,
504 ::LLVMValueRef outputs_struct) noexcept
505 : entry_block(entry_block),
506 io_struct(io_struct),
507 inputs_struct(inputs_struct),
508 outputs_struct(outputs_struct)
509 {
510 }
511 };
512 std::shared_ptr<Function_type_descriptor> type;
513 ::LLVMValueRef function;
514 util::optional<Entry_block> entry_block;
515 std::string output_function_name;
516 explicit Function_state(std::shared_ptr<Function_type_descriptor> type,
517 ::LLVMValueRef function,
518 std::string output_function_name) noexcept
519 : type(std::move(type)),
520 function(function),
521 entry_block(),
522 output_function_name(std::move(output_function_name))
523 {
524 }
525 };
526 struct Label_state
527 {
528 ::LLVMBasicBlockRef basic_block;
529 explicit Label_state(::LLVMBasicBlockRef basic_block) noexcept : basic_block(basic_block)
530 {
531 }
532 };
533 struct Value
534 {
535 ::LLVMValueRef value;
536 std::shared_ptr<Type_descriptor> type;
537 explicit Value(::LLVMValueRef value, std::shared_ptr<Type_descriptor> type) noexcept
538 : value(value),
539 type(std::move(type))
540 {
541 }
542 };
543 struct Id_state
544 {
545 util::optional<Op_string_state> op_string;
546 util::optional<Op_ext_inst_import_state> op_ext_inst_import;
547 util::optional<Name> name;
548 std::shared_ptr<Type_descriptor> type;
549 std::vector<Op_entry_point_state> op_entry_points;
550 std::vector<Decoration_with_parameters> decorations;
551 std::vector<Op_member_decorate> member_decorations;
552 std::vector<Op_member_name> member_names;
553 Variable_state variable;
554 std::shared_ptr<Constant_descriptor> constant;
555 util::optional<Function_state> function;
556 util::optional<Label_state> label;
557 util::optional<Value> value;
558
559 private:
560 template <typename Fn>
561 struct Variant_visit_helper
562 {
563 Fn &fn;
564 void operator()(util::monostate &) noexcept
565 {
566 }
567 template <typename T>
568 void operator()(T &&v)
569 {
570 fn(std::forward<T>(v));
571 }
572 };
573
574 public:
575 template <typename Fn>
576 void visit(Fn fn)
577 {
578 if(op_string)
579 fn(*op_string);
580 if(op_ext_inst_import)
581 fn(*op_ext_inst_import);
582 if(name)
583 fn(*name);
584 if(type)
585 fn(type);
586 for(auto &i : op_entry_points)
587 fn(i);
588 for(auto &i : decorations)
589 fn(i);
590 for(auto &i : member_decorations)
591 fn(i);
592 for(auto &i : member_names)
593 fn(i);
594 util::visit(Variant_visit_helper<Fn>{fn}, variable);
595 if(constant)
596 fn(constant);
597 }
598 Id_state() noexcept
599 {
600 }
601 };
602 struct Last_merge_instruction
603 {
604 typedef util::variant<Op_selection_merge, Op_loop_merge> Instruction_variant;
605 Instruction_variant instruction;
606 std::size_t instruction_start_index;
607 explicit Last_merge_instruction(Instruction_variant instruction,
608 std::size_t instruction_start_index)
609 : instruction(std::move(instruction)), instruction_start_index(instruction_start_index)
610 {
611 }
612 };
613
614 private:
615 std::uint64_t next_name_index = 0;
616 std::vector<Id_state> id_states;
617 unsigned input_version_number_major = 0;
618 unsigned input_version_number_minor = 0;
619 Word input_generator_magic_number = 0;
620 util::Enum_set<Capability> enabled_capabilities;
621 ::LLVMContextRef context;
622 ::LLVMTargetMachineRef target_machine;
623 ::LLVMTargetDataRef target_data;
624 [[gnu::unused]] const std::uint64_t shader_id;
625 std::string name_prefix_string;
626 llvm_wrapper::Module module;
627 std::shared_ptr<Struct_type_descriptor> io_struct;
628 static constexpr std::size_t io_struct_argument_index = 0;
629 std::array<std::shared_ptr<Type_descriptor>, 1> implicit_function_arguments;
630 std::size_t inputs_member;
631 std::shared_ptr<Struct_type_descriptor> inputs_struct;
632 std::size_t outputs_member;
633 std::shared_ptr<Struct_type_descriptor> outputs_struct;
634 Stage stage;
635 Id current_function_id = 0;
636 Id current_basic_block_id = 0;
637 llvm_wrapper::Builder builder;
638 util::optional<Last_merge_instruction> last_merge_instruction;
639 std::list<std::function<void()>> function_entry_block_handlers;
640
641 private:
642 Id_state &get_id_state(Id id)
643 {
644 assert(id != 0 && id <= id_states.size());
645 return id_states[id - 1];
646 }
647 template <typename T = Type_descriptor>
648 std::shared_ptr<T> get_type(Id id, std::size_t instruction_start_index)
649 {
650 auto &state = get_id_state(id);
651 auto retval = std::dynamic_pointer_cast<T>(state.type);
652 if(!state.type)
653 throw Parser_error(
654 instruction_start_index, instruction_start_index, "id is not a type");
655 if(!retval)
656 throw Parser_error(instruction_start_index, instruction_start_index, "type mismatch");
657 return retval;
658 }
659 unsigned long long get_unsigned_integer_constant(Id id, std::size_t instruction_start_index)
660 {
661 auto &constant = get_id_state(id).constant;
662 if(!constant)
663 throw Parser_error(
664 instruction_start_index, instruction_start_index, "id is not a constant integer");
665 if(auto *type = dynamic_cast<Simple_type_descriptor *>(constant->type.get()))
666 {
667 auto llvm_type = type->get_or_make_type();
668 if(::LLVMGetTypeKind(llvm_type.type) != ::LLVMIntegerTypeKind)
669 throw Parser_error(instruction_start_index,
670 instruction_start_index,
671 "id is not a constant integer");
672 }
673 else
674 {
675 throw Parser_error(
676 instruction_start_index, instruction_start_index, "id is not a constant integer");
677 }
678 return ::LLVMConstIntGetZExtValue(constant->get_or_make_value());
679 }
680 long long get_signed_integer_constant(Id id, std::size_t instruction_start_index)
681 {
682 auto &constant = get_id_state(id).constant;
683 if(!constant)
684 throw Parser_error(
685 instruction_start_index, instruction_start_index, "id is not a constant integer");
686 if(auto *type = dynamic_cast<Simple_type_descriptor *>(constant->type.get()))
687 {
688 auto llvm_type = type->get_or_make_type();
689 if(::LLVMGetTypeKind(llvm_type.type) != ::LLVMIntegerTypeKind)
690 throw Parser_error(instruction_start_index,
691 instruction_start_index,
692 "id is not a constant integer");
693 }
694 else
695 {
696 throw Parser_error(
697 instruction_start_index, instruction_start_index, "id is not a constant integer");
698 }
699 return ::LLVMConstIntGetSExtValue(constant->get_or_make_value());
700 }
701 std::string get_name(Id id)
702 {
703 auto &name = get_id_state(id).name;
704 if(!name)
705 return {};
706 return name->name;
707 }
708 ::LLVMBasicBlockRef get_or_make_label(Id id)
709 {
710 auto &state = get_id_state(id);
711 if(!state.label)
712 {
713 auto &function = get_id_state(current_function_id).function.value();
714 state.label = Label_state(::LLVMAppendBasicBlockInContext(
715 context, function.function, get_prefixed_name(get_name(id)).c_str()));
716 }
717 return state.label->basic_block;
718 }
719 std::string get_prefixed_name(std::string name) const
720 {
721 if(!name.empty())
722 {
723 std::size_t first_non_underline = name.find_first_not_of('_');
724 if(first_non_underline != std::string::npos && name[first_non_underline] >= '0'
725 && name[first_non_underline] <= '9')
726 {
727 // ensure name doesn't conflict with names generated by get_or_make_prefixed_name
728 name.insert(0, "_");
729 }
730 return name_prefix_string + std::move(name);
731 }
732 return name;
733 }
734 std::string get_or_make_prefixed_name(std::string name)
735 {
736 if(name.empty())
737 {
738 std::ostringstream ss;
739 ss << name_prefix_string << next_name_index++;
740 return ss.str();
741 }
742 return get_prefixed_name(std::move(name));
743 }
744
745 public:
746 explicit Spirv_to_llvm(::LLVMContextRef context,
747 ::LLVMTargetMachineRef target_machine,
748 std::uint64_t shader_id)
749 : context(context), target_machine(target_machine), shader_id(shader_id), stage()
750 {
751 {
752 std::ostringstream ss;
753 ss << "shader_" << shader_id << "_";
754 name_prefix_string = ss.str();
755 }
756 module = llvm_wrapper::Module::create_with_target_machine(
757 get_prefixed_name("module").c_str(), context, target_machine);
758 target_data = ::LLVMGetModuleDataLayout(module.get());
759 builder = llvm_wrapper::Builder::create(context);
760 constexpr std::size_t no_instruction_index = 0;
761 io_struct =
762 std::make_shared<Struct_type_descriptor>(std::vector<Decoration_with_parameters>{},
763 context,
764 target_data,
765 get_prefixed_name("Io_struct").c_str(),
766 no_instruction_index);
767 assert(implicit_function_arguments.size() == 1);
768 static_assert(io_struct_argument_index == 0, "");
769 implicit_function_arguments[io_struct_argument_index] =
770 std::make_shared<Pointer_type_descriptor>(std::vector<Decoration_with_parameters>{},
771 io_struct,
772 no_instruction_index,
773 target_data);
774 inputs_struct =
775 std::make_shared<Struct_type_descriptor>(std::vector<Decoration_with_parameters>{},
776 context,
777 target_data,
778 get_prefixed_name("Inputs").c_str(),
779 no_instruction_index);
780 inputs_member = io_struct->add_member(Struct_type_descriptor::Member({}, inputs_struct));
781 outputs_struct =
782 std::make_shared<Struct_type_descriptor>(std::vector<Decoration_with_parameters>{},
783 context,
784 target_data,
785 get_prefixed_name("Outputs").c_str(),
786 no_instruction_index);
787 outputs_member = io_struct->add_member(Struct_type_descriptor::Member({}, outputs_struct));
788 }
789 Converted_module run(const Word *shader_words, std::size_t shader_size)
790 {
791 stage = Stage::calculate_types;
792 spirv::parse(*this, shader_words, shader_size);
793 for(auto &id_state : id_states)
794 if(id_state.type)
795 id_state.type->get_or_make_type();
796 for(auto &arg : implicit_function_arguments)
797 arg->get_or_make_type();
798 #warning finish Spirv_to_llvm::run
799 stage = Stage::generate_code;
800 spirv::parse(*this, shader_words, shader_size);
801 std::vector<Converted_module::Entry_point> entry_points;
802 for(auto &id_state : id_states)
803 {
804 for(auto &entry_point : id_state.op_entry_points)
805 {
806 if(!id_state.function)
807 throw Parser_error(entry_point.instruction_start_index,
808 entry_point.instruction_start_index,
809 "No definition for function referenced in OpEntryPoint");
810 entry_points.push_back(
811 Converted_module::Entry_point(std::string(entry_point.entry_point.name),
812 id_state.function->output_function_name));
813 }
814 }
815 Converted_module retval(std::move(module),
816 std::move(entry_points),
817 std::move(io_struct),
818 inputs_member,
819 std::move(inputs_struct),
820 outputs_member,
821 std::move(outputs_struct));
822 return retval;
823 }
824 virtual void handle_header(unsigned version_number_major,
825 unsigned version_number_minor,
826 Word generator_magic_number,
827 Word id_bound,
828 Word instruction_schema) override;
829 virtual void handle_instruction_op_nop(Op_nop instruction,
830 std::size_t instruction_start_index) override;
831 virtual void handle_instruction_op_undef(Op_undef instruction,
832 std::size_t instruction_start_index) override;
833 virtual void handle_instruction_op_source_continued(
834 Op_source_continued instruction, std::size_t instruction_start_index) override;
835 virtual void handle_instruction_op_source(Op_source instruction,
836 std::size_t instruction_start_index) override;
837 virtual void handle_instruction_op_source_extension(
838 Op_source_extension instruction, std::size_t instruction_start_index) override;
839 virtual void handle_instruction_op_name(Op_name instruction,
840 std::size_t instruction_start_index) override;
841 virtual void handle_instruction_op_member_name(Op_member_name instruction,
842 std::size_t instruction_start_index) override;
843 virtual void handle_instruction_op_string(Op_string instruction,
844 std::size_t instruction_start_index) override;
845 virtual void handle_instruction_op_line(Op_line instruction,
846 std::size_t instruction_start_index) override;
847 virtual void handle_instruction_op_extension(Op_extension instruction,
848 std::size_t instruction_start_index) override;
849 virtual void handle_instruction_op_ext_inst_import(
850 Op_ext_inst_import instruction, std::size_t instruction_start_index) override;
851 virtual void handle_instruction_op_ext_inst(Op_ext_inst instruction,
852 std::size_t instruction_start_index) override;
853 virtual void handle_instruction_op_memory_model(Op_memory_model instruction,
854 std::size_t instruction_start_index) override;
855 virtual void handle_instruction_op_entry_point(Op_entry_point instruction,
856 std::size_t instruction_start_index) override;
857 virtual void handle_instruction_op_execution_mode(Op_execution_mode instruction,
858 std::size_t instruction_start_index) override;
859 virtual void handle_instruction_op_capability(Op_capability instruction,
860 std::size_t instruction_start_index) override;
861 virtual void handle_instruction_op_type_void(Op_type_void instruction,
862 std::size_t instruction_start_index) override;
863 virtual void handle_instruction_op_type_bool(Op_type_bool instruction,
864 std::size_t instruction_start_index) override;
865 virtual void handle_instruction_op_type_int(Op_type_int instruction,
866 std::size_t instruction_start_index) override;
867 virtual void handle_instruction_op_type_float(Op_type_float instruction,
868 std::size_t instruction_start_index) override;
869 virtual void handle_instruction_op_type_vector(Op_type_vector instruction,
870 std::size_t instruction_start_index) override;
871 virtual void handle_instruction_op_type_matrix(Op_type_matrix instruction,
872 std::size_t instruction_start_index) override;
873 virtual void handle_instruction_op_type_image(Op_type_image instruction,
874 std::size_t instruction_start_index) override;
875 virtual void handle_instruction_op_type_sampler(Op_type_sampler instruction,
876 std::size_t instruction_start_index) override;
877 virtual void handle_instruction_op_type_sampled_image(
878 Op_type_sampled_image instruction, std::size_t instruction_start_index) override;
879 virtual void handle_instruction_op_type_array(Op_type_array instruction,
880 std::size_t instruction_start_index) override;
881 virtual void handle_instruction_op_type_runtime_array(
882 Op_type_runtime_array instruction, std::size_t instruction_start_index) override;
883 virtual void handle_instruction_op_type_struct(Op_type_struct instruction,
884 std::size_t instruction_start_index) override;
885 virtual void handle_instruction_op_type_opaque(Op_type_opaque instruction,
886 std::size_t instruction_start_index) override;
887 virtual void handle_instruction_op_type_pointer(Op_type_pointer instruction,
888 std::size_t instruction_start_index) override;
889 virtual void handle_instruction_op_type_function(Op_type_function instruction,
890 std::size_t instruction_start_index) override;
891 virtual void handle_instruction_op_type_event(Op_type_event instruction,
892 std::size_t instruction_start_index) override;
893 virtual void handle_instruction_op_type_device_event(
894 Op_type_device_event instruction, std::size_t instruction_start_index) override;
895 virtual void handle_instruction_op_type_reserve_id(
896 Op_type_reserve_id instruction, std::size_t instruction_start_index) override;
897 virtual void handle_instruction_op_type_queue(Op_type_queue instruction,
898 std::size_t instruction_start_index) override;
899 virtual void handle_instruction_op_type_pipe(Op_type_pipe instruction,
900 std::size_t instruction_start_index) override;
901 virtual void handle_instruction_op_type_forward_pointer(
902 Op_type_forward_pointer instruction, std::size_t instruction_start_index) override;
903 virtual void handle_instruction_op_constant_true(Op_constant_true instruction,
904 std::size_t instruction_start_index) override;
905 virtual void handle_instruction_op_constant_false(Op_constant_false instruction,
906 std::size_t instruction_start_index) override;
907 virtual void handle_instruction_op_constant(Op_constant instruction,
908 std::size_t instruction_start_index) override;
909 virtual void handle_instruction_op_constant_composite(
910 Op_constant_composite instruction, std::size_t instruction_start_index) override;
911 virtual void handle_instruction_op_constant_sampler(
912 Op_constant_sampler instruction, std::size_t instruction_start_index) override;
913 virtual void handle_instruction_op_constant_null(Op_constant_null instruction,
914 std::size_t instruction_start_index) override;
915 virtual void handle_instruction_op_spec_constant_true(
916 Op_spec_constant_true instruction, std::size_t instruction_start_index) override;
917 virtual void handle_instruction_op_spec_constant_false(
918 Op_spec_constant_false instruction, std::size_t instruction_start_index) override;
919 virtual void handle_instruction_op_spec_constant(Op_spec_constant instruction,
920 std::size_t instruction_start_index) override;
921 virtual void handle_instruction_op_spec_constant_composite(
922 Op_spec_constant_composite instruction, std::size_t instruction_start_index) override;
923 virtual void handle_instruction_op_spec_constant_op(
924 Op_spec_constant_op instruction, std::size_t instruction_start_index) override;
925 virtual void handle_instruction_op_function(Op_function instruction,
926 std::size_t instruction_start_index) override;
927 virtual void handle_instruction_op_function_parameter(
928 Op_function_parameter instruction, std::size_t instruction_start_index) override;
929 virtual void handle_instruction_op_function_end(Op_function_end instruction,
930 std::size_t instruction_start_index) override;
931 virtual void handle_instruction_op_function_call(Op_function_call instruction,
932 std::size_t instruction_start_index) override;
933 virtual void handle_instruction_op_variable(Op_variable instruction,
934 std::size_t instruction_start_index) override;
935 virtual void handle_instruction_op_image_texel_pointer(
936 Op_image_texel_pointer instruction, std::size_t instruction_start_index) override;
937 virtual void handle_instruction_op_load(Op_load instruction,
938 std::size_t instruction_start_index) override;
939 virtual void handle_instruction_op_store(Op_store instruction,
940 std::size_t instruction_start_index) override;
941 virtual void handle_instruction_op_copy_memory(Op_copy_memory instruction,
942 std::size_t instruction_start_index) override;
943 virtual void handle_instruction_op_copy_memory_sized(
944 Op_copy_memory_sized instruction, std::size_t instruction_start_index) override;
945 virtual void handle_instruction_op_access_chain(Op_access_chain instruction,
946 std::size_t instruction_start_index) override;
947 virtual void handle_instruction_op_in_bounds_access_chain(
948 Op_in_bounds_access_chain instruction, std::size_t instruction_start_index) override;
949 virtual void handle_instruction_op_ptr_access_chain(
950 Op_ptr_access_chain instruction, std::size_t instruction_start_index) override;
951 virtual void handle_instruction_op_array_length(Op_array_length instruction,
952 std::size_t instruction_start_index) override;
953 virtual void handle_instruction_op_generic_ptr_mem_semantics(
954 Op_generic_ptr_mem_semantics instruction, std::size_t instruction_start_index) override;
955 virtual void handle_instruction_op_in_bounds_ptr_access_chain(
956 Op_in_bounds_ptr_access_chain instruction, std::size_t instruction_start_index) override;
957 virtual void handle_instruction_op_decorate(Op_decorate instruction,
958 std::size_t instruction_start_index) override;
959 virtual void handle_instruction_op_member_decorate(
960 Op_member_decorate instruction, std::size_t instruction_start_index) override;
961 virtual void handle_instruction_op_decoration_group(
962 Op_decoration_group instruction, std::size_t instruction_start_index) override;
963 virtual void handle_instruction_op_group_decorate(Op_group_decorate instruction,
964 std::size_t instruction_start_index) override;
965 virtual void handle_instruction_op_group_member_decorate(
966 Op_group_member_decorate instruction, std::size_t instruction_start_index) override;
967 virtual void handle_instruction_op_vector_extract_dynamic(
968 Op_vector_extract_dynamic instruction, std::size_t instruction_start_index) override;
969 virtual void handle_instruction_op_vector_insert_dynamic(
970 Op_vector_insert_dynamic instruction, std::size_t instruction_start_index) override;
971 virtual void handle_instruction_op_vector_shuffle(Op_vector_shuffle instruction,
972 std::size_t instruction_start_index) override;
973 virtual void handle_instruction_op_composite_construct(
974 Op_composite_construct instruction, std::size_t instruction_start_index) override;
975 virtual void handle_instruction_op_composite_extract(
976 Op_composite_extract instruction, std::size_t instruction_start_index) override;
977 virtual void handle_instruction_op_composite_insert(
978 Op_composite_insert instruction, std::size_t instruction_start_index) override;
979 virtual void handle_instruction_op_copy_object(Op_copy_object instruction,
980 std::size_t instruction_start_index) override;
981 virtual void handle_instruction_op_transpose(Op_transpose instruction,
982 std::size_t instruction_start_index) override;
983 virtual void handle_instruction_op_sampled_image(Op_sampled_image instruction,
984 std::size_t instruction_start_index) override;
985 virtual void handle_instruction_op_image_sample_implicit_lod(
986 Op_image_sample_implicit_lod instruction, std::size_t instruction_start_index) override;
987 virtual void handle_instruction_op_image_sample_explicit_lod(
988 Op_image_sample_explicit_lod instruction, std::size_t instruction_start_index) override;
989 virtual void handle_instruction_op_image_sample_dref_implicit_lod(
990 Op_image_sample_dref_implicit_lod instruction,
991 std::size_t instruction_start_index) override;
992 virtual void handle_instruction_op_image_sample_dref_explicit_lod(
993 Op_image_sample_dref_explicit_lod instruction,
994 std::size_t instruction_start_index) override;
995 virtual void handle_instruction_op_image_sample_proj_implicit_lod(
996 Op_image_sample_proj_implicit_lod instruction,
997 std::size_t instruction_start_index) override;
998 virtual void handle_instruction_op_image_sample_proj_explicit_lod(
999 Op_image_sample_proj_explicit_lod instruction,
1000 std::size_t instruction_start_index) override;
1001 virtual void handle_instruction_op_image_sample_proj_dref_implicit_lod(
1002 Op_image_sample_proj_dref_implicit_lod instruction,
1003 std::size_t instruction_start_index) override;
1004 virtual void handle_instruction_op_image_sample_proj_dref_explicit_lod(
1005 Op_image_sample_proj_dref_explicit_lod instruction,
1006 std::size_t instruction_start_index) override;
1007 virtual void handle_instruction_op_image_fetch(Op_image_fetch instruction,
1008 std::size_t instruction_start_index) override;
1009 virtual void handle_instruction_op_image_gather(Op_image_gather instruction,
1010 std::size_t instruction_start_index) override;
1011 virtual void handle_instruction_op_image_dref_gather(
1012 Op_image_dref_gather instruction, std::size_t instruction_start_index) override;
1013 virtual void handle_instruction_op_image_read(Op_image_read instruction,
1014 std::size_t instruction_start_index) override;
1015 virtual void handle_instruction_op_image_write(Op_image_write instruction,
1016 std::size_t instruction_start_index) override;
1017 virtual void handle_instruction_op_image(Op_image instruction,
1018 std::size_t instruction_start_index) override;
1019 virtual void handle_instruction_op_image_query_format(
1020 Op_image_query_format instruction, std::size_t instruction_start_index) override;
1021 virtual void handle_instruction_op_image_query_order(
1022 Op_image_query_order instruction, std::size_t instruction_start_index) override;
1023 virtual void handle_instruction_op_image_query_size_lod(
1024 Op_image_query_size_lod instruction, std::size_t instruction_start_index) override;
1025 virtual void handle_instruction_op_image_query_size(
1026 Op_image_query_size instruction, std::size_t instruction_start_index) override;
1027 virtual void handle_instruction_op_image_query_lod(
1028 Op_image_query_lod instruction, std::size_t instruction_start_index) override;
1029 virtual void handle_instruction_op_image_query_levels(
1030 Op_image_query_levels instruction, std::size_t instruction_start_index) override;
1031 virtual void handle_instruction_op_image_query_samples(
1032 Op_image_query_samples instruction, std::size_t instruction_start_index) override;
1033 virtual void handle_instruction_op_convert_f_to_u(Op_convert_f_to_u instruction,
1034 std::size_t instruction_start_index) override;
1035 virtual void handle_instruction_op_convert_f_to_s(Op_convert_f_to_s instruction,
1036 std::size_t instruction_start_index) override;
1037 virtual void handle_instruction_op_convert_s_to_f(Op_convert_s_to_f instruction,
1038 std::size_t instruction_start_index) override;
1039 virtual void handle_instruction_op_convert_u_to_f(Op_convert_u_to_f instruction,
1040 std::size_t instruction_start_index) override;
1041 virtual void handle_instruction_op_u_convert(Op_u_convert instruction,
1042 std::size_t instruction_start_index) override;
1043 virtual void handle_instruction_op_s_convert(Op_s_convert instruction,
1044 std::size_t instruction_start_index) override;
1045 virtual void handle_instruction_op_f_convert(Op_f_convert instruction,
1046 std::size_t instruction_start_index) override;
1047 virtual void handle_instruction_op_quantize_to_f16(
1048 Op_quantize_to_f16 instruction, std::size_t instruction_start_index) override;
1049 virtual void handle_instruction_op_convert_ptr_to_u(
1050 Op_convert_ptr_to_u instruction, std::size_t instruction_start_index) override;
1051 virtual void handle_instruction_op_sat_convert_s_to_u(
1052 Op_sat_convert_s_to_u instruction, std::size_t instruction_start_index) override;
1053 virtual void handle_instruction_op_sat_convert_u_to_s(
1054 Op_sat_convert_u_to_s instruction, std::size_t instruction_start_index) override;
1055 virtual void handle_instruction_op_convert_u_to_ptr(
1056 Op_convert_u_to_ptr instruction, std::size_t instruction_start_index) override;
1057 virtual void handle_instruction_op_ptr_cast_to_generic(
1058 Op_ptr_cast_to_generic instruction, std::size_t instruction_start_index) override;
1059 virtual void handle_instruction_op_generic_cast_to_ptr(
1060 Op_generic_cast_to_ptr instruction, std::size_t instruction_start_index) override;
1061 virtual void handle_instruction_op_generic_cast_to_ptr_explicit(
1062 Op_generic_cast_to_ptr_explicit instruction, std::size_t instruction_start_index) override;
1063 virtual void handle_instruction_op_bitcast(Op_bitcast instruction,
1064 std::size_t instruction_start_index) override;
1065 virtual void handle_instruction_op_s_negate(Op_s_negate instruction,
1066 std::size_t instruction_start_index) override;
1067 virtual void handle_instruction_op_f_negate(Op_f_negate instruction,
1068 std::size_t instruction_start_index) override;
1069 virtual void handle_instruction_op_i_add(Op_i_add instruction,
1070 std::size_t instruction_start_index) override;
1071 virtual void handle_instruction_op_f_add(Op_f_add instruction,
1072 std::size_t instruction_start_index) override;
1073 virtual void handle_instruction_op_i_sub(Op_i_sub instruction,
1074 std::size_t instruction_start_index) override;
1075 virtual void handle_instruction_op_f_sub(Op_f_sub instruction,
1076 std::size_t instruction_start_index) override;
1077 virtual void handle_instruction_op_i_mul(Op_i_mul instruction,
1078 std::size_t instruction_start_index) override;
1079 virtual void handle_instruction_op_f_mul(Op_f_mul instruction,
1080 std::size_t instruction_start_index) override;
1081 virtual void handle_instruction_op_u_div(Op_u_div instruction,
1082 std::size_t instruction_start_index) override;
1083 virtual void handle_instruction_op_s_div(Op_s_div instruction,
1084 std::size_t instruction_start_index) override;
1085 virtual void handle_instruction_op_f_div(Op_f_div instruction,
1086 std::size_t instruction_start_index) override;
1087 virtual void handle_instruction_op_u_mod(Op_u_mod instruction,
1088 std::size_t instruction_start_index) override;
1089 virtual void handle_instruction_op_s_rem(Op_s_rem instruction,
1090 std::size_t instruction_start_index) override;
1091 virtual void handle_instruction_op_s_mod(Op_s_mod instruction,
1092 std::size_t instruction_start_index) override;
1093 virtual void handle_instruction_op_f_rem(Op_f_rem instruction,
1094 std::size_t instruction_start_index) override;
1095 virtual void handle_instruction_op_f_mod(Op_f_mod instruction,
1096 std::size_t instruction_start_index) override;
1097 virtual void handle_instruction_op_vector_times_scalar(
1098 Op_vector_times_scalar instruction, std::size_t instruction_start_index) override;
1099 virtual void handle_instruction_op_matrix_times_scalar(
1100 Op_matrix_times_scalar instruction, std::size_t instruction_start_index) override;
1101 virtual void handle_instruction_op_vector_times_matrix(
1102 Op_vector_times_matrix instruction, std::size_t instruction_start_index) override;
1103 virtual void handle_instruction_op_matrix_times_vector(
1104 Op_matrix_times_vector instruction, std::size_t instruction_start_index) override;
1105 virtual void handle_instruction_op_matrix_times_matrix(
1106 Op_matrix_times_matrix instruction, std::size_t instruction_start_index) override;
1107 virtual void handle_instruction_op_outer_product(Op_outer_product instruction,
1108 std::size_t instruction_start_index) override;
1109 virtual void handle_instruction_op_dot(Op_dot instruction,
1110 std::size_t instruction_start_index) override;
1111 virtual void handle_instruction_op_i_add_carry(Op_i_add_carry instruction,
1112 std::size_t instruction_start_index) override;
1113 virtual void handle_instruction_op_i_sub_borrow(Op_i_sub_borrow instruction,
1114 std::size_t instruction_start_index) override;
1115 virtual void handle_instruction_op_u_mul_extended(Op_u_mul_extended instruction,
1116 std::size_t instruction_start_index) override;
1117 virtual void handle_instruction_op_s_mul_extended(Op_s_mul_extended instruction,
1118 std::size_t instruction_start_index) override;
1119 virtual void handle_instruction_op_any(Op_any instruction,
1120 std::size_t instruction_start_index) override;
1121 virtual void handle_instruction_op_all(Op_all instruction,
1122 std::size_t instruction_start_index) override;
1123 virtual void handle_instruction_op_is_nan(Op_is_nan instruction,
1124 std::size_t instruction_start_index) override;
1125 virtual void handle_instruction_op_is_inf(Op_is_inf instruction,
1126 std::size_t instruction_start_index) override;
1127 virtual void handle_instruction_op_is_finite(Op_is_finite instruction,
1128 std::size_t instruction_start_index) override;
1129 virtual void handle_instruction_op_is_normal(Op_is_normal instruction,
1130 std::size_t instruction_start_index) override;
1131 virtual void handle_instruction_op_sign_bit_set(Op_sign_bit_set instruction,
1132 std::size_t instruction_start_index) override;
1133 virtual void handle_instruction_op_less_or_greater(
1134 Op_less_or_greater instruction, std::size_t instruction_start_index) override;
1135 virtual void handle_instruction_op_ordered(Op_ordered instruction,
1136 std::size_t instruction_start_index) override;
1137 virtual void handle_instruction_op_unordered(Op_unordered instruction,
1138 std::size_t instruction_start_index) override;
1139 virtual void handle_instruction_op_logical_equal(Op_logical_equal instruction,
1140 std::size_t instruction_start_index) override;
1141 virtual void handle_instruction_op_logical_not_equal(
1142 Op_logical_not_equal instruction, std::size_t instruction_start_index) override;
1143 virtual void handle_instruction_op_logical_or(Op_logical_or instruction,
1144 std::size_t instruction_start_index) override;
1145 virtual void handle_instruction_op_logical_and(Op_logical_and instruction,
1146 std::size_t instruction_start_index) override;
1147 virtual void handle_instruction_op_logical_not(Op_logical_not instruction,
1148 std::size_t instruction_start_index) override;
1149 virtual void handle_instruction_op_select(Op_select instruction,
1150 std::size_t instruction_start_index) override;
1151 virtual void handle_instruction_op_i_equal(Op_i_equal instruction,
1152 std::size_t instruction_start_index) override;
1153 virtual void handle_instruction_op_i_not_equal(Op_i_not_equal instruction,
1154 std::size_t instruction_start_index) override;
1155 virtual void handle_instruction_op_u_greater_than(Op_u_greater_than instruction,
1156 std::size_t instruction_start_index) override;
1157 virtual void handle_instruction_op_s_greater_than(Op_s_greater_than instruction,
1158 std::size_t instruction_start_index) override;
1159 virtual void handle_instruction_op_u_greater_than_equal(
1160 Op_u_greater_than_equal instruction, std::size_t instruction_start_index) override;
1161 virtual void handle_instruction_op_s_greater_than_equal(
1162 Op_s_greater_than_equal instruction, std::size_t instruction_start_index) override;
1163 virtual void handle_instruction_op_u_less_than(Op_u_less_than instruction,
1164 std::size_t instruction_start_index) override;
1165 virtual void handle_instruction_op_s_less_than(Op_s_less_than instruction,
1166 std::size_t instruction_start_index) override;
1167 virtual void handle_instruction_op_u_less_than_equal(
1168 Op_u_less_than_equal instruction, std::size_t instruction_start_index) override;
1169 virtual void handle_instruction_op_s_less_than_equal(
1170 Op_s_less_than_equal instruction, std::size_t instruction_start_index) override;
1171 virtual void handle_instruction_op_f_ord_equal(Op_f_ord_equal instruction,
1172 std::size_t instruction_start_index) override;
1173 virtual void handle_instruction_op_f_unord_equal(Op_f_unord_equal instruction,
1174 std::size_t instruction_start_index) override;
1175 virtual void handle_instruction_op_f_ord_not_equal(
1176 Op_f_ord_not_equal instruction, std::size_t instruction_start_index) override;
1177 virtual void handle_instruction_op_f_unord_not_equal(
1178 Op_f_unord_not_equal instruction, std::size_t instruction_start_index) override;
1179 virtual void handle_instruction_op_f_ord_less_than(
1180 Op_f_ord_less_than instruction, std::size_t instruction_start_index) override;
1181 virtual void handle_instruction_op_f_unord_less_than(
1182 Op_f_unord_less_than instruction, std::size_t instruction_start_index) override;
1183 virtual void handle_instruction_op_f_ord_greater_than(
1184 Op_f_ord_greater_than instruction, std::size_t instruction_start_index) override;
1185 virtual void handle_instruction_op_f_unord_greater_than(
1186 Op_f_unord_greater_than instruction, std::size_t instruction_start_index) override;
1187 virtual void handle_instruction_op_f_ord_less_than_equal(
1188 Op_f_ord_less_than_equal instruction, std::size_t instruction_start_index) override;
1189 virtual void handle_instruction_op_f_unord_less_than_equal(
1190 Op_f_unord_less_than_equal instruction, std::size_t instruction_start_index) override;
1191 virtual void handle_instruction_op_f_ord_greater_than_equal(
1192 Op_f_ord_greater_than_equal instruction, std::size_t instruction_start_index) override;
1193 virtual void handle_instruction_op_f_unord_greater_than_equal(
1194 Op_f_unord_greater_than_equal instruction, std::size_t instruction_start_index) override;
1195 virtual void handle_instruction_op_shift_right_logical(
1196 Op_shift_right_logical instruction, std::size_t instruction_start_index) override;
1197 virtual void handle_instruction_op_shift_right_arithmetic(
1198 Op_shift_right_arithmetic instruction, std::size_t instruction_start_index) override;
1199 virtual void handle_instruction_op_shift_left_logical(
1200 Op_shift_left_logical instruction, std::size_t instruction_start_index) override;
1201 virtual void handle_instruction_op_bitwise_or(Op_bitwise_or instruction,
1202 std::size_t instruction_start_index) override;
1203 virtual void handle_instruction_op_bitwise_xor(Op_bitwise_xor instruction,
1204 std::size_t instruction_start_index) override;
1205 virtual void handle_instruction_op_bitwise_and(Op_bitwise_and instruction,
1206 std::size_t instruction_start_index) override;
1207 virtual void handle_instruction_op_not(Op_not instruction,
1208 std::size_t instruction_start_index) override;
1209 virtual void handle_instruction_op_bit_field_insert(
1210 Op_bit_field_insert instruction, std::size_t instruction_start_index) override;
1211 virtual void handle_instruction_op_bit_field_s_extract(
1212 Op_bit_field_s_extract instruction, std::size_t instruction_start_index) override;
1213 virtual void handle_instruction_op_bit_field_u_extract(
1214 Op_bit_field_u_extract instruction, std::size_t instruction_start_index) override;
1215 virtual void handle_instruction_op_bit_reverse(Op_bit_reverse instruction,
1216 std::size_t instruction_start_index) override;
1217 virtual void handle_instruction_op_bit_count(Op_bit_count instruction,
1218 std::size_t instruction_start_index) override;
1219 virtual void handle_instruction_op_d_pdx(Op_d_pdx instruction,
1220 std::size_t instruction_start_index) override;
1221 virtual void handle_instruction_op_d_pdy(Op_d_pdy instruction,
1222 std::size_t instruction_start_index) override;
1223 virtual void handle_instruction_op_fwidth(Op_fwidth instruction,
1224 std::size_t instruction_start_index) override;
1225 virtual void handle_instruction_op_d_pdx_fine(Op_d_pdx_fine instruction,
1226 std::size_t instruction_start_index) override;
1227 virtual void handle_instruction_op_d_pdy_fine(Op_d_pdy_fine instruction,
1228 std::size_t instruction_start_index) override;
1229 virtual void handle_instruction_op_fwidth_fine(Op_fwidth_fine instruction,
1230 std::size_t instruction_start_index) override;
1231 virtual void handle_instruction_op_d_pdx_coarse(Op_d_pdx_coarse instruction,
1232 std::size_t instruction_start_index) override;
1233 virtual void handle_instruction_op_d_pdy_coarse(Op_d_pdy_coarse instruction,
1234 std::size_t instruction_start_index) override;
1235 virtual void handle_instruction_op_fwidth_coarse(Op_fwidth_coarse instruction,
1236 std::size_t instruction_start_index) override;
1237 virtual void handle_instruction_op_emit_vertex(Op_emit_vertex instruction,
1238 std::size_t instruction_start_index) override;
1239 virtual void handle_instruction_op_end_primitive(Op_end_primitive instruction,
1240 std::size_t instruction_start_index) override;
1241 virtual void handle_instruction_op_emit_stream_vertex(
1242 Op_emit_stream_vertex instruction, std::size_t instruction_start_index) override;
1243 virtual void handle_instruction_op_end_stream_primitive(
1244 Op_end_stream_primitive instruction, std::size_t instruction_start_index) override;
1245 virtual void handle_instruction_op_control_barrier(
1246 Op_control_barrier instruction, std::size_t instruction_start_index) override;
1247 virtual void handle_instruction_op_memory_barrier(Op_memory_barrier instruction,
1248 std::size_t instruction_start_index) override;
1249 virtual void handle_instruction_op_atomic_load(Op_atomic_load instruction,
1250 std::size_t instruction_start_index) override;
1251 virtual void handle_instruction_op_atomic_store(Op_atomic_store instruction,
1252 std::size_t instruction_start_index) override;
1253 virtual void handle_instruction_op_atomic_exchange(
1254 Op_atomic_exchange instruction, std::size_t instruction_start_index) override;
1255 virtual void handle_instruction_op_atomic_compare_exchange(
1256 Op_atomic_compare_exchange instruction, std::size_t instruction_start_index) override;
1257 virtual void handle_instruction_op_atomic_compare_exchange_weak(
1258 Op_atomic_compare_exchange_weak instruction, std::size_t instruction_start_index) override;
1259 virtual void handle_instruction_op_atomic_i_increment(
1260 Op_atomic_i_increment instruction, std::size_t instruction_start_index) override;
1261 virtual void handle_instruction_op_atomic_i_decrement(
1262 Op_atomic_i_decrement instruction, std::size_t instruction_start_index) override;
1263 virtual void handle_instruction_op_atomic_i_add(Op_atomic_i_add instruction,
1264 std::size_t instruction_start_index) override;
1265 virtual void handle_instruction_op_atomic_i_sub(Op_atomic_i_sub instruction,
1266 std::size_t instruction_start_index) override;
1267 virtual void handle_instruction_op_atomic_s_min(Op_atomic_s_min instruction,
1268 std::size_t instruction_start_index) override;
1269 virtual void handle_instruction_op_atomic_u_min(Op_atomic_u_min instruction,
1270 std::size_t instruction_start_index) override;
1271 virtual void handle_instruction_op_atomic_s_max(Op_atomic_s_max instruction,
1272 std::size_t instruction_start_index) override;
1273 virtual void handle_instruction_op_atomic_u_max(Op_atomic_u_max instruction,
1274 std::size_t instruction_start_index) override;
1275 virtual void handle_instruction_op_atomic_and(Op_atomic_and instruction,
1276 std::size_t instruction_start_index) override;
1277 virtual void handle_instruction_op_atomic_or(Op_atomic_or instruction,
1278 std::size_t instruction_start_index) override;
1279 virtual void handle_instruction_op_atomic_xor(Op_atomic_xor instruction,
1280 std::size_t instruction_start_index) override;
1281 virtual void handle_instruction_op_phi(Op_phi instruction,
1282 std::size_t instruction_start_index) override;
1283 virtual void handle_instruction_op_loop_merge(Op_loop_merge instruction,
1284 std::size_t instruction_start_index) override;
1285 virtual void handle_instruction_op_selection_merge(
1286 Op_selection_merge instruction, std::size_t instruction_start_index) override;
1287 virtual void handle_instruction_op_label(Op_label instruction,
1288 std::size_t instruction_start_index) override;
1289 virtual void handle_instruction_op_branch(Op_branch instruction,
1290 std::size_t instruction_start_index) override;
1291 virtual void handle_instruction_op_branch_conditional(
1292 Op_branch_conditional instruction, std::size_t instruction_start_index) override;
1293 virtual void handle_instruction_op_switch(Op_switch instruction,
1294 std::size_t instruction_start_index) override;
1295 virtual void handle_instruction_op_kill(Op_kill instruction,
1296 std::size_t instruction_start_index) override;
1297 virtual void handle_instruction_op_return(Op_return instruction,
1298 std::size_t instruction_start_index) override;
1299 virtual void handle_instruction_op_return_value(Op_return_value instruction,
1300 std::size_t instruction_start_index) override;
1301 virtual void handle_instruction_op_unreachable(Op_unreachable instruction,
1302 std::size_t instruction_start_index) override;
1303 virtual void handle_instruction_op_lifetime_start(Op_lifetime_start instruction,
1304 std::size_t instruction_start_index) override;
1305 virtual void handle_instruction_op_lifetime_stop(Op_lifetime_stop instruction,
1306 std::size_t instruction_start_index) override;
1307 virtual void handle_instruction_op_group_async_copy(
1308 Op_group_async_copy instruction, std::size_t instruction_start_index) override;
1309 virtual void handle_instruction_op_group_wait_events(
1310 Op_group_wait_events instruction, std::size_t instruction_start_index) override;
1311 virtual void handle_instruction_op_group_all(Op_group_all instruction,
1312 std::size_t instruction_start_index) override;
1313 virtual void handle_instruction_op_group_any(Op_group_any instruction,
1314 std::size_t instruction_start_index) override;
1315 virtual void handle_instruction_op_group_broadcast(
1316 Op_group_broadcast instruction, std::size_t instruction_start_index) override;
1317 virtual void handle_instruction_op_group_i_add(Op_group_i_add instruction,
1318 std::size_t instruction_start_index) override;
1319 virtual void handle_instruction_op_group_f_add(Op_group_f_add instruction,
1320 std::size_t instruction_start_index) override;
1321 virtual void handle_instruction_op_group_f_min(Op_group_f_min instruction,
1322 std::size_t instruction_start_index) override;
1323 virtual void handle_instruction_op_group_u_min(Op_group_u_min instruction,
1324 std::size_t instruction_start_index) override;
1325 virtual void handle_instruction_op_group_s_min(Op_group_s_min instruction,
1326 std::size_t instruction_start_index) override;
1327 virtual void handle_instruction_op_group_f_max(Op_group_f_max instruction,
1328 std::size_t instruction_start_index) override;
1329 virtual void handle_instruction_op_group_u_max(Op_group_u_max instruction,
1330 std::size_t instruction_start_index) override;
1331 virtual void handle_instruction_op_group_s_max(Op_group_s_max instruction,
1332 std::size_t instruction_start_index) override;
1333 virtual void handle_instruction_op_read_pipe(Op_read_pipe instruction,
1334 std::size_t instruction_start_index) override;
1335 virtual void handle_instruction_op_write_pipe(Op_write_pipe instruction,
1336 std::size_t instruction_start_index) override;
1337 virtual void handle_instruction_op_reserved_read_pipe(
1338 Op_reserved_read_pipe instruction, std::size_t instruction_start_index) override;
1339 virtual void handle_instruction_op_reserved_write_pipe(
1340 Op_reserved_write_pipe instruction, std::size_t instruction_start_index) override;
1341 virtual void handle_instruction_op_reserve_read_pipe_packets(
1342 Op_reserve_read_pipe_packets instruction, std::size_t instruction_start_index) override;
1343 virtual void handle_instruction_op_reserve_write_pipe_packets(
1344 Op_reserve_write_pipe_packets instruction, std::size_t instruction_start_index) override;
1345 virtual void handle_instruction_op_commit_read_pipe(
1346 Op_commit_read_pipe instruction, std::size_t instruction_start_index) override;
1347 virtual void handle_instruction_op_commit_write_pipe(
1348 Op_commit_write_pipe instruction, std::size_t instruction_start_index) override;
1349 virtual void handle_instruction_op_is_valid_reserve_id(
1350 Op_is_valid_reserve_id instruction, std::size_t instruction_start_index) override;
1351 virtual void handle_instruction_op_get_num_pipe_packets(
1352 Op_get_num_pipe_packets instruction, std::size_t instruction_start_index) override;
1353 virtual void handle_instruction_op_get_max_pipe_packets(
1354 Op_get_max_pipe_packets instruction, std::size_t instruction_start_index) override;
1355 virtual void handle_instruction_op_group_reserve_read_pipe_packets(
1356 Op_group_reserve_read_pipe_packets instruction,
1357 std::size_t instruction_start_index) override;
1358 virtual void handle_instruction_op_group_reserve_write_pipe_packets(
1359 Op_group_reserve_write_pipe_packets instruction,
1360 std::size_t instruction_start_index) override;
1361 virtual void handle_instruction_op_group_commit_read_pipe(
1362 Op_group_commit_read_pipe instruction, std::size_t instruction_start_index) override;
1363 virtual void handle_instruction_op_group_commit_write_pipe(
1364 Op_group_commit_write_pipe instruction, std::size_t instruction_start_index) override;
1365 virtual void handle_instruction_op_enqueue_marker(Op_enqueue_marker instruction,
1366 std::size_t instruction_start_index) override;
1367 virtual void handle_instruction_op_enqueue_kernel(Op_enqueue_kernel instruction,
1368 std::size_t instruction_start_index) override;
1369 virtual void handle_instruction_op_get_kernel_n_drange_sub_group_count(
1370 Op_get_kernel_n_drange_sub_group_count instruction,
1371 std::size_t instruction_start_index) override;
1372 virtual void handle_instruction_op_get_kernel_n_drange_max_sub_group_size(
1373 Op_get_kernel_n_drange_max_sub_group_size instruction,
1374 std::size_t instruction_start_index) override;
1375 virtual void handle_instruction_op_get_kernel_work_group_size(
1376 Op_get_kernel_work_group_size instruction, std::size_t instruction_start_index) override;
1377 virtual void handle_instruction_op_get_kernel_preferred_work_group_size_multiple(
1378 Op_get_kernel_preferred_work_group_size_multiple instruction,
1379 std::size_t instruction_start_index) override;
1380 virtual void handle_instruction_op_retain_event(Op_retain_event instruction,
1381 std::size_t instruction_start_index) override;
1382 virtual void handle_instruction_op_release_event(Op_release_event instruction,
1383 std::size_t instruction_start_index) override;
1384 virtual void handle_instruction_op_create_user_event(
1385 Op_create_user_event instruction, std::size_t instruction_start_index) override;
1386 virtual void handle_instruction_op_is_valid_event(Op_is_valid_event instruction,
1387 std::size_t instruction_start_index) override;
1388 virtual void handle_instruction_op_set_user_event_status(
1389 Op_set_user_event_status instruction, std::size_t instruction_start_index) override;
1390 virtual void handle_instruction_op_capture_event_profiling_info(
1391 Op_capture_event_profiling_info instruction, std::size_t instruction_start_index) override;
1392 virtual void handle_instruction_op_get_default_queue(
1393 Op_get_default_queue instruction, std::size_t instruction_start_index) override;
1394 virtual void handle_instruction_op_build_nd_range(Op_build_nd_range instruction,
1395 std::size_t instruction_start_index) override;
1396 virtual void handle_instruction_op_image_sparse_sample_implicit_lod(
1397 Op_image_sparse_sample_implicit_lod instruction,
1398 std::size_t instruction_start_index) override;
1399 virtual void handle_instruction_op_image_sparse_sample_explicit_lod(
1400 Op_image_sparse_sample_explicit_lod instruction,
1401 std::size_t instruction_start_index) override;
1402 virtual void handle_instruction_op_image_sparse_sample_dref_implicit_lod(
1403 Op_image_sparse_sample_dref_implicit_lod instruction,
1404 std::size_t instruction_start_index) override;
1405 virtual void handle_instruction_op_image_sparse_sample_dref_explicit_lod(
1406 Op_image_sparse_sample_dref_explicit_lod instruction,
1407 std::size_t instruction_start_index) override;
1408 virtual void handle_instruction_op_image_sparse_sample_proj_implicit_lod(
1409 Op_image_sparse_sample_proj_implicit_lod instruction,
1410 std::size_t instruction_start_index) override;
1411 virtual void handle_instruction_op_image_sparse_sample_proj_explicit_lod(
1412 Op_image_sparse_sample_proj_explicit_lod instruction,
1413 std::size_t instruction_start_index) override;
1414 virtual void handle_instruction_op_image_sparse_sample_proj_dref_implicit_lod(
1415 Op_image_sparse_sample_proj_dref_implicit_lod instruction,
1416 std::size_t instruction_start_index) override;
1417 virtual void handle_instruction_op_image_sparse_sample_proj_dref_explicit_lod(
1418 Op_image_sparse_sample_proj_dref_explicit_lod instruction,
1419 std::size_t instruction_start_index) override;
1420 virtual void handle_instruction_op_image_sparse_fetch(
1421 Op_image_sparse_fetch instruction, std::size_t instruction_start_index) override;
1422 virtual void handle_instruction_op_image_sparse_gather(
1423 Op_image_sparse_gather instruction, std::size_t instruction_start_index) override;
1424 virtual void handle_instruction_op_image_sparse_dref_gather(
1425 Op_image_sparse_dref_gather instruction, std::size_t instruction_start_index) override;
1426 virtual void handle_instruction_op_image_sparse_texels_resident(
1427 Op_image_sparse_texels_resident instruction, std::size_t instruction_start_index) override;
1428 virtual void handle_instruction_op_no_line(Op_no_line instruction,
1429 std::size_t instruction_start_index) override;
1430 virtual void handle_instruction_op_atomic_flag_test_and_set(
1431 Op_atomic_flag_test_and_set instruction, std::size_t instruction_start_index) override;
1432 virtual void handle_instruction_op_atomic_flag_clear(
1433 Op_atomic_flag_clear instruction, std::size_t instruction_start_index) override;
1434 virtual void handle_instruction_op_image_sparse_read(
1435 Op_image_sparse_read instruction, std::size_t instruction_start_index) override;
1436 virtual void handle_instruction_op_size_of(Op_size_of instruction,
1437 std::size_t instruction_start_index) override;
1438 virtual void handle_instruction_op_type_pipe_storage(
1439 Op_type_pipe_storage instruction, std::size_t instruction_start_index) override;
1440 virtual void handle_instruction_op_constant_pipe_storage(
1441 Op_constant_pipe_storage instruction, std::size_t instruction_start_index) override;
1442 virtual void handle_instruction_op_create_pipe_from_pipe_storage(
1443 Op_create_pipe_from_pipe_storage instruction, std::size_t instruction_start_index) override;
1444 virtual void handle_instruction_op_get_kernel_local_size_for_subgroup_count(
1445 Op_get_kernel_local_size_for_subgroup_count instruction,
1446 std::size_t instruction_start_index) override;
1447 virtual void handle_instruction_op_get_kernel_max_num_subgroups(
1448 Op_get_kernel_max_num_subgroups instruction, std::size_t instruction_start_index) override;
1449 virtual void handle_instruction_op_type_named_barrier(
1450 Op_type_named_barrier instruction, std::size_t instruction_start_index) override;
1451 virtual void handle_instruction_op_named_barrier_initialize(
1452 Op_named_barrier_initialize instruction, std::size_t instruction_start_index) override;
1453 virtual void handle_instruction_op_memory_named_barrier(
1454 Op_memory_named_barrier instruction, std::size_t instruction_start_index) override;
1455 virtual void handle_instruction_op_module_processed(
1456 Op_module_processed instruction, std::size_t instruction_start_index) override;
1457 virtual void handle_instruction_op_execution_mode_id(
1458 Op_execution_mode_id instruction, std::size_t instruction_start_index) override;
1459 virtual void handle_instruction_op_decorate_id(Op_decorate_id instruction,
1460 std::size_t instruction_start_index) override;
1461 virtual void handle_instruction_op_subgroup_ballot_khr(
1462 Op_subgroup_ballot_khr instruction, std::size_t instruction_start_index) override;
1463 virtual void handle_instruction_op_subgroup_first_invocation_khr(
1464 Op_subgroup_first_invocation_khr instruction, std::size_t instruction_start_index) override;
1465 virtual void handle_instruction_op_subgroup_all_khr(
1466 Op_subgroup_all_khr instruction, std::size_t instruction_start_index) override;
1467 virtual void handle_instruction_op_subgroup_any_khr(
1468 Op_subgroup_any_khr instruction, std::size_t instruction_start_index) override;
1469 virtual void handle_instruction_op_subgroup_all_equal_khr(
1470 Op_subgroup_all_equal_khr instruction, std::size_t instruction_start_index) override;
1471 virtual void handle_instruction_op_subgroup_read_invocation_khr(
1472 Op_subgroup_read_invocation_khr instruction, std::size_t instruction_start_index) override;
1473 virtual void handle_instruction_open_cl_std_op_acos(
1474 Open_cl_std_op_acos instruction, std::size_t instruction_start_index) override;
1475 virtual void handle_instruction_open_cl_std_op_acosh(
1476 Open_cl_std_op_acosh instruction, std::size_t instruction_start_index) override;
1477 virtual void handle_instruction_open_cl_std_op_acospi(
1478 Open_cl_std_op_acospi instruction, std::size_t instruction_start_index) override;
1479 virtual void handle_instruction_open_cl_std_op_asin(
1480 Open_cl_std_op_asin instruction, std::size_t instruction_start_index) override;
1481 virtual void handle_instruction_open_cl_std_op_asinh(
1482 Open_cl_std_op_asinh instruction, std::size_t instruction_start_index) override;
1483 virtual void handle_instruction_open_cl_std_op_asinpi(
1484 Open_cl_std_op_asinpi instruction, std::size_t instruction_start_index) override;
1485 virtual void handle_instruction_open_cl_std_op_atan(
1486 Open_cl_std_op_atan instruction, std::size_t instruction_start_index) override;
1487 virtual void handle_instruction_open_cl_std_op_atan2(
1488 Open_cl_std_op_atan2 instruction, std::size_t instruction_start_index) override;
1489 virtual void handle_instruction_open_cl_std_op_atanh(
1490 Open_cl_std_op_atanh instruction, std::size_t instruction_start_index) override;
1491 virtual void handle_instruction_open_cl_std_op_atanpi(
1492 Open_cl_std_op_atanpi instruction, std::size_t instruction_start_index) override;
1493 virtual void handle_instruction_open_cl_std_op_atan2pi(
1494 Open_cl_std_op_atan2pi instruction, std::size_t instruction_start_index) override;
1495 virtual void handle_instruction_open_cl_std_op_cbrt(
1496 Open_cl_std_op_cbrt instruction, std::size_t instruction_start_index) override;
1497 virtual void handle_instruction_open_cl_std_op_ceil(
1498 Open_cl_std_op_ceil instruction, std::size_t instruction_start_index) override;
1499 virtual void handle_instruction_open_cl_std_op_copysign(
1500 Open_cl_std_op_copysign instruction, std::size_t instruction_start_index) override;
1501 virtual void handle_instruction_open_cl_std_op_cos(
1502 Open_cl_std_op_cos instruction, std::size_t instruction_start_index) override;
1503 virtual void handle_instruction_open_cl_std_op_cosh(
1504 Open_cl_std_op_cosh instruction, std::size_t instruction_start_index) override;
1505 virtual void handle_instruction_open_cl_std_op_cospi(
1506 Open_cl_std_op_cospi instruction, std::size_t instruction_start_index) override;
1507 virtual void handle_instruction_open_cl_std_op_erfc(
1508 Open_cl_std_op_erfc instruction, std::size_t instruction_start_index) override;
1509 virtual void handle_instruction_open_cl_std_op_erf(
1510 Open_cl_std_op_erf instruction, std::size_t instruction_start_index) override;
1511 virtual void handle_instruction_open_cl_std_op_exp(
1512 Open_cl_std_op_exp instruction, std::size_t instruction_start_index) override;
1513 virtual void handle_instruction_open_cl_std_op_exp2(
1514 Open_cl_std_op_exp2 instruction, std::size_t instruction_start_index) override;
1515 virtual void handle_instruction_open_cl_std_op_exp10(
1516 Open_cl_std_op_exp10 instruction, std::size_t instruction_start_index) override;
1517 virtual void handle_instruction_open_cl_std_op_expm1(
1518 Open_cl_std_op_expm1 instruction, std::size_t instruction_start_index) override;
1519 virtual void handle_instruction_open_cl_std_op_fabs(
1520 Open_cl_std_op_fabs instruction, std::size_t instruction_start_index) override;
1521 virtual void handle_instruction_open_cl_std_op_fdim(
1522 Open_cl_std_op_fdim instruction, std::size_t instruction_start_index) override;
1523 virtual void handle_instruction_open_cl_std_op_floor(
1524 Open_cl_std_op_floor instruction, std::size_t instruction_start_index) override;
1525 virtual void handle_instruction_open_cl_std_op_fma(
1526 Open_cl_std_op_fma instruction, std::size_t instruction_start_index) override;
1527 virtual void handle_instruction_open_cl_std_op_fmax(
1528 Open_cl_std_op_fmax instruction, std::size_t instruction_start_index) override;
1529 virtual void handle_instruction_open_cl_std_op_fmin(
1530 Open_cl_std_op_fmin instruction, std::size_t instruction_start_index) override;
1531 virtual void handle_instruction_open_cl_std_op_fmod(
1532 Open_cl_std_op_fmod instruction, std::size_t instruction_start_index) override;
1533 virtual void handle_instruction_open_cl_std_op_fract(
1534 Open_cl_std_op_fract instruction, std::size_t instruction_start_index) override;
1535 virtual void handle_instruction_open_cl_std_op_frexp(
1536 Open_cl_std_op_frexp instruction, std::size_t instruction_start_index) override;
1537 virtual void handle_instruction_open_cl_std_op_hypot(
1538 Open_cl_std_op_hypot instruction, std::size_t instruction_start_index) override;
1539 virtual void handle_instruction_open_cl_std_op_ilogb(
1540 Open_cl_std_op_ilogb instruction, std::size_t instruction_start_index) override;
1541 virtual void handle_instruction_open_cl_std_op_ldexp(
1542 Open_cl_std_op_ldexp instruction, std::size_t instruction_start_index) override;
1543 virtual void handle_instruction_open_cl_std_op_lgamma(
1544 Open_cl_std_op_lgamma instruction, std::size_t instruction_start_index) override;
1545 virtual void handle_instruction_open_cl_std_op_lgamma_r(
1546 Open_cl_std_op_lgamma_r instruction, std::size_t instruction_start_index) override;
1547 virtual void handle_instruction_open_cl_std_op_log(
1548 Open_cl_std_op_log instruction, std::size_t instruction_start_index) override;
1549 virtual void handle_instruction_open_cl_std_op_log2(
1550 Open_cl_std_op_log2 instruction, std::size_t instruction_start_index) override;
1551 virtual void handle_instruction_open_cl_std_op_log10(
1552 Open_cl_std_op_log10 instruction, std::size_t instruction_start_index) override;
1553 virtual void handle_instruction_open_cl_std_op_log1p(
1554 Open_cl_std_op_log1p instruction, std::size_t instruction_start_index) override;
1555 virtual void handle_instruction_open_cl_std_op_logb(
1556 Open_cl_std_op_logb instruction, std::size_t instruction_start_index) override;
1557 virtual void handle_instruction_open_cl_std_op_mad(
1558 Open_cl_std_op_mad instruction, std::size_t instruction_start_index) override;
1559 virtual void handle_instruction_open_cl_std_op_maxmag(
1560 Open_cl_std_op_maxmag instruction, std::size_t instruction_start_index) override;
1561 virtual void handle_instruction_open_cl_std_op_minmag(
1562 Open_cl_std_op_minmag instruction, std::size_t instruction_start_index) override;
1563 virtual void handle_instruction_open_cl_std_op_modf(
1564 Open_cl_std_op_modf instruction, std::size_t instruction_start_index) override;
1565 virtual void handle_instruction_open_cl_std_op_nan(
1566 Open_cl_std_op_nan instruction, std::size_t instruction_start_index) override;
1567 virtual void handle_instruction_open_cl_std_op_nextafter(
1568 Open_cl_std_op_nextafter instruction, std::size_t instruction_start_index) override;
1569 virtual void handle_instruction_open_cl_std_op_pow(
1570 Open_cl_std_op_pow instruction, std::size_t instruction_start_index) override;
1571 virtual void handle_instruction_open_cl_std_op_pown(
1572 Open_cl_std_op_pown instruction, std::size_t instruction_start_index) override;
1573 virtual void handle_instruction_open_cl_std_op_powr(
1574 Open_cl_std_op_powr instruction, std::size_t instruction_start_index) override;
1575 virtual void handle_instruction_open_cl_std_op_remainder(
1576 Open_cl_std_op_remainder instruction, std::size_t instruction_start_index) override;
1577 virtual void handle_instruction_open_cl_std_op_remquo(
1578 Open_cl_std_op_remquo instruction, std::size_t instruction_start_index) override;
1579 virtual void handle_instruction_open_cl_std_op_rint(
1580 Open_cl_std_op_rint instruction, std::size_t instruction_start_index) override;
1581 virtual void handle_instruction_open_cl_std_op_rootn(
1582 Open_cl_std_op_rootn instruction, std::size_t instruction_start_index) override;
1583 virtual void handle_instruction_open_cl_std_op_round(
1584 Open_cl_std_op_round instruction, std::size_t instruction_start_index) override;
1585 virtual void handle_instruction_open_cl_std_op_rsqrt(
1586 Open_cl_std_op_rsqrt instruction, std::size_t instruction_start_index) override;
1587 virtual void handle_instruction_open_cl_std_op_sin(
1588 Open_cl_std_op_sin instruction, std::size_t instruction_start_index) override;
1589 virtual void handle_instruction_open_cl_std_op_sincos(
1590 Open_cl_std_op_sincos instruction, std::size_t instruction_start_index) override;
1591 virtual void handle_instruction_open_cl_std_op_sinh(
1592 Open_cl_std_op_sinh instruction, std::size_t instruction_start_index) override;
1593 virtual void handle_instruction_open_cl_std_op_sinpi(
1594 Open_cl_std_op_sinpi instruction, std::size_t instruction_start_index) override;
1595 virtual void handle_instruction_open_cl_std_op_sqrt(
1596 Open_cl_std_op_sqrt instruction, std::size_t instruction_start_index) override;
1597 virtual void handle_instruction_open_cl_std_op_tan(
1598 Open_cl_std_op_tan instruction, std::size_t instruction_start_index) override;
1599 virtual void handle_instruction_open_cl_std_op_tanh(
1600 Open_cl_std_op_tanh instruction, std::size_t instruction_start_index) override;
1601 virtual void handle_instruction_open_cl_std_op_tanpi(
1602 Open_cl_std_op_tanpi instruction, std::size_t instruction_start_index) override;
1603 virtual void handle_instruction_open_cl_std_op_tgamma(
1604 Open_cl_std_op_tgamma instruction, std::size_t instruction_start_index) override;
1605 virtual void handle_instruction_open_cl_std_op_trunc(
1606 Open_cl_std_op_trunc instruction, std::size_t instruction_start_index) override;
1607 virtual void handle_instruction_open_cl_std_op_half_cos(
1608 Open_cl_std_op_half_cos instruction, std::size_t instruction_start_index) override;
1609 virtual void handle_instruction_open_cl_std_op_half_divide(
1610 Open_cl_std_op_half_divide instruction, std::size_t instruction_start_index) override;
1611 virtual void handle_instruction_open_cl_std_op_half_exp(
1612 Open_cl_std_op_half_exp instruction, std::size_t instruction_start_index) override;
1613 virtual void handle_instruction_open_cl_std_op_half_exp2(
1614 Open_cl_std_op_half_exp2 instruction, std::size_t instruction_start_index) override;
1615 virtual void handle_instruction_open_cl_std_op_half_exp10(
1616 Open_cl_std_op_half_exp10 instruction, std::size_t instruction_start_index) override;
1617 virtual void handle_instruction_open_cl_std_op_half_log(
1618 Open_cl_std_op_half_log instruction, std::size_t instruction_start_index) override;
1619 virtual void handle_instruction_open_cl_std_op_half_log2(
1620 Open_cl_std_op_half_log2 instruction, std::size_t instruction_start_index) override;
1621 virtual void handle_instruction_open_cl_std_op_half_log10(
1622 Open_cl_std_op_half_log10 instruction, std::size_t instruction_start_index) override;
1623 virtual void handle_instruction_open_cl_std_op_half_powr(
1624 Open_cl_std_op_half_powr instruction, std::size_t instruction_start_index) override;
1625 virtual void handle_instruction_open_cl_std_op_half_recip(
1626 Open_cl_std_op_half_recip instruction, std::size_t instruction_start_index) override;
1627 virtual void handle_instruction_open_cl_std_op_half_rsqrt(
1628 Open_cl_std_op_half_rsqrt instruction, std::size_t instruction_start_index) override;
1629 virtual void handle_instruction_open_cl_std_op_half_sin(
1630 Open_cl_std_op_half_sin instruction, std::size_t instruction_start_index) override;
1631 virtual void handle_instruction_open_cl_std_op_half_sqrt(
1632 Open_cl_std_op_half_sqrt instruction, std::size_t instruction_start_index) override;
1633 virtual void handle_instruction_open_cl_std_op_half_tan(
1634 Open_cl_std_op_half_tan instruction, std::size_t instruction_start_index) override;
1635 virtual void handle_instruction_open_cl_std_op_native_cos(
1636 Open_cl_std_op_native_cos instruction, std::size_t instruction_start_index) override;
1637 virtual void handle_instruction_open_cl_std_op_native_divide(
1638 Open_cl_std_op_native_divide instruction, std::size_t instruction_start_index) override;
1639 virtual void handle_instruction_open_cl_std_op_native_exp(
1640 Open_cl_std_op_native_exp instruction, std::size_t instruction_start_index) override;
1641 virtual void handle_instruction_open_cl_std_op_native_exp2(
1642 Open_cl_std_op_native_exp2 instruction, std::size_t instruction_start_index) override;
1643 virtual void handle_instruction_open_cl_std_op_native_exp10(
1644 Open_cl_std_op_native_exp10 instruction, std::size_t instruction_start_index) override;
1645 virtual void handle_instruction_open_cl_std_op_native_log(
1646 Open_cl_std_op_native_log instruction, std::size_t instruction_start_index) override;
1647 virtual void handle_instruction_open_cl_std_op_native_log2(
1648 Open_cl_std_op_native_log2 instruction, std::size_t instruction_start_index) override;
1649 virtual void handle_instruction_open_cl_std_op_native_log10(
1650 Open_cl_std_op_native_log10 instruction, std::size_t instruction_start_index) override;
1651 virtual void handle_instruction_open_cl_std_op_native_powr(
1652 Open_cl_std_op_native_powr instruction, std::size_t instruction_start_index) override;
1653 virtual void handle_instruction_open_cl_std_op_native_recip(
1654 Open_cl_std_op_native_recip instruction, std::size_t instruction_start_index) override;
1655 virtual void handle_instruction_open_cl_std_op_native_rsqrt(
1656 Open_cl_std_op_native_rsqrt instruction, std::size_t instruction_start_index) override;
1657 virtual void handle_instruction_open_cl_std_op_native_sin(
1658 Open_cl_std_op_native_sin instruction, std::size_t instruction_start_index) override;
1659 virtual void handle_instruction_open_cl_std_op_native_sqrt(
1660 Open_cl_std_op_native_sqrt instruction, std::size_t instruction_start_index) override;
1661 virtual void handle_instruction_open_cl_std_op_native_tan(
1662 Open_cl_std_op_native_tan instruction, std::size_t instruction_start_index) override;
1663 virtual void handle_instruction_open_cl_std_op_s_abs(
1664 Open_cl_std_op_s_abs instruction, std::size_t instruction_start_index) override;
1665 virtual void handle_instruction_open_cl_std_op_s_abs_diff(
1666 Open_cl_std_op_s_abs_diff instruction, std::size_t instruction_start_index) override;
1667 virtual void handle_instruction_open_cl_std_op_s_add_sat(
1668 Open_cl_std_op_s_add_sat instruction, std::size_t instruction_start_index) override;
1669 virtual void handle_instruction_open_cl_std_op_u_add_sat(
1670 Open_cl_std_op_u_add_sat instruction, std::size_t instruction_start_index) override;
1671 virtual void handle_instruction_open_cl_std_op_s_hadd(
1672 Open_cl_std_op_s_hadd instruction, std::size_t instruction_start_index) override;
1673 virtual void handle_instruction_open_cl_std_op_u_hadd(
1674 Open_cl_std_op_u_hadd instruction, std::size_t instruction_start_index) override;
1675 virtual void handle_instruction_open_cl_std_op_s_rhadd(
1676 Open_cl_std_op_s_rhadd instruction, std::size_t instruction_start_index) override;
1677 virtual void handle_instruction_open_cl_std_op_u_rhadd(
1678 Open_cl_std_op_u_rhadd instruction, std::size_t instruction_start_index) override;
1679 virtual void handle_instruction_open_cl_std_op_s_clamp(
1680 Open_cl_std_op_s_clamp instruction, std::size_t instruction_start_index) override;
1681 virtual void handle_instruction_open_cl_std_op_u_clamp(
1682 Open_cl_std_op_u_clamp instruction, std::size_t instruction_start_index) override;
1683 virtual void handle_instruction_open_cl_std_op_clz(
1684 Open_cl_std_op_clz instruction, std::size_t instruction_start_index) override;
1685 virtual void handle_instruction_open_cl_std_op_ctz(
1686 Open_cl_std_op_ctz instruction, std::size_t instruction_start_index) override;
1687 virtual void handle_instruction_open_cl_std_op_s_mad_hi(
1688 Open_cl_std_op_s_mad_hi instruction, std::size_t instruction_start_index) override;
1689 virtual void handle_instruction_open_cl_std_op_u_mad_sat(
1690 Open_cl_std_op_u_mad_sat instruction, std::size_t instruction_start_index) override;
1691 virtual void handle_instruction_open_cl_std_op_s_mad_sat(
1692 Open_cl_std_op_s_mad_sat instruction, std::size_t instruction_start_index) override;
1693 virtual void handle_instruction_open_cl_std_op_s_max(
1694 Open_cl_std_op_s_max instruction, std::size_t instruction_start_index) override;
1695 virtual void handle_instruction_open_cl_std_op_u_max(
1696 Open_cl_std_op_u_max instruction, std::size_t instruction_start_index) override;
1697 virtual void handle_instruction_open_cl_std_op_s_min(
1698 Open_cl_std_op_s_min instruction, std::size_t instruction_start_index) override;
1699 virtual void handle_instruction_open_cl_std_op_u_min(
1700 Open_cl_std_op_u_min instruction, std::size_t instruction_start_index) override;
1701 virtual void handle_instruction_open_cl_std_op_s_mul_hi(
1702 Open_cl_std_op_s_mul_hi instruction, std::size_t instruction_start_index) override;
1703 virtual void handle_instruction_open_cl_std_op_rotate(
1704 Open_cl_std_op_rotate instruction, std::size_t instruction_start_index) override;
1705 virtual void handle_instruction_open_cl_std_op_s_sub_sat(
1706 Open_cl_std_op_s_sub_sat instruction, std::size_t instruction_start_index) override;
1707 virtual void handle_instruction_open_cl_std_op_u_sub_sat(
1708 Open_cl_std_op_u_sub_sat instruction, std::size_t instruction_start_index) override;
1709 virtual void handle_instruction_open_cl_std_op_u_upsample(
1710 Open_cl_std_op_u_upsample instruction, std::size_t instruction_start_index) override;
1711 virtual void handle_instruction_open_cl_std_op_s_upsample(
1712 Open_cl_std_op_s_upsample instruction, std::size_t instruction_start_index) override;
1713 virtual void handle_instruction_open_cl_std_op_popcount(
1714 Open_cl_std_op_popcount instruction, std::size_t instruction_start_index) override;
1715 virtual void handle_instruction_open_cl_std_op_s_mad24(
1716 Open_cl_std_op_s_mad24 instruction, std::size_t instruction_start_index) override;
1717 virtual void handle_instruction_open_cl_std_op_u_mad24(
1718 Open_cl_std_op_u_mad24 instruction, std::size_t instruction_start_index) override;
1719 virtual void handle_instruction_open_cl_std_op_s_mul24(
1720 Open_cl_std_op_s_mul24 instruction, std::size_t instruction_start_index) override;
1721 virtual void handle_instruction_open_cl_std_op_u_mul24(
1722 Open_cl_std_op_u_mul24 instruction, std::size_t instruction_start_index) override;
1723 virtual void handle_instruction_open_cl_std_op_u_abs(
1724 Open_cl_std_op_u_abs instruction, std::size_t instruction_start_index) override;
1725 virtual void handle_instruction_open_cl_std_op_u_abs_diff(
1726 Open_cl_std_op_u_abs_diff instruction, std::size_t instruction_start_index) override;
1727 virtual void handle_instruction_open_cl_std_op_u_mul_hi(
1728 Open_cl_std_op_u_mul_hi instruction, std::size_t instruction_start_index) override;
1729 virtual void handle_instruction_open_cl_std_op_u_mad_hi(
1730 Open_cl_std_op_u_mad_hi instruction, std::size_t instruction_start_index) override;
1731 virtual void handle_instruction_open_cl_std_op_fclamp(
1732 Open_cl_std_op_fclamp instruction, std::size_t instruction_start_index) override;
1733 virtual void handle_instruction_open_cl_std_op_degrees(
1734 Open_cl_std_op_degrees instruction, std::size_t instruction_start_index) override;
1735 virtual void handle_instruction_open_cl_std_op_fmax_common(
1736 Open_cl_std_op_fmax_common instruction, std::size_t instruction_start_index) override;
1737 virtual void handle_instruction_open_cl_std_op_fmin_common(
1738 Open_cl_std_op_fmin_common instruction, std::size_t instruction_start_index) override;
1739 virtual void handle_instruction_open_cl_std_op_mix(
1740 Open_cl_std_op_mix instruction, std::size_t instruction_start_index) override;
1741 virtual void handle_instruction_open_cl_std_op_radians(
1742 Open_cl_std_op_radians instruction, std::size_t instruction_start_index) override;
1743 virtual void handle_instruction_open_cl_std_op_step(
1744 Open_cl_std_op_step instruction, std::size_t instruction_start_index) override;
1745 virtual void handle_instruction_open_cl_std_op_smoothstep(
1746 Open_cl_std_op_smoothstep instruction, std::size_t instruction_start_index) override;
1747 virtual void handle_instruction_open_cl_std_op_sign(
1748 Open_cl_std_op_sign instruction, std::size_t instruction_start_index) override;
1749 virtual void handle_instruction_open_cl_std_op_cross(
1750 Open_cl_std_op_cross instruction, std::size_t instruction_start_index) override;
1751 virtual void handle_instruction_open_cl_std_op_distance(
1752 Open_cl_std_op_distance instruction, std::size_t instruction_start_index) override;
1753 virtual void handle_instruction_open_cl_std_op_length(
1754 Open_cl_std_op_length instruction, std::size_t instruction_start_index) override;
1755 virtual void handle_instruction_open_cl_std_op_normalize(
1756 Open_cl_std_op_normalize instruction, std::size_t instruction_start_index) override;
1757 virtual void handle_instruction_open_cl_std_op_fast_distance(
1758 Open_cl_std_op_fast_distance instruction, std::size_t instruction_start_index) override;
1759 virtual void handle_instruction_open_cl_std_op_fast_length(
1760 Open_cl_std_op_fast_length instruction, std::size_t instruction_start_index) override;
1761 virtual void handle_instruction_open_cl_std_op_fast_normalize(
1762 Open_cl_std_op_fast_normalize instruction, std::size_t instruction_start_index) override;
1763 virtual void handle_instruction_open_cl_std_op_bitselect(
1764 Open_cl_std_op_bitselect instruction, std::size_t instruction_start_index) override;
1765 virtual void handle_instruction_open_cl_std_op_select(
1766 Open_cl_std_op_select instruction, std::size_t instruction_start_index) override;
1767 virtual void handle_instruction_open_cl_std_op_vloadn(
1768 Open_cl_std_op_vloadn instruction, std::size_t instruction_start_index) override;
1769 virtual void handle_instruction_open_cl_std_op_vstoren(
1770 Open_cl_std_op_vstoren instruction, std::size_t instruction_start_index) override;
1771 virtual void handle_instruction_open_cl_std_op_vload_half(
1772 Open_cl_std_op_vload_half instruction, std::size_t instruction_start_index) override;
1773 virtual void handle_instruction_open_cl_std_op_vload_halfn(
1774 Open_cl_std_op_vload_halfn instruction, std::size_t instruction_start_index) override;
1775 virtual void handle_instruction_open_cl_std_op_vstore_half(
1776 Open_cl_std_op_vstore_half instruction, std::size_t instruction_start_index) override;
1777 virtual void handle_instruction_open_cl_std_op_vstore_half_r(
1778 Open_cl_std_op_vstore_half_r instruction, std::size_t instruction_start_index) override;
1779 virtual void handle_instruction_open_cl_std_op_vstore_halfn(
1780 Open_cl_std_op_vstore_halfn instruction, std::size_t instruction_start_index) override;
1781 virtual void handle_instruction_open_cl_std_op_vstore_halfn_r(
1782 Open_cl_std_op_vstore_halfn_r instruction, std::size_t instruction_start_index) override;
1783 virtual void handle_instruction_open_cl_std_op_vloada_halfn(
1784 Open_cl_std_op_vloada_halfn instruction, std::size_t instruction_start_index) override;
1785 virtual void handle_instruction_open_cl_std_op_vstorea_halfn(
1786 Open_cl_std_op_vstorea_halfn instruction, std::size_t instruction_start_index) override;
1787 virtual void handle_instruction_open_cl_std_op_vstorea_halfn_r(
1788 Open_cl_std_op_vstorea_halfn_r instruction, std::size_t instruction_start_index) override;
1789 virtual void handle_instruction_open_cl_std_op_shuffle(
1790 Open_cl_std_op_shuffle instruction, std::size_t instruction_start_index) override;
1791 virtual void handle_instruction_open_cl_std_op_shuffle2(
1792 Open_cl_std_op_shuffle2 instruction, std::size_t instruction_start_index) override;
1793 virtual void handle_instruction_open_cl_std_op_printf(
1794 Open_cl_std_op_printf instruction, std::size_t instruction_start_index) override;
1795 virtual void handle_instruction_open_cl_std_op_prefetch(
1796 Open_cl_std_op_prefetch instruction, std::size_t instruction_start_index) override;
1797 virtual void handle_instruction_glsl_std_450_op_round(
1798 Glsl_std_450_op_round instruction, std::size_t instruction_start_index) override;
1799 virtual void handle_instruction_glsl_std_450_op_round_even(
1800 Glsl_std_450_op_round_even instruction, std::size_t instruction_start_index) override;
1801 virtual void handle_instruction_glsl_std_450_op_trunc(
1802 Glsl_std_450_op_trunc instruction, std::size_t instruction_start_index) override;
1803 virtual void handle_instruction_glsl_std_450_op_f_abs(
1804 Glsl_std_450_op_f_abs instruction, std::size_t instruction_start_index) override;
1805 virtual void handle_instruction_glsl_std_450_op_s_abs(
1806 Glsl_std_450_op_s_abs instruction, std::size_t instruction_start_index) override;
1807 virtual void handle_instruction_glsl_std_450_op_f_sign(
1808 Glsl_std_450_op_f_sign instruction, std::size_t instruction_start_index) override;
1809 virtual void handle_instruction_glsl_std_450_op_s_sign(
1810 Glsl_std_450_op_s_sign instruction, std::size_t instruction_start_index) override;
1811 virtual void handle_instruction_glsl_std_450_op_floor(
1812 Glsl_std_450_op_floor instruction, std::size_t instruction_start_index) override;
1813 virtual void handle_instruction_glsl_std_450_op_ceil(
1814 Glsl_std_450_op_ceil instruction, std::size_t instruction_start_index) override;
1815 virtual void handle_instruction_glsl_std_450_op_fract(
1816 Glsl_std_450_op_fract instruction, std::size_t instruction_start_index) override;
1817 virtual void handle_instruction_glsl_std_450_op_radians(
1818 Glsl_std_450_op_radians instruction, std::size_t instruction_start_index) override;
1819 virtual void handle_instruction_glsl_std_450_op_degrees(
1820 Glsl_std_450_op_degrees instruction, std::size_t instruction_start_index) override;
1821 virtual void handle_instruction_glsl_std_450_op_sin(
1822 Glsl_std_450_op_sin instruction, std::size_t instruction_start_index) override;
1823 virtual void handle_instruction_glsl_std_450_op_cos(
1824 Glsl_std_450_op_cos instruction, std::size_t instruction_start_index) override;
1825 virtual void handle_instruction_glsl_std_450_op_tan(
1826 Glsl_std_450_op_tan instruction, std::size_t instruction_start_index) override;
1827 virtual void handle_instruction_glsl_std_450_op_asin(
1828 Glsl_std_450_op_asin instruction, std::size_t instruction_start_index) override;
1829 virtual void handle_instruction_glsl_std_450_op_acos(
1830 Glsl_std_450_op_acos instruction, std::size_t instruction_start_index) override;
1831 virtual void handle_instruction_glsl_std_450_op_atan(
1832 Glsl_std_450_op_atan instruction, std::size_t instruction_start_index) override;
1833 virtual void handle_instruction_glsl_std_450_op_sinh(
1834 Glsl_std_450_op_sinh instruction, std::size_t instruction_start_index) override;
1835 virtual void handle_instruction_glsl_std_450_op_cosh(
1836 Glsl_std_450_op_cosh instruction, std::size_t instruction_start_index) override;
1837 virtual void handle_instruction_glsl_std_450_op_tanh(
1838 Glsl_std_450_op_tanh instruction, std::size_t instruction_start_index) override;
1839 virtual void handle_instruction_glsl_std_450_op_asinh(
1840 Glsl_std_450_op_asinh instruction, std::size_t instruction_start_index) override;
1841 virtual void handle_instruction_glsl_std_450_op_acosh(
1842 Glsl_std_450_op_acosh instruction, std::size_t instruction_start_index) override;
1843 virtual void handle_instruction_glsl_std_450_op_atanh(
1844 Glsl_std_450_op_atanh instruction, std::size_t instruction_start_index) override;
1845 virtual void handle_instruction_glsl_std_450_op_atan2(
1846 Glsl_std_450_op_atan2 instruction, std::size_t instruction_start_index) override;
1847 virtual void handle_instruction_glsl_std_450_op_pow(
1848 Glsl_std_450_op_pow instruction, std::size_t instruction_start_index) override;
1849 virtual void handle_instruction_glsl_std_450_op_exp(
1850 Glsl_std_450_op_exp instruction, std::size_t instruction_start_index) override;
1851 virtual void handle_instruction_glsl_std_450_op_log(
1852 Glsl_std_450_op_log instruction, std::size_t instruction_start_index) override;
1853 virtual void handle_instruction_glsl_std_450_op_exp2(
1854 Glsl_std_450_op_exp2 instruction, std::size_t instruction_start_index) override;
1855 virtual void handle_instruction_glsl_std_450_op_log2(
1856 Glsl_std_450_op_log2 instruction, std::size_t instruction_start_index) override;
1857 virtual void handle_instruction_glsl_std_450_op_sqrt(
1858 Glsl_std_450_op_sqrt instruction, std::size_t instruction_start_index) override;
1859 virtual void handle_instruction_glsl_std_450_op_inverse_sqrt(
1860 Glsl_std_450_op_inverse_sqrt instruction, std::size_t instruction_start_index) override;
1861 virtual void handle_instruction_glsl_std_450_op_determinant(
1862 Glsl_std_450_op_determinant instruction, std::size_t instruction_start_index) override;
1863 virtual void handle_instruction_glsl_std_450_op_matrix_inverse(
1864 Glsl_std_450_op_matrix_inverse instruction, std::size_t instruction_start_index) override;
1865 virtual void handle_instruction_glsl_std_450_op_modf(
1866 Glsl_std_450_op_modf instruction, std::size_t instruction_start_index) override;
1867 virtual void handle_instruction_glsl_std_450_op_modf_struct(
1868 Glsl_std_450_op_modf_struct instruction, std::size_t instruction_start_index) override;
1869 virtual void handle_instruction_glsl_std_450_op_f_min(
1870 Glsl_std_450_op_f_min instruction, std::size_t instruction_start_index) override;
1871 virtual void handle_instruction_glsl_std_450_op_u_min(
1872 Glsl_std_450_op_u_min instruction, std::size_t instruction_start_index) override;
1873 virtual void handle_instruction_glsl_std_450_op_s_min(
1874 Glsl_std_450_op_s_min instruction, std::size_t instruction_start_index) override;
1875 virtual void handle_instruction_glsl_std_450_op_f_max(
1876 Glsl_std_450_op_f_max instruction, std::size_t instruction_start_index) override;
1877 virtual void handle_instruction_glsl_std_450_op_u_max(
1878 Glsl_std_450_op_u_max instruction, std::size_t instruction_start_index) override;
1879 virtual void handle_instruction_glsl_std_450_op_s_max(
1880 Glsl_std_450_op_s_max instruction, std::size_t instruction_start_index) override;
1881 virtual void handle_instruction_glsl_std_450_op_f_clamp(
1882 Glsl_std_450_op_f_clamp instruction, std::size_t instruction_start_index) override;
1883 virtual void handle_instruction_glsl_std_450_op_u_clamp(
1884 Glsl_std_450_op_u_clamp instruction, std::size_t instruction_start_index) override;
1885 virtual void handle_instruction_glsl_std_450_op_s_clamp(
1886 Glsl_std_450_op_s_clamp instruction, std::size_t instruction_start_index) override;
1887 virtual void handle_instruction_glsl_std_450_op_f_mix(
1888 Glsl_std_450_op_f_mix instruction, std::size_t instruction_start_index) override;
1889 virtual void handle_instruction_glsl_std_450_op_i_mix(
1890 Glsl_std_450_op_i_mix instruction, std::size_t instruction_start_index) override;
1891 virtual void handle_instruction_glsl_std_450_op_step(
1892 Glsl_std_450_op_step instruction, std::size_t instruction_start_index) override;
1893 virtual void handle_instruction_glsl_std_450_op_smooth_step(
1894 Glsl_std_450_op_smooth_step instruction, std::size_t instruction_start_index) override;
1895 virtual void handle_instruction_glsl_std_450_op_fma(
1896 Glsl_std_450_op_fma instruction, std::size_t instruction_start_index) override;
1897 virtual void handle_instruction_glsl_std_450_op_frexp(
1898 Glsl_std_450_op_frexp instruction, std::size_t instruction_start_index) override;
1899 virtual void handle_instruction_glsl_std_450_op_frexp_struct(
1900 Glsl_std_450_op_frexp_struct instruction, std::size_t instruction_start_index) override;
1901 virtual void handle_instruction_glsl_std_450_op_ldexp(
1902 Glsl_std_450_op_ldexp instruction, std::size_t instruction_start_index) override;
1903 virtual void handle_instruction_glsl_std_450_op_pack_snorm4x8(
1904 Glsl_std_450_op_pack_snorm4x8 instruction, std::size_t instruction_start_index) override;
1905 virtual void handle_instruction_glsl_std_450_op_pack_unorm4x8(
1906 Glsl_std_450_op_pack_unorm4x8 instruction, std::size_t instruction_start_index) override;
1907 virtual void handle_instruction_glsl_std_450_op_pack_snorm2x16(
1908 Glsl_std_450_op_pack_snorm2x16 instruction, std::size_t instruction_start_index) override;
1909 virtual void handle_instruction_glsl_std_450_op_pack_unorm2x16(
1910 Glsl_std_450_op_pack_unorm2x16 instruction, std::size_t instruction_start_index) override;
1911 virtual void handle_instruction_glsl_std_450_op_pack_half2x16(
1912 Glsl_std_450_op_pack_half2x16 instruction, std::size_t instruction_start_index) override;
1913 virtual void handle_instruction_glsl_std_450_op_pack_double2x32(
1914 Glsl_std_450_op_pack_double2x32 instruction, std::size_t instruction_start_index) override;
1915 virtual void handle_instruction_glsl_std_450_op_unpack_snorm2x16(
1916 Glsl_std_450_op_unpack_snorm2x16 instruction, std::size_t instruction_start_index) override;
1917 virtual void handle_instruction_glsl_std_450_op_unpack_unorm2x16(
1918 Glsl_std_450_op_unpack_unorm2x16 instruction, std::size_t instruction_start_index) override;
1919 virtual void handle_instruction_glsl_std_450_op_unpack_half2x16(
1920 Glsl_std_450_op_unpack_half2x16 instruction, std::size_t instruction_start_index) override;
1921 virtual void handle_instruction_glsl_std_450_op_unpack_snorm4x8(
1922 Glsl_std_450_op_unpack_snorm4x8 instruction, std::size_t instruction_start_index) override;
1923 virtual void handle_instruction_glsl_std_450_op_unpack_unorm4x8(
1924 Glsl_std_450_op_unpack_unorm4x8 instruction, std::size_t instruction_start_index) override;
1925 virtual void handle_instruction_glsl_std_450_op_unpack_double2x32(
1926 Glsl_std_450_op_unpack_double2x32 instruction,
1927 std::size_t instruction_start_index) override;
1928 virtual void handle_instruction_glsl_std_450_op_length(
1929 Glsl_std_450_op_length instruction, std::size_t instruction_start_index) override;
1930 virtual void handle_instruction_glsl_std_450_op_distance(
1931 Glsl_std_450_op_distance instruction, std::size_t instruction_start_index) override;
1932 virtual void handle_instruction_glsl_std_450_op_cross(
1933 Glsl_std_450_op_cross instruction, std::size_t instruction_start_index) override;
1934 virtual void handle_instruction_glsl_std_450_op_normalize(
1935 Glsl_std_450_op_normalize instruction, std::size_t instruction_start_index) override;
1936 virtual void handle_instruction_glsl_std_450_op_face_forward(
1937 Glsl_std_450_op_face_forward instruction, std::size_t instruction_start_index) override;
1938 virtual void handle_instruction_glsl_std_450_op_reflect(
1939 Glsl_std_450_op_reflect instruction, std::size_t instruction_start_index) override;
1940 virtual void handle_instruction_glsl_std_450_op_refract(
1941 Glsl_std_450_op_refract instruction, std::size_t instruction_start_index) override;
1942 virtual void handle_instruction_glsl_std_450_op_find_i_lsb(
1943 Glsl_std_450_op_find_i_lsb instruction, std::size_t instruction_start_index) override;
1944 virtual void handle_instruction_glsl_std_450_op_find_s_msb(
1945 Glsl_std_450_op_find_s_msb instruction, std::size_t instruction_start_index) override;
1946 virtual void handle_instruction_glsl_std_450_op_find_u_msb(
1947 Glsl_std_450_op_find_u_msb instruction, std::size_t instruction_start_index) override;
1948 virtual void handle_instruction_glsl_std_450_op_interpolate_at_centroid(
1949 Glsl_std_450_op_interpolate_at_centroid instruction,
1950 std::size_t instruction_start_index) override;
1951 virtual void handle_instruction_glsl_std_450_op_interpolate_at_sample(
1952 Glsl_std_450_op_interpolate_at_sample instruction,
1953 std::size_t instruction_start_index) override;
1954 virtual void handle_instruction_glsl_std_450_op_interpolate_at_offset(
1955 Glsl_std_450_op_interpolate_at_offset instruction,
1956 std::size_t instruction_start_index) override;
1957 virtual void handle_instruction_glsl_std_450_op_n_min(
1958 Glsl_std_450_op_n_min instruction, std::size_t instruction_start_index) override;
1959 virtual void handle_instruction_glsl_std_450_op_n_max(
1960 Glsl_std_450_op_n_max instruction, std::size_t instruction_start_index) override;
1961 virtual void handle_instruction_glsl_std_450_op_n_clamp(
1962 Glsl_std_450_op_n_clamp instruction, std::size_t instruction_start_index) override;
1963 };
1964
1965 void Spirv_to_llvm::handle_header(unsigned version_number_major,
1966 unsigned version_number_minor,
1967 Word generator_magic_number,
1968 Word id_bound,
1969 [[gnu::unused]] Word instruction_schema)
1970 {
1971 if(stage == util::Enum_traits<Stage>::values[0])
1972 {
1973 input_version_number_major = version_number_major;
1974 input_version_number_minor = version_number_minor;
1975 input_generator_magic_number = generator_magic_number;
1976 id_states.resize(id_bound - 1);
1977 }
1978 }
1979
1980 void Spirv_to_llvm::handle_instruction_op_nop([[gnu::unused]] Op_nop instruction,
1981 [[gnu::unused]] std::size_t instruction_start_index)
1982 {
1983 }
1984
1985 void Spirv_to_llvm::handle_instruction_op_undef(Op_undef instruction,
1986 std::size_t instruction_start_index)
1987 {
1988 #warning finish
1989 throw Parser_error(instruction_start_index,
1990 instruction_start_index,
1991 "instruction not implemented: "
1992 + std::string(get_enumerant_name(instruction.get_operation())));
1993 }
1994
1995 void Spirv_to_llvm::handle_instruction_op_source_continued(
1996 [[gnu::unused]] Op_source_continued instruction,
1997 [[gnu::unused]] std::size_t instruction_start_index)
1998 {
1999 }
2000
2001 void Spirv_to_llvm::handle_instruction_op_source(
2002 Op_source instruction, [[gnu::unused]] std::size_t instruction_start_index)
2003 {
2004 if(stage == util::Enum_traits<Stage>::values[0] && instruction.file)
2005 {
2006 std::string filename(
2007 get_id_state(*instruction.file).op_string.value_or(Op_string_state()).value);
2008 ::LLVMSetModuleIdentifier(module.get(), filename.data(), filename.size());
2009 }
2010 }
2011
2012 void Spirv_to_llvm::handle_instruction_op_source_extension(
2013 [[gnu::unused]] Op_source_extension instruction,
2014 [[gnu::unused]] std::size_t instruction_start_index)
2015 {
2016 }
2017
2018 void Spirv_to_llvm::handle_instruction_op_name(Op_name instruction,
2019 [[gnu::unused]] std::size_t instruction_start_index)
2020 {
2021 if(stage == util::Enum_traits<Stage>::values[0])
2022 get_id_state(instruction.target).name = Name{std::string(instruction.name)};
2023 }
2024
2025 void Spirv_to_llvm::handle_instruction_op_member_name(
2026 Op_member_name instruction, [[gnu::unused]] std::size_t instruction_start_index)
2027 {
2028 if(stage == util::Enum_traits<Stage>::values[0])
2029 {
2030 auto &state = get_id_state(instruction.type);
2031 state.member_names.push_back(std::move(instruction));
2032 }
2033 }
2034
2035 void Spirv_to_llvm::handle_instruction_op_string(
2036 Op_string instruction, [[gnu::unused]] std::size_t instruction_start_index)
2037 {
2038 if(stage == util::Enum_traits<Stage>::values[0])
2039 get_id_state(instruction.result).op_string = Op_string_state{instruction.string};
2040 }
2041
2042 void Spirv_to_llvm::handle_instruction_op_line(Op_line instruction,
2043 std::size_t instruction_start_index)
2044 {
2045 #warning finish
2046 throw Parser_error(instruction_start_index,
2047 instruction_start_index,
2048 "instruction not implemented: "
2049 + std::string(get_enumerant_name(instruction.get_operation())));
2050 }
2051
2052 void Spirv_to_llvm::handle_instruction_op_extension(Op_extension instruction,
2053 std::size_t instruction_start_index)
2054 {
2055 #warning finish
2056 throw Parser_error(instruction_start_index,
2057 instruction_start_index,
2058 "instruction not implemented: "
2059 + std::string(get_enumerant_name(instruction.get_operation())));
2060 }
2061
2062 void Spirv_to_llvm::handle_instruction_op_ext_inst_import(Op_ext_inst_import instruction,
2063 std::size_t instruction_start_index)
2064 {
2065 if(stage == util::Enum_traits<Stage>::values[0])
2066 {
2067 get_id_state(instruction.result).op_ext_inst_import = Op_ext_inst_import_state{};
2068 for(auto instruction_set : util::Enum_traits<Extension_instruction_set>::values)
2069 {
2070 if(instruction_set == Extension_instruction_set::unknown)
2071 continue;
2072 if(instruction.name == get_enumerant_name(instruction_set))
2073 return;
2074 }
2075 throw Parser_error(instruction_start_index,
2076 instruction_start_index,
2077 "unknown instruction set: \"" + std::string(instruction.name) + "\"");
2078 }
2079 }
2080
2081 void Spirv_to_llvm::handle_instruction_op_ext_inst(Op_ext_inst instruction,
2082 std::size_t instruction_start_index)
2083 {
2084 #warning finish
2085 throw Parser_error(instruction_start_index,
2086 instruction_start_index,
2087 "instruction not implemented: "
2088 + std::string(get_enumerant_name(instruction.get_operation())));
2089 }
2090
2091 void Spirv_to_llvm::handle_instruction_op_memory_model(Op_memory_model instruction,
2092 std::size_t instruction_start_index)
2093 {
2094 if(instruction.addressing_model != Addressing_model::logical)
2095 throw Parser_error(instruction_start_index,
2096 instruction_start_index,
2097 "unsupported addressing model: "
2098 + std::string(get_enumerant_name(instruction.addressing_model)));
2099 switch(instruction.memory_model)
2100 {
2101 case Memory_model::simple:
2102 case Memory_model::glsl450:
2103 break;
2104 default:
2105 throw Parser_error(instruction_start_index,
2106 instruction_start_index,
2107 "unsupported memory model: "
2108 + std::string(get_enumerant_name(instruction.memory_model)));
2109 }
2110 }
2111
2112 void Spirv_to_llvm::handle_instruction_op_entry_point(Op_entry_point instruction,
2113 std::size_t instruction_start_index)
2114 {
2115 if(stage == util::Enum_traits<Stage>::values[0])
2116 {
2117 auto &state = get_id_state(instruction.entry_point);
2118 state.op_entry_points.push_back(
2119 Op_entry_point_state{std::move(instruction), instruction_start_index});
2120 }
2121 }
2122
2123 void Spirv_to_llvm::handle_instruction_op_execution_mode(Op_execution_mode instruction,
2124 std::size_t instruction_start_index)
2125 {
2126 if(stage == util::Enum_traits<Stage>::values[0])
2127 {
2128 auto &state = get_id_state(instruction.entry_point);
2129 if(state.op_entry_points.empty())
2130 throw Parser_error(instruction_start_index,
2131 instruction_start_index,
2132 "entry point not defined in OpExecutionMode");
2133 if(state.op_entry_points.back().execution_mode)
2134 throw Parser_error(
2135 instruction_start_index, instruction_start_index, "execution mode already set");
2136 state.op_entry_points.back().execution_mode = std::move(instruction.mode);
2137 }
2138 }
2139
2140 void Spirv_to_llvm::handle_instruction_op_capability(Op_capability instruction,
2141 std::size_t instruction_start_index)
2142 {
2143 if(stage == util::Enum_traits<Stage>::values[0])
2144 {
2145 util::Enum_set<Capability> work_list{instruction.capability};
2146 while(!work_list.empty())
2147 {
2148 auto capability = *work_list.begin();
2149 work_list.erase(capability);
2150 if(std::get<1>(enabled_capabilities.insert(capability)))
2151 {
2152 auto additional_capabilities = get_directly_required_capabilities(capability);
2153 work_list.insert(additional_capabilities.begin(), additional_capabilities.end());
2154 }
2155 }
2156 constexpr util::Enum_set<Capability> implemented_capabilities{
2157 Capability::matrix,
2158 Capability::shader,
2159 Capability::input_attachment,
2160 Capability::sampled1d,
2161 Capability::image1d,
2162 Capability::sampled_buffer,
2163 Capability::image_buffer,
2164 Capability::image_query,
2165 Capability::derivative_control,
2166 Capability::int64,
2167 };
2168 for(auto capability : enabled_capabilities)
2169 {
2170 if(implemented_capabilities.count(capability) == 0)
2171 throw Parser_error(
2172 instruction_start_index,
2173 instruction_start_index,
2174 "capability not implemented: " + std::string(get_enumerant_name(capability)));
2175 }
2176 }
2177 }
2178
2179 void Spirv_to_llvm::handle_instruction_op_type_void(
2180 Op_type_void instruction, [[gnu::unused]] std::size_t instruction_start_index)
2181 {
2182 switch(stage)
2183 {
2184 case Stage::calculate_types:
2185 {
2186 auto &state = get_id_state(instruction.result);
2187 if(!state.decorations.empty())
2188 throw Parser_error(instruction_start_index,
2189 instruction_start_index,
2190 "decorations on instruction not implemented: "
2191 + std::string(get_enumerant_name(instruction.get_operation())));
2192 state.type = std::make_shared<Simple_type_descriptor>(
2193 state.decorations, LLVM_type_and_alignment(::LLVMVoidTypeInContext(context), 1));
2194 break;
2195 }
2196 case Stage::generate_code:
2197 break;
2198 }
2199 }
2200
2201 void Spirv_to_llvm::handle_instruction_op_type_bool(Op_type_bool instruction,
2202 std::size_t instruction_start_index)
2203 {
2204 #warning finish
2205 throw Parser_error(instruction_start_index,
2206 instruction_start_index,
2207 "instruction not implemented: "
2208 + std::string(get_enumerant_name(instruction.get_operation())));
2209 }
2210
2211 void Spirv_to_llvm::handle_instruction_op_type_int(Op_type_int instruction,
2212 std::size_t instruction_start_index)
2213 {
2214 switch(stage)
2215 {
2216 case Stage::calculate_types:
2217 {
2218 auto &state = get_id_state(instruction.result);
2219 if(!state.decorations.empty())
2220 throw Parser_error(instruction_start_index,
2221 instruction_start_index,
2222 "decorations on instruction not implemented: "
2223 + std::string(get_enumerant_name(instruction.get_operation())));
2224 switch(instruction.width)
2225 {
2226 case 8:
2227 case 16:
2228 case 32:
2229 case 64:
2230 {
2231 auto type = ::LLVMIntTypeInContext(context, instruction.width);
2232 state.type = std::make_shared<Simple_type_descriptor>(
2233 state.decorations,
2234 LLVM_type_and_alignment(type, ::LLVMPreferredAlignmentOfType(target_data, type)));
2235 break;
2236 }
2237 default:
2238 throw Parser_error(
2239 instruction_start_index, instruction_start_index, "invalid int width");
2240 }
2241 break;
2242 }
2243 case Stage::generate_code:
2244 break;
2245 }
2246 }
2247
2248 void Spirv_to_llvm::handle_instruction_op_type_float(Op_type_float instruction,
2249 std::size_t instruction_start_index)
2250 {
2251 switch(stage)
2252 {
2253 case Stage::calculate_types:
2254 {
2255 auto &state = get_id_state(instruction.result);
2256 if(!state.decorations.empty())
2257 throw Parser_error(instruction_start_index,
2258 instruction_start_index,
2259 "decorations on instruction not implemented: "
2260 + std::string(get_enumerant_name(instruction.get_operation())));
2261 ::LLVMTypeRef type = nullptr;
2262 switch(instruction.width)
2263 {
2264 case 16:
2265 type = ::LLVMHalfTypeInContext(context);
2266 break;
2267 case 32:
2268 type = ::LLVMFloatTypeInContext(context);
2269 break;
2270 case 64:
2271 type = ::LLVMDoubleTypeInContext(context);
2272 break;
2273 default:
2274 throw Parser_error(
2275 instruction_start_index, instruction_start_index, "invalid float width");
2276 }
2277 state.type = std::make_shared<Simple_type_descriptor>(
2278 state.decorations,
2279 LLVM_type_and_alignment(type, ::LLVMPreferredAlignmentOfType(target_data, type)));
2280 break;
2281 }
2282 case Stage::generate_code:
2283 break;
2284 }
2285 }
2286
2287 void Spirv_to_llvm::handle_instruction_op_type_vector(Op_type_vector instruction,
2288 std::size_t instruction_start_index)
2289 {
2290 switch(stage)
2291 {
2292 case Stage::calculate_types:
2293 {
2294 auto &state = get_id_state(instruction.result);
2295 if(!state.decorations.empty())
2296 throw Parser_error(instruction_start_index,
2297 instruction_start_index,
2298 "decorations on instruction not implemented: "
2299 + std::string(get_enumerant_name(instruction.get_operation())));
2300 state.type = std::make_shared<Vector_type_descriptor>(
2301 state.decorations,
2302 get_type<Simple_type_descriptor>(instruction.component_type, instruction_start_index),
2303 instruction.component_count,
2304 target_data);
2305 break;
2306 }
2307 case Stage::generate_code:
2308 break;
2309 }
2310 }
2311
2312 void Spirv_to_llvm::handle_instruction_op_type_matrix(Op_type_matrix instruction,
2313 std::size_t instruction_start_index)
2314 {
2315 switch(stage)
2316 {
2317 case Stage::calculate_types:
2318 {
2319 auto &state = get_id_state(instruction.result);
2320 if(!state.decorations.empty())
2321 throw Parser_error(instruction_start_index,
2322 instruction_start_index,
2323 "decorations on instruction not implemented: "
2324 + std::string(get_enumerant_name(instruction.get_operation())));
2325 state.type = std::make_shared<Matrix_type_descriptor>(
2326 state.decorations,
2327 get_type<Vector_type_descriptor>(instruction.column_type, instruction_start_index),
2328 instruction.column_count,
2329 target_data);
2330 break;
2331 }
2332 case Stage::generate_code:
2333 break;
2334 }
2335 }
2336
2337 void Spirv_to_llvm::handle_instruction_op_type_image(Op_type_image instruction,
2338 std::size_t instruction_start_index)
2339 {
2340 #warning finish
2341 throw Parser_error(instruction_start_index,
2342 instruction_start_index,
2343 "instruction not implemented: "
2344 + std::string(get_enumerant_name(instruction.get_operation())));
2345 }
2346
2347 void Spirv_to_llvm::handle_instruction_op_type_sampler(Op_type_sampler instruction,
2348 std::size_t instruction_start_index)
2349 {
2350 #warning finish
2351 throw Parser_error(instruction_start_index,
2352 instruction_start_index,
2353 "instruction not implemented: "
2354 + std::string(get_enumerant_name(instruction.get_operation())));
2355 }
2356
2357 void Spirv_to_llvm::handle_instruction_op_type_sampled_image(Op_type_sampled_image instruction,
2358 std::size_t instruction_start_index)
2359 {
2360 #warning finish
2361 throw Parser_error(instruction_start_index,
2362 instruction_start_index,
2363 "instruction not implemented: "
2364 + std::string(get_enumerant_name(instruction.get_operation())));
2365 }
2366
2367 void Spirv_to_llvm::handle_instruction_op_type_array(Op_type_array instruction,
2368 std::size_t instruction_start_index)
2369 {
2370 switch(stage)
2371 {
2372 case Stage::calculate_types:
2373 {
2374 auto &state = get_id_state(instruction.result);
2375 if(!state.decorations.empty())
2376 throw Parser_error(instruction_start_index,
2377 instruction_start_index,
2378 "decorations on instruction not implemented: "
2379 + std::string(get_enumerant_name(instruction.get_operation())));
2380 auto length = get_unsigned_integer_constant(instruction.length, instruction_start_index);
2381 if(length <= 0)
2382 throw Parser_error(instruction_start_index,
2383 instruction_start_index,
2384 "OpTypeArray length must be a positive constant integer");
2385 state.type = std::make_shared<Array_type_descriptor>(
2386 state.decorations,
2387 get_type(instruction.element_type, instruction_start_index),
2388 length,
2389 instruction_start_index);
2390 break;
2391 }
2392 case Stage::generate_code:
2393 break;
2394 }
2395 }
2396
2397 void Spirv_to_llvm::handle_instruction_op_type_runtime_array(Op_type_runtime_array instruction,
2398 std::size_t instruction_start_index)
2399 {
2400 #warning finish
2401 throw Parser_error(instruction_start_index,
2402 instruction_start_index,
2403 "instruction not implemented: "
2404 + std::string(get_enumerant_name(instruction.get_operation())));
2405 }
2406
2407 void Spirv_to_llvm::handle_instruction_op_type_struct(Op_type_struct instruction,
2408 std::size_t instruction_start_index)
2409 {
2410 switch(stage)
2411 {
2412 case Stage::calculate_types:
2413 {
2414 auto &state = get_id_state(instruction.result);
2415 std::vector<Struct_type_descriptor::Member> members;
2416 members.reserve(instruction.member_0_type_member_1_type.size());
2417 for(auto &member_id : instruction.member_0_type_member_1_type)
2418 members.push_back(
2419 Struct_type_descriptor::Member({}, get_type(member_id, instruction_start_index)));
2420 for(auto &decoration : state.member_decorations)
2421 {
2422 if(decoration.member >= members.size())
2423 throw Parser_error(instruction_start_index,
2424 instruction_start_index,
2425 "member decoration's member index is out of range");
2426 auto &member = members[decoration.member];
2427 member.decorations.push_back(decoration.decoration);
2428 }
2429 state.type = std::make_shared<Struct_type_descriptor>(
2430 state.decorations,
2431 context,
2432 ::LLVMGetModuleDataLayout(module.get()),
2433 get_prefixed_name(get_name(instruction.result)).c_str(),
2434 instruction_start_index,
2435 std::move(members));
2436 break;
2437 }
2438 case Stage::generate_code:
2439 break;
2440 }
2441 }
2442
2443 void Spirv_to_llvm::handle_instruction_op_type_opaque(Op_type_opaque instruction,
2444 std::size_t instruction_start_index)
2445 {
2446 #warning finish
2447 throw Parser_error(instruction_start_index,
2448 instruction_start_index,
2449 "instruction not implemented: "
2450 + std::string(get_enumerant_name(instruction.get_operation())));
2451 }
2452
2453 void Spirv_to_llvm::handle_instruction_op_type_pointer(Op_type_pointer instruction,
2454 std::size_t instruction_start_index)
2455 {
2456 switch(stage)
2457 {
2458 case Stage::calculate_types:
2459 {
2460 auto &state = get_id_state(instruction.result);
2461 if(!state.decorations.empty())
2462 throw Parser_error(instruction_start_index,
2463 instruction_start_index,
2464 "decorations on instruction not implemented: "
2465 + std::string(get_enumerant_name(instruction.get_operation())));
2466 if(!state.type)
2467 {
2468 state.type = std::make_shared<Pointer_type_descriptor>(
2469 state.decorations,
2470 get_type(instruction.type, instruction_start_index),
2471 instruction_start_index,
2472 target_data);
2473 }
2474 else if(auto *pointer_type = dynamic_cast<Pointer_type_descriptor *>(state.type.get()))
2475 {
2476 if(pointer_type->get_base_type())
2477 throw Parser_error(instruction_start_index,
2478 instruction_start_index,
2479 "result type is not a pointer forward declaration");
2480 pointer_type->set_base_type(get_type(instruction.type, instruction_start_index));
2481 }
2482 else
2483 {
2484 throw Parser_error(instruction_start_index,
2485 instruction_start_index,
2486 "result type is not a pointer forward declaration");
2487 }
2488 break;
2489 }
2490 case Stage::generate_code:
2491 break;
2492 }
2493 }
2494
2495 void Spirv_to_llvm::handle_instruction_op_type_function(Op_type_function instruction,
2496 std::size_t instruction_start_index)
2497 {
2498 switch(stage)
2499 {
2500 case Stage::calculate_types:
2501 {
2502 std::vector<std::shared_ptr<Type_descriptor>> args;
2503 args.reserve(implicit_function_arguments.size()
2504 + instruction.parameter_0_type_parameter_1_type.size());
2505 for(auto &arg : implicit_function_arguments)
2506 args.push_back(arg);
2507 for(Id_ref type : instruction.parameter_0_type_parameter_1_type)
2508 args.push_back(get_type(type, instruction_start_index));
2509 auto &state = get_id_state(instruction.result);
2510 if(!state.decorations.empty())
2511 throw Parser_error(instruction_start_index,
2512 instruction_start_index,
2513 "decorations on instruction not implemented: "
2514 + std::string(get_enumerant_name(instruction.get_operation())));
2515 state.type = std::make_shared<Function_type_descriptor>(
2516 state.decorations,
2517 get_type(instruction.return_type, instruction_start_index),
2518 std::move(args),
2519 instruction_start_index,
2520 target_data);
2521 break;
2522 }
2523 case Stage::generate_code:
2524 break;
2525 }
2526 }
2527
2528 void Spirv_to_llvm::handle_instruction_op_type_event(Op_type_event instruction,
2529 std::size_t instruction_start_index)
2530 {
2531 #warning finish
2532 throw Parser_error(instruction_start_index,
2533 instruction_start_index,
2534 "instruction not implemented: "
2535 + std::string(get_enumerant_name(instruction.get_operation())));
2536 }
2537
2538 void Spirv_to_llvm::handle_instruction_op_type_device_event(Op_type_device_event instruction,
2539 std::size_t instruction_start_index)
2540 {
2541 #warning finish
2542 throw Parser_error(instruction_start_index,
2543 instruction_start_index,
2544 "instruction not implemented: "
2545 + std::string(get_enumerant_name(instruction.get_operation())));
2546 }
2547
2548 void Spirv_to_llvm::handle_instruction_op_type_reserve_id(Op_type_reserve_id instruction,
2549 std::size_t instruction_start_index)
2550 {
2551 #warning finish
2552 throw Parser_error(instruction_start_index,
2553 instruction_start_index,
2554 "instruction not implemented: "
2555 + std::string(get_enumerant_name(instruction.get_operation())));
2556 }
2557
2558 void Spirv_to_llvm::handle_instruction_op_type_queue(Op_type_queue instruction,
2559 std::size_t instruction_start_index)
2560 {
2561 #warning finish
2562 throw Parser_error(instruction_start_index,
2563 instruction_start_index,
2564 "instruction not implemented: "
2565 + std::string(get_enumerant_name(instruction.get_operation())));
2566 }
2567
2568 void Spirv_to_llvm::handle_instruction_op_type_pipe(Op_type_pipe instruction,
2569 std::size_t instruction_start_index)
2570 {
2571 #warning finish
2572 throw Parser_error(instruction_start_index,
2573 instruction_start_index,
2574 "instruction not implemented: "
2575 + std::string(get_enumerant_name(instruction.get_operation())));
2576 }
2577
2578 void Spirv_to_llvm::handle_instruction_op_type_forward_pointer(Op_type_forward_pointer instruction,
2579 std::size_t instruction_start_index)
2580 {
2581 #warning finish
2582 throw Parser_error(instruction_start_index,
2583 instruction_start_index,
2584 "instruction not implemented: "
2585 + std::string(get_enumerant_name(instruction.get_operation())));
2586 }
2587
2588 void Spirv_to_llvm::handle_instruction_op_constant_true(Op_constant_true instruction,
2589 std::size_t instruction_start_index)
2590 {
2591 #warning finish
2592 throw Parser_error(instruction_start_index,
2593 instruction_start_index,
2594 "instruction not implemented: "
2595 + std::string(get_enumerant_name(instruction.get_operation())));
2596 }
2597
2598 void Spirv_to_llvm::handle_instruction_op_constant_false(Op_constant_false instruction,
2599 std::size_t instruction_start_index)
2600 {
2601 #warning finish
2602 throw Parser_error(instruction_start_index,
2603 instruction_start_index,
2604 "instruction not implemented: "
2605 + std::string(get_enumerant_name(instruction.get_operation())));
2606 }
2607
2608 void Spirv_to_llvm::handle_instruction_op_constant(Op_constant instruction,
2609 std::size_t instruction_start_index)
2610 {
2611 switch(stage)
2612 {
2613 case Stage::calculate_types:
2614 {
2615 auto &state = get_id_state(instruction.result);
2616 if(!state.decorations.empty())
2617 throw Parser_error(instruction_start_index,
2618 instruction_start_index,
2619 "decorations on instruction not implemented: "
2620 + std::string(get_enumerant_name(instruction.get_operation())));
2621 auto type = get_type(instruction.result_type, instruction_start_index);
2622 if(auto *simple_type = dynamic_cast<Simple_type_descriptor *>(type.get()))
2623 {
2624 auto llvm_type = simple_type->get_or_make_type();
2625 switch(::LLVMGetTypeKind(llvm_type.type))
2626 {
2627 case LLVMFloatTypeKind:
2628 {
2629 if(instruction.value.size() != 1)
2630 throw Parser_error(instruction_start_index,
2631 instruction_start_index,
2632 "OpConstant immediate value is wrong size for type float32");
2633 state.constant = std::make_shared<Simple_constant_descriptor>(
2634 type,
2635 ::LLVMConstBitCast(
2636 ::LLVMConstInt(
2637 ::LLVMInt32TypeInContext(context), instruction.value[0], false),
2638 llvm_type.type));
2639 break;
2640 }
2641 case LLVMIntegerTypeKind:
2642 {
2643 switch(::LLVMGetIntTypeWidth(llvm_type.type))
2644 {
2645 case 16:
2646 {
2647 if(instruction.value.size() != 1)
2648 throw Parser_error(
2649 instruction_start_index,
2650 instruction_start_index,
2651 "OpConstant immediate value is wrong size for type int16");
2652 state.constant = std::make_shared<Simple_constant_descriptor>(
2653 type, ::LLVMConstInt(llvm_type.type, instruction.value[0], false));
2654 break;
2655 }
2656 case 32:
2657 {
2658 if(instruction.value.size() != 1)
2659 throw Parser_error(
2660 instruction_start_index,
2661 instruction_start_index,
2662 "OpConstant immediate value is wrong size for type int32");
2663 state.constant = std::make_shared<Simple_constant_descriptor>(
2664 type, ::LLVMConstInt(llvm_type.type, instruction.value[0], false));
2665 break;
2666 }
2667 case 64:
2668 {
2669 if(instruction.value.size() != 2)
2670 throw Parser_error(
2671 instruction_start_index,
2672 instruction_start_index,
2673 "OpConstant immediate value is wrong size for type int64");
2674 state.constant = std::make_shared<Simple_constant_descriptor>(
2675 type,
2676 ::LLVMConstInt(llvm_type.type,
2677 (static_cast<std::uint64_t>(instruction.value[1]) << 32)
2678 | instruction.value[0],
2679 false));
2680 break;
2681 }
2682 case 1: // bool
2683 default:
2684 throw Parser_error(
2685 instruction_start_index,
2686 instruction_start_index,
2687 "unimplemented simple type for OpConstant: "
2688 + std::string(llvm_wrapper::print_type_to_string(llvm_type.type)));
2689 }
2690 break;
2691 }
2692 case LLVMDoubleTypeKind:
2693 {
2694 if(instruction.value.size() != 2)
2695 throw Parser_error(instruction_start_index,
2696 instruction_start_index,
2697 "OpConstant immediate value is wrong size for type float64");
2698 state.constant = std::make_shared<Simple_constant_descriptor>(
2699 type,
2700 ::LLVMConstBitCast(
2701 ::LLVMConstInt(::LLVMInt64TypeInContext(context),
2702 (static_cast<std::uint64_t>(instruction.value[1]) << 32)
2703 | instruction.value[0],
2704 false),
2705 llvm_type.type));
2706 break;
2707 }
2708 case LLVMHalfTypeKind:
2709 {
2710 if(instruction.value.size() != 1)
2711 throw Parser_error(instruction_start_index,
2712 instruction_start_index,
2713 "OpConstant immediate value is wrong size for type float16");
2714 state.constant = std::make_shared<Simple_constant_descriptor>(
2715 type,
2716 ::LLVMConstBitCast(
2717 ::LLVMConstInt(
2718 ::LLVMInt16TypeInContext(context), instruction.value[0], false),
2719 llvm_type.type));
2720 break;
2721 }
2722 default:
2723 {
2724 throw Parser_error(
2725 instruction_start_index,
2726 instruction_start_index,
2727 "unimplemented simple type for OpConstant: "
2728 + std::string(llvm_wrapper::print_type_to_string(llvm_type.type)));
2729 }
2730 }
2731 }
2732 else
2733 {
2734 throw Parser_error(instruction_start_index,
2735 instruction_start_index,
2736 "unimplemented type for OpConstant");
2737 }
2738 break;
2739 }
2740 case Stage::generate_code:
2741 {
2742 auto &state = get_id_state(instruction.result);
2743 state.value = Value(state.constant->get_or_make_value(),
2744 get_type(instruction.result_type, instruction_start_index));
2745 break;
2746 }
2747 }
2748 }
2749
2750 void Spirv_to_llvm::handle_instruction_op_constant_composite(Op_constant_composite instruction,
2751 std::size_t instruction_start_index)
2752 {
2753 #warning finish
2754 throw Parser_error(instruction_start_index,
2755 instruction_start_index,
2756 "instruction not implemented: "
2757 + std::string(get_enumerant_name(instruction.get_operation())));
2758 }
2759
2760 void Spirv_to_llvm::handle_instruction_op_constant_sampler(Op_constant_sampler instruction,
2761 std::size_t instruction_start_index)
2762 {
2763 #warning finish
2764 throw Parser_error(instruction_start_index,
2765 instruction_start_index,
2766 "instruction not implemented: "
2767 + std::string(get_enumerant_name(instruction.get_operation())));
2768 }
2769
2770 void Spirv_to_llvm::handle_instruction_op_constant_null(Op_constant_null instruction,
2771 std::size_t instruction_start_index)
2772 {
2773 #warning finish
2774 throw Parser_error(instruction_start_index,
2775 instruction_start_index,
2776 "instruction not implemented: "
2777 + std::string(get_enumerant_name(instruction.get_operation())));
2778 }
2779
2780 void Spirv_to_llvm::handle_instruction_op_spec_constant_true(Op_spec_constant_true instruction,
2781 std::size_t instruction_start_index)
2782 {
2783 #warning finish
2784 throw Parser_error(instruction_start_index,
2785 instruction_start_index,
2786 "instruction not implemented: "
2787 + std::string(get_enumerant_name(instruction.get_operation())));
2788 }
2789
2790 void Spirv_to_llvm::handle_instruction_op_spec_constant_false(Op_spec_constant_false instruction,
2791 std::size_t instruction_start_index)
2792 {
2793 #warning finish
2794 throw Parser_error(instruction_start_index,
2795 instruction_start_index,
2796 "instruction not implemented: "
2797 + std::string(get_enumerant_name(instruction.get_operation())));
2798 }
2799
2800 void Spirv_to_llvm::handle_instruction_op_spec_constant(Op_spec_constant instruction,
2801 std::size_t instruction_start_index)
2802 {
2803 #warning finish
2804 throw Parser_error(instruction_start_index,
2805 instruction_start_index,
2806 "instruction not implemented: "
2807 + std::string(get_enumerant_name(instruction.get_operation())));
2808 }
2809
2810 void Spirv_to_llvm::handle_instruction_op_spec_constant_composite(
2811 Op_spec_constant_composite instruction, std::size_t instruction_start_index)
2812 {
2813 #warning finish
2814 throw Parser_error(instruction_start_index,
2815 instruction_start_index,
2816 "instruction not implemented: "
2817 + std::string(get_enumerant_name(instruction.get_operation())));
2818 }
2819
2820 void Spirv_to_llvm::handle_instruction_op_spec_constant_op(Op_spec_constant_op instruction,
2821 std::size_t instruction_start_index)
2822 {
2823 #warning finish
2824 throw Parser_error(instruction_start_index,
2825 instruction_start_index,
2826 "instruction not implemented: "
2827 + std::string(get_enumerant_name(instruction.get_operation())));
2828 }
2829
2830 void Spirv_to_llvm::handle_instruction_op_function(Op_function instruction,
2831 std::size_t instruction_start_index)
2832 {
2833 if(current_function_id)
2834 throw Parser_error(instruction_start_index,
2835 instruction_start_index,
2836 "missing OpFunctionEnd before starting a new function");
2837 current_function_id = instruction.result;
2838 switch(stage)
2839 {
2840 case Stage::calculate_types:
2841 break;
2842 case Stage::generate_code:
2843 {
2844 auto &state = get_id_state(current_function_id);
2845 if(!state.decorations.empty())
2846 throw Parser_error(instruction_start_index,
2847 instruction_start_index,
2848 "decorations on instruction not implemented: "
2849 + std::string(get_enumerant_name(instruction.get_operation())));
2850 auto function_type =
2851 get_type<Function_type_descriptor>(instruction.function_type, instruction_start_index);
2852 auto function_name = get_name(current_function_id);
2853 if(function_name.empty() && state.op_entry_points.size() == 1)
2854 function_name = std::string(state.op_entry_points[0].entry_point.name);
2855 function_name = get_or_make_prefixed_name(std::move(function_name));
2856 auto function = ::LLVMAddFunction(
2857 module.get(), function_name.c_str(), function_type->get_or_make_type().type);
2858 llvm_wrapper::Module::set_function_target_machine(function, target_machine);
2859 state.function = Function_state(function_type, function, std::move(function_name));
2860 break;
2861 }
2862 }
2863 }
2864
2865 void Spirv_to_llvm::handle_instruction_op_function_parameter(Op_function_parameter instruction,
2866 std::size_t instruction_start_index)
2867 {
2868 #warning finish
2869 throw Parser_error(instruction_start_index,
2870 instruction_start_index,
2871 "instruction not implemented: "
2872 + std::string(get_enumerant_name(instruction.get_operation())));
2873 }
2874
2875 void Spirv_to_llvm::handle_instruction_op_function_end([[gnu::unused]] Op_function_end instruction,
2876 std::size_t instruction_start_index)
2877 {
2878 if(!current_function_id)
2879 throw Parser_error(instruction_start_index,
2880 instruction_start_index,
2881 "OpFunctionEnd without matching OpFunction");
2882 current_function_id = 0;
2883 switch(stage)
2884 {
2885 case Stage::calculate_types:
2886 break;
2887 case Stage::generate_code:
2888 break;
2889 }
2890 }
2891
2892 void Spirv_to_llvm::handle_instruction_op_function_call(Op_function_call instruction,
2893 std::size_t instruction_start_index)
2894 {
2895 #warning finish
2896 throw Parser_error(instruction_start_index,
2897 instruction_start_index,
2898 "instruction not implemented: "
2899 + std::string(get_enumerant_name(instruction.get_operation())));
2900 }
2901
2902 void Spirv_to_llvm::handle_instruction_op_variable(Op_variable instruction,
2903 std::size_t instruction_start_index)
2904 {
2905 switch(stage)
2906 {
2907 case Stage::calculate_types:
2908 {
2909 auto &state = get_id_state(instruction.result);
2910 bool check_decorations = true;
2911 [&]()
2912 {
2913 switch(instruction.storage_class)
2914 {
2915 case Storage_class::uniform_constant:
2916 #warning finish implementing Storage_class::uniform_constant
2917 break;
2918 case Storage_class::input:
2919 {
2920 if(instruction.initializer)
2921 throw Parser_error(instruction_start_index,
2922 instruction_start_index,
2923 "shader input variable initializers are not implemented");
2924 auto type = get_type<Pointer_type_descriptor>(instruction.result_type,
2925 instruction_start_index)
2926 ->get_base_type();
2927 state.variable =
2928 Input_variable_state{type,
2929 inputs_struct->add_member(Struct_type_descriptor::Member(
2930 state.decorations, type))};
2931 check_decorations = false;
2932 return;
2933 }
2934 case Storage_class::uniform:
2935 #warning finish implementing Storage_class::uniform
2936 break;
2937 case Storage_class::output:
2938 {
2939 if(instruction.initializer)
2940 throw Parser_error(instruction_start_index,
2941 instruction_start_index,
2942 "shader output variable initializers are not implemented");
2943 auto type = get_type<Pointer_type_descriptor>(instruction.result_type,
2944 instruction_start_index)
2945 ->get_base_type();
2946 state.variable =
2947 Output_variable_state{type,
2948 outputs_struct->add_member(Struct_type_descriptor::Member(
2949 state.decorations, type))};
2950 check_decorations = false;
2951 return;
2952 }
2953 case Storage_class::workgroup:
2954 #warning finish implementing Storage_class::workgroup
2955 break;
2956 case Storage_class::cross_workgroup:
2957 #warning finish implementing Storage_class::cross_workgroup
2958 break;
2959 case Storage_class::private_:
2960 #warning finish implementing Storage_class::private_
2961 break;
2962 case Storage_class::function:
2963 {
2964 if(!current_function_id)
2965 throw Parser_error(instruction_start_index,
2966 instruction_start_index,
2967 "function-local variable must be inside function");
2968 return;
2969 }
2970 case Storage_class::generic:
2971 #warning finish implementing Storage_class::generic
2972 break;
2973 case Storage_class::push_constant:
2974 #warning finish implementing Storage_class::push_constant
2975 break;
2976 case Storage_class::atomic_counter:
2977 #warning finish implementing Storage_class::atomic_counter
2978 break;
2979 case Storage_class::image:
2980 #warning finish implementing Storage_class::image
2981 break;
2982 case Storage_class::storage_buffer:
2983 #warning finish implementing Storage_class::storage_buffer
2984 break;
2985 }
2986 throw Parser_error(instruction_start_index,
2987 instruction_start_index,
2988 "unimplemented OpVariable storage class: "
2989 + std::string(get_enumerant_name(instruction.storage_class)));
2990 }();
2991 if(check_decorations)
2992 {
2993 for(auto &decoration : state.decorations)
2994 {
2995 switch(decoration.value)
2996 {
2997 case Decoration::relaxed_precision:
2998 #warning finish implementing Decoration::relaxed_precision
2999 break;
3000 case Decoration::spec_id:
3001 #warning finish implementing Decoration::spec_id
3002 break;
3003 case Decoration::block:
3004 #warning finish implementing Decoration::block
3005 break;
3006 case Decoration::buffer_block:
3007 #warning finish implementing Decoration::buffer_block
3008 break;
3009 case Decoration::row_major:
3010 #warning finish implementing Decoration::row_major
3011 break;
3012 case Decoration::col_major:
3013 #warning finish implementing Decoration::col_major
3014 break;
3015 case Decoration::array_stride:
3016 #warning finish implementing Decoration::array_stride
3017 break;
3018 case Decoration::matrix_stride:
3019 #warning finish implementing Decoration::matrix_stride
3020 break;
3021 case Decoration::glsl_shared:
3022 #warning finish implementing Decoration::glsl_shared
3023 break;
3024 case Decoration::glsl_packed:
3025 #warning finish implementing Decoration::glsl_packed
3026 break;
3027 case Decoration::c_packed:
3028 #warning finish implementing Decoration::c_packed
3029 break;
3030 case Decoration::built_in:
3031 #warning finish implementing Decoration::built_in
3032 break;
3033 case Decoration::no_perspective:
3034 #warning finish implementing Decoration::no_perspective
3035 break;
3036 case Decoration::flat:
3037 #warning finish implementing Decoration::flat
3038 break;
3039 case Decoration::patch:
3040 #warning finish implementing Decoration::patch
3041 break;
3042 case Decoration::centroid:
3043 #warning finish implementing Decoration::centroid
3044 break;
3045 case Decoration::sample:
3046 #warning finish implementing Decoration::sample
3047 break;
3048 case Decoration::invariant:
3049 #warning finish implementing Decoration::invariant
3050 break;
3051 case Decoration::restrict:
3052 #warning finish implementing Decoration::restrict
3053 break;
3054 case Decoration::aliased:
3055 #warning finish implementing Decoration::aliased
3056 break;
3057 case Decoration::volatile_:
3058 #warning finish implementing Decoration::volatile_
3059 break;
3060 case Decoration::constant:
3061 #warning finish implementing Decoration::constant
3062 break;
3063 case Decoration::coherent:
3064 #warning finish implementing Decoration::coherent
3065 break;
3066 case Decoration::non_writable:
3067 #warning finish implementing Decoration::non_writable
3068 break;
3069 case Decoration::non_readable:
3070 #warning finish implementing Decoration::non_readable
3071 break;
3072 case Decoration::uniform:
3073 #warning finish implementing Decoration::uniform
3074 break;
3075 case Decoration::saturated_conversion:
3076 #warning finish implementing Decoration::saturated_conversion
3077 break;
3078 case Decoration::stream:
3079 #warning finish implementing Decoration::stream
3080 break;
3081 case Decoration::location:
3082 #warning finish implementing Decoration::location
3083 break;
3084 case Decoration::component:
3085 #warning finish implementing Decoration::component
3086 break;
3087 case Decoration::index:
3088 #warning finish implementing Decoration::index
3089 break;
3090 case Decoration::binding:
3091 #warning finish implementing Decoration::binding
3092 break;
3093 case Decoration::descriptor_set:
3094 #warning finish implementing Decoration::descriptor_set
3095 break;
3096 case Decoration::offset:
3097 #warning finish implementing Decoration::offset
3098 break;
3099 case Decoration::xfb_buffer:
3100 #warning finish implementing Decoration::xfb_buffer
3101 break;
3102 case Decoration::xfb_stride:
3103 #warning finish implementing Decoration::xfb_stride
3104 break;
3105 case Decoration::func_param_attr:
3106 #warning finish implementing Decoration::func_param_attr
3107 break;
3108 case Decoration::fp_rounding_mode:
3109 #warning finish implementing Decoration::fp_rounding_mode
3110 break;
3111 case Decoration::fp_fast_math_mode:
3112 #warning finish implementing Decoration::fp_fast_math_mode
3113 break;
3114 case Decoration::linkage_attributes:
3115 #warning finish implementing Decoration::linkage_attributes
3116 break;
3117 case Decoration::no_contraction:
3118 #warning finish implementing Decoration::no_contraction
3119 break;
3120 case Decoration::input_attachment_index:
3121 #warning finish implementing Decoration::input_attachment_index
3122 break;
3123 case Decoration::alignment:
3124 #warning finish implementing Decoration::alignment
3125 break;
3126 case Decoration::max_byte_offset:
3127 #warning finish implementing Decoration::max_byte_offset
3128 break;
3129 case Decoration::alignment_id:
3130 #warning finish implementing Decoration::alignment_id
3131 break;
3132 case Decoration::max_byte_offset_id:
3133 #warning finish implementing Decoration::max_byte_offset_id
3134 break;
3135 case Decoration::override_coverage_nv:
3136 #warning finish implementing Decoration::override_coverage_nv
3137 break;
3138 case Decoration::passthrough_nv:
3139 #warning finish implementing Decoration::passthrough_nv
3140 break;
3141 case Decoration::viewport_relative_nv:
3142 #warning finish implementing Decoration::viewport_relative_nv
3143 break;
3144 case Decoration::secondary_viewport_relative_nv:
3145 #warning finish implementing Decoration::secondary_viewport_relative_nv
3146 break;
3147 }
3148 throw Parser_error(instruction_start_index,
3149 instruction_start_index,
3150 "unimplemented decoration on OpVariable: "
3151 + std::string(get_enumerant_name(decoration.value)));
3152 }
3153 }
3154 break;
3155 }
3156 case Stage::generate_code:
3157 {
3158 auto &state = get_id_state(instruction.result);
3159 switch(instruction.storage_class)
3160 {
3161 case Storage_class::uniform_constant:
3162 #warning finish implementing Storage_class::uniform_constant
3163 break;
3164 case Storage_class::input:
3165 {
3166 if(instruction.initializer)
3167 throw Parser_error(instruction_start_index,
3168 instruction_start_index,
3169 "shader input variable initializers are not implemented");
3170 auto set_value_fn = [this, instruction, &state, instruction_start_index]()
3171 {
3172 auto &variable = util::get<Input_variable_state>(state.variable);
3173 state.value = Value(
3174 ::LLVMBuildStructGEP(
3175 builder.get(),
3176 get_id_state(current_function_id).function->entry_block->inputs_struct,
3177 inputs_struct->get_members(true)[variable.member_index].llvm_member_index,
3178 get_name(instruction.result).c_str()),
3179 get_type(instruction.result_type, instruction_start_index));
3180 };
3181 if(current_function_id)
3182 set_value_fn();
3183 else
3184 function_entry_block_handlers.push_back(set_value_fn);
3185 return;
3186 }
3187 case Storage_class::uniform:
3188 #warning finish implementing Storage_class::uniform
3189 break;
3190 case Storage_class::output:
3191 {
3192 if(instruction.initializer)
3193 throw Parser_error(instruction_start_index,
3194 instruction_start_index,
3195 "shader output variable initializers are not implemented");
3196 auto set_value_fn = [this, instruction, &state, instruction_start_index]()
3197 {
3198 auto &variable = util::get<Output_variable_state>(state.variable);
3199 state.value = Value(
3200 ::LLVMBuildStructGEP(
3201 builder.get(),
3202 get_id_state(current_function_id).function->entry_block->outputs_struct,
3203 outputs_struct->get_members(true)[variable.member_index].llvm_member_index,
3204 get_name(instruction.result).c_str()),
3205 get_type(instruction.result_type, instruction_start_index));
3206 };
3207 if(current_function_id)
3208 set_value_fn();
3209 else
3210 function_entry_block_handlers.push_back(set_value_fn);
3211 return;
3212 }
3213 case Storage_class::workgroup:
3214 #warning finish implementing Storage_class::workgroup
3215 break;
3216 case Storage_class::cross_workgroup:
3217 #warning finish implementing Storage_class::cross_workgroup
3218 break;
3219 case Storage_class::private_:
3220 #warning finish implementing Storage_class::private_
3221 break;
3222 case Storage_class::function:
3223 {
3224 if(!current_function_id)
3225 throw Parser_error(instruction_start_index,
3226 instruction_start_index,
3227 "function-local variable must be inside function");
3228 auto &function = get_id_state(current_function_id).function.value();
3229 if(!function.entry_block
3230 || function.entry_block->entry_block != get_or_make_label(current_basic_block_id))
3231 throw Parser_error(instruction_start_index,
3232 instruction_start_index,
3233 "function-local variable must be inside initial basic block");
3234 auto type =
3235 get_type<Pointer_type_descriptor>(instruction.result_type, instruction_start_index);
3236 state.value = Value(::LLVMBuildAlloca(builder.get(),
3237 type->get_base_type()->get_or_make_type().type,
3238 get_name(instruction.result).c_str()),
3239 type);
3240 ::LLVMSetAlignment(state.value->value,
3241 type->get_base_type()->get_or_make_type().alignment);
3242 return;
3243 }
3244 case Storage_class::generic:
3245 #warning finish implementing Storage_class::generic
3246 break;
3247 case Storage_class::push_constant:
3248 #warning finish implementing Storage_class::push_constant
3249 break;
3250 case Storage_class::atomic_counter:
3251 #warning finish implementing Storage_class::atomic_counter
3252 break;
3253 case Storage_class::image:
3254 #warning finish implementing Storage_class::image
3255 break;
3256 case Storage_class::storage_buffer:
3257 #warning finish implementing Storage_class::storage_buffer
3258 break;
3259 }
3260 break;
3261 }
3262 }
3263 }
3264
3265 void Spirv_to_llvm::handle_instruction_op_image_texel_pointer(Op_image_texel_pointer instruction,
3266 std::size_t instruction_start_index)
3267 {
3268 #warning finish
3269 throw Parser_error(instruction_start_index,
3270 instruction_start_index,
3271 "instruction not implemented: "
3272 + std::string(get_enumerant_name(instruction.get_operation())));
3273 }
3274
3275 void Spirv_to_llvm::handle_instruction_op_load(Op_load instruction,
3276 std::size_t instruction_start_index)
3277 {
3278 switch(stage)
3279 {
3280 case Stage::calculate_types:
3281 break;
3282 case Stage::generate_code:
3283 {
3284 auto &state = get_id_state(instruction.result);
3285 if(!state.decorations.empty())
3286 throw Parser_error(instruction_start_index,
3287 instruction_start_index,
3288 "decorations on instruction not implemented: "
3289 + std::string(get_enumerant_name(instruction.get_operation())));
3290 auto memory_access = instruction.memory_access.value_or(
3291 Memory_access_with_parameters(Memory_access::none, {}));
3292 if((memory_access.value & Memory_access::volatile_) == Memory_access::volatile_)
3293 throw Parser_error(instruction_start_index,
3294 instruction_start_index,
3295 "OpLoad volatile not implemented");
3296 if((memory_access.value & Memory_access::aligned) == Memory_access::aligned)
3297 throw Parser_error(instruction_start_index,
3298 instruction_start_index,
3299 "OpLoad alignment not implemented");
3300 if((memory_access.value & Memory_access::nontemporal) == Memory_access::nontemporal)
3301 throw Parser_error(instruction_start_index,
3302 instruction_start_index,
3303 "OpLoad nontemporal not implemented");
3304 state.value = Value(::LLVMBuildLoad(builder.get(),
3305 get_id_state(instruction.pointer).value.value().value,
3306 get_name(instruction.result).c_str()),
3307 get_type(instruction.result_type, instruction_start_index));
3308 ::LLVMSetAlignment(state.value->value, state.value->type->get_or_make_type().alignment);
3309 break;
3310 }
3311 }
3312 }
3313
3314 void Spirv_to_llvm::handle_instruction_op_store(Op_store instruction,
3315 std::size_t instruction_start_index)
3316 {
3317 switch(stage)
3318 {
3319 case Stage::calculate_types:
3320 break;
3321 case Stage::generate_code:
3322 {
3323 auto memory_access = instruction.memory_access.value_or(
3324 Memory_access_with_parameters(Memory_access::none, {}));
3325 if((memory_access.value & Memory_access::volatile_) == Memory_access::volatile_)
3326 throw Parser_error(instruction_start_index,
3327 instruction_start_index,
3328 "OpStore volatile not implemented");
3329 if((memory_access.value & Memory_access::aligned) == Memory_access::aligned)
3330 throw Parser_error(instruction_start_index,
3331 instruction_start_index,
3332 "OpStore alignment not implemented");
3333 if((memory_access.value & Memory_access::nontemporal) == Memory_access::nontemporal)
3334 throw Parser_error(instruction_start_index,
3335 instruction_start_index,
3336 "OpStore nontemporal not implemented");
3337 auto &object_value = get_id_state(instruction.object).value.value();
3338 auto &pointer_value = get_id_state(instruction.pointer).value.value();
3339 ::LLVMSetAlignment(::LLVMBuildStore(builder.get(), object_value.value, pointer_value.value),
3340 object_value.type->get_or_make_type().alignment);
3341 break;
3342 }
3343 }
3344 }
3345
3346 void Spirv_to_llvm::handle_instruction_op_copy_memory(Op_copy_memory instruction,
3347 std::size_t instruction_start_index)
3348 {
3349 #warning finish
3350 throw Parser_error(instruction_start_index,
3351 instruction_start_index,
3352 "instruction not implemented: "
3353 + std::string(get_enumerant_name(instruction.get_operation())));
3354 }
3355
3356 void Spirv_to_llvm::handle_instruction_op_copy_memory_sized(Op_copy_memory_sized instruction,
3357 std::size_t instruction_start_index)
3358 {
3359 #warning finish
3360 throw Parser_error(instruction_start_index,
3361 instruction_start_index,
3362 "instruction not implemented: "
3363 + std::string(get_enumerant_name(instruction.get_operation())));
3364 }
3365
3366 void Spirv_to_llvm::handle_instruction_op_access_chain(Op_access_chain instruction,
3367 std::size_t instruction_start_index)
3368 {
3369 switch(stage)
3370 {
3371 case Stage::calculate_types:
3372 break;
3373 case Stage::generate_code:
3374 {
3375 auto &state = get_id_state(instruction.result);
3376 if(!state.decorations.empty())
3377 throw Parser_error(instruction_start_index,
3378 instruction_start_index,
3379 "decorations on instruction not implemented: "
3380 + std::string(get_enumerant_name(instruction.get_operation())));
3381 auto base = get_id_state(instruction.base).value.value();
3382 std::string name = get_name(instruction.result);
3383 std::vector<::LLVMValueRef> llvm_indexes;
3384 llvm_indexes.reserve(instruction.indexes.size() + 1);
3385 auto *base_pointer_type = dynamic_cast<const Pointer_type_descriptor *>(base.type.get());
3386 if(!base_pointer_type)
3387 throw Parser_error(instruction_start_index,
3388 instruction_start_index,
3389 "base type is not a pointer for OpAccessChain");
3390 llvm_indexes.push_back(::LLVMConstInt(::LLVMInt32TypeInContext(context), 0, false));
3391 auto current_type = base_pointer_type->get_base_type();
3392 for(std::size_t i = 0; i < instruction.indexes.size(); i++)
3393 {
3394 Id index = instruction.indexes[i];
3395 struct Visitor
3396 {
3397 std::size_t instruction_start_index;
3398 std::shared_ptr<Type_descriptor> &current_type;
3399 std::vector<::LLVMValueRef> &llvm_indexes;
3400 Id index;
3401 Spirv_to_llvm *this_;
3402 void operator()(Simple_type_descriptor &)
3403 {
3404 throw Parser_error(instruction_start_index,
3405 instruction_start_index,
3406 "invalid composite type for OpAccessChain");
3407 }
3408 void operator()(Vector_type_descriptor &type)
3409 {
3410 auto &index_value = this_->get_id_state(index).value.value();
3411 llvm_indexes.push_back(index_value.value);
3412 current_type = type.get_element_type();
3413 }
3414 void operator()(Matrix_type_descriptor &)
3415 {
3416 #warning finish
3417 throw Parser_error(instruction_start_index,
3418 instruction_start_index,
3419 "unimplemented composite type for OpAccessChain");
3420 }
3421 void operator()(Array_type_descriptor &)
3422 {
3423 #warning finish
3424 throw Parser_error(instruction_start_index,
3425 instruction_start_index,
3426 "unimplemented composite type for OpAccessChain");
3427 }
3428 void operator()(Pointer_type_descriptor &)
3429 {
3430 throw Parser_error(instruction_start_index,
3431 instruction_start_index,
3432 "invalid composite type for OpAccessChain");
3433 }
3434 void operator()(Function_type_descriptor &)
3435 {
3436 throw Parser_error(instruction_start_index,
3437 instruction_start_index,
3438 "invalid composite type for OpAccessChain");
3439 }
3440 void operator()(Struct_type_descriptor &type)
3441 {
3442 auto index_value = ::LLVMConstIntGetZExtValue(
3443 this_->get_id_state(index).constant->get_or_make_value());
3444 auto &members = type.get_members(true);
3445 if(index_value >= members.size())
3446 throw Parser_error(instruction_start_index,
3447 instruction_start_index,
3448 "index out of range in OpAccessChain");
3449 llvm_indexes.push_back(::LLVMConstInt(::LLVMInt32TypeInContext(this_->context),
3450 members[index_value].llvm_member_index,
3451 false));
3452 current_type = members[index_value].type;
3453 }
3454 };
3455 auto *type = current_type.get();
3456 type->visit(Visitor{instruction_start_index, current_type, llvm_indexes, index, this});
3457 }
3458 state.value = Value(
3459 ::LLVMBuildGEP(
3460 builder.get(), base.value, llvm_indexes.data(), llvm_indexes.size(), name.c_str()),
3461 get_type(instruction.result_type, instruction_start_index));
3462 break;
3463 }
3464 }
3465 }
3466
3467 void Spirv_to_llvm::handle_instruction_op_in_bounds_access_chain(
3468 Op_in_bounds_access_chain instruction, std::size_t instruction_start_index)
3469 {
3470 #warning finish
3471 throw Parser_error(instruction_start_index,
3472 instruction_start_index,
3473 "instruction not implemented: "
3474 + std::string(get_enumerant_name(instruction.get_operation())));
3475 }
3476
3477 void Spirv_to_llvm::handle_instruction_op_ptr_access_chain(Op_ptr_access_chain instruction,
3478 std::size_t instruction_start_index)
3479 {
3480 #warning finish
3481 throw Parser_error(instruction_start_index,
3482 instruction_start_index,
3483 "instruction not implemented: "
3484 + std::string(get_enumerant_name(instruction.get_operation())));
3485 }
3486
3487 void Spirv_to_llvm::handle_instruction_op_array_length(Op_array_length instruction,
3488 std::size_t instruction_start_index)
3489 {
3490 #warning finish
3491 throw Parser_error(instruction_start_index,
3492 instruction_start_index,
3493 "instruction not implemented: "
3494 + std::string(get_enumerant_name(instruction.get_operation())));
3495 }
3496
3497 void Spirv_to_llvm::handle_instruction_op_generic_ptr_mem_semantics(
3498 Op_generic_ptr_mem_semantics instruction, std::size_t instruction_start_index)
3499 {
3500 #warning finish
3501 throw Parser_error(instruction_start_index,
3502 instruction_start_index,
3503 "instruction not implemented: "
3504 + std::string(get_enumerant_name(instruction.get_operation())));
3505 }
3506
3507 void Spirv_to_llvm::handle_instruction_op_in_bounds_ptr_access_chain(
3508 Op_in_bounds_ptr_access_chain instruction, std::size_t instruction_start_index)
3509 {
3510 #warning finish
3511 throw Parser_error(instruction_start_index,
3512 instruction_start_index,
3513 "instruction not implemented: "
3514 + std::string(get_enumerant_name(instruction.get_operation())));
3515 }
3516
3517 void Spirv_to_llvm::handle_instruction_op_decorate(
3518 Op_decorate instruction, [[gnu::unused]] std::size_t instruction_start_index)
3519 {
3520 get_id_state(instruction.target).decorations.push_back(std::move(instruction.decoration));
3521 }
3522
3523 void Spirv_to_llvm::handle_instruction_op_member_decorate(
3524 Op_member_decorate instruction, [[gnu::unused]] std::size_t instruction_start_index)
3525 {
3526 auto &state = get_id_state(instruction.structure_type);
3527 state.member_decorations.push_back(std::move(instruction));
3528 }
3529
3530 void Spirv_to_llvm::handle_instruction_op_decoration_group(Op_decoration_group instruction,
3531 std::size_t instruction_start_index)
3532 {
3533 #warning finish
3534 throw Parser_error(instruction_start_index,
3535 instruction_start_index,
3536 "instruction not implemented: "
3537 + std::string(get_enumerant_name(instruction.get_operation())));
3538 }
3539
3540 void Spirv_to_llvm::handle_instruction_op_group_decorate(Op_group_decorate instruction,
3541 std::size_t instruction_start_index)
3542 {
3543 #warning finish
3544 throw Parser_error(instruction_start_index,
3545 instruction_start_index,
3546 "instruction not implemented: "
3547 + std::string(get_enumerant_name(instruction.get_operation())));
3548 }
3549
3550 void Spirv_to_llvm::handle_instruction_op_group_member_decorate(
3551 Op_group_member_decorate instruction, std::size_t instruction_start_index)
3552 {
3553 #warning finish
3554 throw Parser_error(instruction_start_index,
3555 instruction_start_index,
3556 "instruction not implemented: "
3557 + std::string(get_enumerant_name(instruction.get_operation())));
3558 }
3559
3560 void Spirv_to_llvm::handle_instruction_op_vector_extract_dynamic(
3561 Op_vector_extract_dynamic instruction, std::size_t instruction_start_index)
3562 {
3563 #warning finish
3564 throw Parser_error(instruction_start_index,
3565 instruction_start_index,
3566 "instruction not implemented: "
3567 + std::string(get_enumerant_name(instruction.get_operation())));
3568 }
3569
3570 void Spirv_to_llvm::handle_instruction_op_vector_insert_dynamic(
3571 Op_vector_insert_dynamic instruction, std::size_t instruction_start_index)
3572 {
3573 #warning finish
3574 throw Parser_error(instruction_start_index,
3575 instruction_start_index,
3576 "instruction not implemented: "
3577 + std::string(get_enumerant_name(instruction.get_operation())));
3578 }
3579
3580 void Spirv_to_llvm::handle_instruction_op_vector_shuffle(Op_vector_shuffle instruction,
3581 std::size_t instruction_start_index)
3582 {
3583 #warning finish
3584 throw Parser_error(instruction_start_index,
3585 instruction_start_index,
3586 "instruction not implemented: "
3587 + std::string(get_enumerant_name(instruction.get_operation())));
3588 }
3589
3590 void Spirv_to_llvm::handle_instruction_op_composite_construct(Op_composite_construct instruction,
3591 std::size_t instruction_start_index)
3592 {
3593 switch(stage)
3594 {
3595 case Stage::calculate_types:
3596 break;
3597 case Stage::generate_code:
3598 {
3599 auto &state = get_id_state(instruction.result);
3600 if(!state.decorations.empty())
3601 throw Parser_error(instruction_start_index,
3602 instruction_start_index,
3603 "decorations on instruction not implemented: "
3604 + std::string(get_enumerant_name(instruction.get_operation())));
3605 auto result_type = get_type(instruction.result_type, instruction_start_index);
3606 ::LLVMValueRef result_value = nullptr;
3607 std::string name = get_name(instruction.result);
3608 struct Visitor
3609 {
3610 Op_composite_construct &instruction;
3611 std::size_t instruction_start_index;
3612 Id_state &state;
3613 ::LLVMValueRef &result_value;
3614 std::string &name;
3615 Spirv_to_llvm *this_;
3616 void operator()(Simple_type_descriptor &)
3617 {
3618 throw Parser_error(instruction_start_index,
3619 instruction_start_index,
3620 "invalid result type for OpCompositeConstruct");
3621 }
3622 void operator()(Vector_type_descriptor &type)
3623 {
3624 if(instruction.constituents.size() < 2)
3625 throw Parser_error(instruction_start_index,
3626 instruction_start_index,
3627 "too few inputs to construct a vector");
3628 result_value = ::LLVMGetUndef(type.get_or_make_type().type);
3629 std::uint32_t insert_index = 0;
3630 auto insert_element = [&](::LLVMValueRef element)
3631 {
3632 if(insert_index >= type.get_element_count())
3633 throw Parser_error(
3634 instruction_start_index,
3635 instruction_start_index,
3636 "too many input vector elements to fit in output vector");
3637 result_value = ::LLVMBuildInsertElement(
3638 this_->builder.get(),
3639 result_value,
3640 element,
3641 ::LLVMConstInt(
3642 ::LLVMInt32TypeInContext(this_->context), insert_index, false),
3643 insert_index + 1 == type.get_element_count() ? name.c_str() : "");
3644 insert_index++;
3645 };
3646 for(Id input : instruction.constituents)
3647 {
3648 auto &value = this_->get_id_state(input).value.value();
3649 if(auto *vector_type = dynamic_cast<Vector_type_descriptor *>(value.type.get()))
3650 {
3651 for(std::uint32_t i = 0; i < vector_type->get_element_count(); i++)
3652 {
3653 insert_element(::LLVMBuildExtractElement(
3654 this_->builder.get(),
3655 value.value,
3656 ::LLVMConstInt(
3657 ::LLVMInt32TypeInContext(this_->context), insert_index, false),
3658 ""));
3659 }
3660 }
3661 else
3662 {
3663 insert_element(value.value);
3664 }
3665 }
3666 if(insert_index < type.get_element_count())
3667 throw Parser_error(instruction_start_index,
3668 instruction_start_index,
3669 "too few input vector elements to fill output vector");
3670 }
3671 void operator()(Matrix_type_descriptor &)
3672 {
3673 #warning finish
3674 throw Parser_error(instruction_start_index,
3675 instruction_start_index,
3676 "unimplemented result type for OpCompositeConstruct");
3677 }
3678 void operator()(Array_type_descriptor &)
3679 {
3680 #warning finish
3681 throw Parser_error(instruction_start_index,
3682 instruction_start_index,
3683 "unimplemented result type for OpCompositeConstruct");
3684 }
3685 void operator()(Pointer_type_descriptor &)
3686 {
3687 throw Parser_error(instruction_start_index,
3688 instruction_start_index,
3689 "invalid result type for OpCompositeConstruct");
3690 }
3691 void operator()(Function_type_descriptor &)
3692 {
3693 throw Parser_error(instruction_start_index,
3694 instruction_start_index,
3695 "invalid result type for OpCompositeConstruct");
3696 }
3697 void operator()(Struct_type_descriptor &)
3698 {
3699 #warning finish
3700 throw Parser_error(instruction_start_index,
3701 instruction_start_index,
3702 "unimplemented result type for OpCompositeConstruct");
3703 }
3704 };
3705 result_type->visit(
3706 Visitor{instruction, instruction_start_index, state, result_value, name, this});
3707 state.value = Value(result_value, std::move(result_type));
3708 break;
3709 }
3710 }
3711 }
3712
3713 void Spirv_to_llvm::handle_instruction_op_composite_extract(Op_composite_extract instruction,
3714 std::size_t instruction_start_index)
3715 {
3716 switch(stage)
3717 {
3718 case Stage::calculate_types:
3719 break;
3720 case Stage::generate_code:
3721 {
3722 auto &state = get_id_state(instruction.result);
3723 if(!state.decorations.empty())
3724 throw Parser_error(instruction_start_index,
3725 instruction_start_index,
3726 "decorations on instruction not implemented: "
3727 + std::string(get_enumerant_name(instruction.get_operation())));
3728 auto result = get_id_state(instruction.composite).value.value();
3729 std::string name = "";
3730 for(std::size_t i = 0; i < instruction.indexes.size(); i++)
3731 {
3732 std::uint32_t index = instruction.indexes[i];
3733 if(i == instruction.indexes.size() - 1)
3734 name = get_name(instruction.result);
3735 struct Visitor
3736 {
3737 std::size_t instruction_start_index;
3738 Id_state &state;
3739 Value &result;
3740 std::string &name;
3741 std::uint32_t index;
3742 ::LLVMContextRef context;
3743 llvm_wrapper::Builder &builder;
3744 void operator()(Simple_type_descriptor &)
3745 {
3746 throw Parser_error(instruction_start_index,
3747 instruction_start_index,
3748 "invalid composite type for OpCompositeExtract");
3749 }
3750 void operator()(Vector_type_descriptor &type)
3751 {
3752 if(index >= type.get_element_count())
3753 throw Parser_error(instruction_start_index,
3754 instruction_start_index,
3755 "index out of range in OpCompositeExtract");
3756 result =
3757 Value(::LLVMBuildExtractElement(
3758 builder.get(),
3759 result.value,
3760 ::LLVMConstInt(::LLVMInt32TypeInContext(context), index, false),
3761 name.c_str()),
3762 type.get_element_type());
3763 }
3764 void operator()(Matrix_type_descriptor &)
3765 {
3766 #warning finish
3767 throw Parser_error(instruction_start_index,
3768 instruction_start_index,
3769 "unimplemented composite type for OpCompositeExtract");
3770 }
3771 void operator()(Array_type_descriptor &)
3772 {
3773 #warning finish
3774 throw Parser_error(instruction_start_index,
3775 instruction_start_index,
3776 "unimplemented composite type for OpCompositeExtract");
3777 }
3778 void operator()(Pointer_type_descriptor &)
3779 {
3780 throw Parser_error(instruction_start_index,
3781 instruction_start_index,
3782 "invalid composite type for OpCompositeExtract");
3783 }
3784 void operator()(Function_type_descriptor &)
3785 {
3786 throw Parser_error(instruction_start_index,
3787 instruction_start_index,
3788 "invalid composite type for OpCompositeExtract");
3789 }
3790 void operator()(Struct_type_descriptor &)
3791 {
3792 #warning finish
3793 throw Parser_error(instruction_start_index,
3794 instruction_start_index,
3795 "unimplemented composite type for OpCompositeExtract");
3796 }
3797 };
3798 auto *type = result.type.get();
3799 type->visit(
3800 Visitor{instruction_start_index, state, result, name, index, context, builder});
3801 }
3802 state.value = result;
3803 break;
3804 }
3805 }
3806 }
3807
3808 void Spirv_to_llvm::handle_instruction_op_composite_insert(Op_composite_insert instruction,
3809 std::size_t instruction_start_index)
3810 {
3811 #warning finish
3812 throw Parser_error(instruction_start_index,
3813 instruction_start_index,
3814 "instruction not implemented: "
3815 + std::string(get_enumerant_name(instruction.get_operation())));
3816 }
3817
3818 void Spirv_to_llvm::handle_instruction_op_copy_object(Op_copy_object instruction,
3819 std::size_t instruction_start_index)
3820 {
3821 #warning finish
3822 throw Parser_error(instruction_start_index,
3823 instruction_start_index,
3824 "instruction not implemented: "
3825 + std::string(get_enumerant_name(instruction.get_operation())));
3826 }
3827
3828 void Spirv_to_llvm::handle_instruction_op_transpose(Op_transpose instruction,
3829 std::size_t instruction_start_index)
3830 {
3831 #warning finish
3832 throw Parser_error(instruction_start_index,
3833 instruction_start_index,
3834 "instruction not implemented: "
3835 + std::string(get_enumerant_name(instruction.get_operation())));
3836 }
3837
3838 void Spirv_to_llvm::handle_instruction_op_sampled_image(Op_sampled_image instruction,
3839 std::size_t instruction_start_index)
3840 {
3841 #warning finish
3842 throw Parser_error(instruction_start_index,
3843 instruction_start_index,
3844 "instruction not implemented: "
3845 + std::string(get_enumerant_name(instruction.get_operation())));
3846 }
3847
3848 void Spirv_to_llvm::handle_instruction_op_image_sample_implicit_lod(
3849 Op_image_sample_implicit_lod instruction, std::size_t instruction_start_index)
3850 {
3851 #warning finish
3852 throw Parser_error(instruction_start_index,
3853 instruction_start_index,
3854 "instruction not implemented: "
3855 + std::string(get_enumerant_name(instruction.get_operation())));
3856 }
3857
3858 void Spirv_to_llvm::handle_instruction_op_image_sample_explicit_lod(
3859 Op_image_sample_explicit_lod instruction, std::size_t instruction_start_index)
3860 {
3861 #warning finish
3862 throw Parser_error(instruction_start_index,
3863 instruction_start_index,
3864 "instruction not implemented: "
3865 + std::string(get_enumerant_name(instruction.get_operation())));
3866 }
3867
3868 void Spirv_to_llvm::handle_instruction_op_image_sample_dref_implicit_lod(
3869 Op_image_sample_dref_implicit_lod instruction, std::size_t instruction_start_index)
3870 {
3871 #warning finish
3872 throw Parser_error(instruction_start_index,
3873 instruction_start_index,
3874 "instruction not implemented: "
3875 + std::string(get_enumerant_name(instruction.get_operation())));
3876 }
3877
3878 void Spirv_to_llvm::handle_instruction_op_image_sample_dref_explicit_lod(
3879 Op_image_sample_dref_explicit_lod instruction, std::size_t instruction_start_index)
3880 {
3881 #warning finish
3882 throw Parser_error(instruction_start_index,
3883 instruction_start_index,
3884 "instruction not implemented: "
3885 + std::string(get_enumerant_name(instruction.get_operation())));
3886 }
3887
3888 void Spirv_to_llvm::handle_instruction_op_image_sample_proj_implicit_lod(
3889 Op_image_sample_proj_implicit_lod instruction, std::size_t instruction_start_index)
3890 {
3891 #warning finish
3892 throw Parser_error(instruction_start_index,
3893 instruction_start_index,
3894 "instruction not implemented: "
3895 + std::string(get_enumerant_name(instruction.get_operation())));
3896 }
3897
3898 void Spirv_to_llvm::handle_instruction_op_image_sample_proj_explicit_lod(
3899 Op_image_sample_proj_explicit_lod instruction, std::size_t instruction_start_index)
3900 {
3901 #warning finish
3902 throw Parser_error(instruction_start_index,
3903 instruction_start_index,
3904 "instruction not implemented: "
3905 + std::string(get_enumerant_name(instruction.get_operation())));
3906 }
3907
3908 void Spirv_to_llvm::handle_instruction_op_image_sample_proj_dref_implicit_lod(
3909 Op_image_sample_proj_dref_implicit_lod instruction, std::size_t instruction_start_index)
3910 {
3911 #warning finish
3912 throw Parser_error(instruction_start_index,
3913 instruction_start_index,
3914 "instruction not implemented: "
3915 + std::string(get_enumerant_name(instruction.get_operation())));
3916 }
3917
3918 void Spirv_to_llvm::handle_instruction_op_image_sample_proj_dref_explicit_lod(
3919 Op_image_sample_proj_dref_explicit_lod instruction, std::size_t instruction_start_index)
3920 {
3921 #warning finish
3922 throw Parser_error(instruction_start_index,
3923 instruction_start_index,
3924 "instruction not implemented: "
3925 + std::string(get_enumerant_name(instruction.get_operation())));
3926 }
3927
3928 void Spirv_to_llvm::handle_instruction_op_image_fetch(Op_image_fetch instruction,
3929 std::size_t instruction_start_index)
3930 {
3931 #warning finish
3932 throw Parser_error(instruction_start_index,
3933 instruction_start_index,
3934 "instruction not implemented: "
3935 + std::string(get_enumerant_name(instruction.get_operation())));
3936 }
3937
3938 void Spirv_to_llvm::handle_instruction_op_image_gather(Op_image_gather instruction,
3939 std::size_t instruction_start_index)
3940 {
3941 #warning finish
3942 throw Parser_error(instruction_start_index,
3943 instruction_start_index,
3944 "instruction not implemented: "
3945 + std::string(get_enumerant_name(instruction.get_operation())));
3946 }
3947
3948 void Spirv_to_llvm::handle_instruction_op_image_dref_gather(Op_image_dref_gather instruction,
3949 std::size_t instruction_start_index)
3950 {
3951 #warning finish
3952 throw Parser_error(instruction_start_index,
3953 instruction_start_index,
3954 "instruction not implemented: "
3955 + std::string(get_enumerant_name(instruction.get_operation())));
3956 }
3957
3958 void Spirv_to_llvm::handle_instruction_op_image_read(Op_image_read instruction,
3959 std::size_t instruction_start_index)
3960 {
3961 #warning finish
3962 throw Parser_error(instruction_start_index,
3963 instruction_start_index,
3964 "instruction not implemented: "
3965 + std::string(get_enumerant_name(instruction.get_operation())));
3966 }
3967
3968 void Spirv_to_llvm::handle_instruction_op_image_write(Op_image_write instruction,
3969 std::size_t instruction_start_index)
3970 {
3971 #warning finish
3972 throw Parser_error(instruction_start_index,
3973 instruction_start_index,
3974 "instruction not implemented: "
3975 + std::string(get_enumerant_name(instruction.get_operation())));
3976 }
3977
3978 void Spirv_to_llvm::handle_instruction_op_image(Op_image instruction,
3979 std::size_t instruction_start_index)
3980 {
3981 #warning finish
3982 throw Parser_error(instruction_start_index,
3983 instruction_start_index,
3984 "instruction not implemented: "
3985 + std::string(get_enumerant_name(instruction.get_operation())));
3986 }
3987
3988 void Spirv_to_llvm::handle_instruction_op_image_query_format(Op_image_query_format instruction,
3989 std::size_t instruction_start_index)
3990 {
3991 #warning finish
3992 throw Parser_error(instruction_start_index,
3993 instruction_start_index,
3994 "instruction not implemented: "
3995 + std::string(get_enumerant_name(instruction.get_operation())));
3996 }
3997
3998 void Spirv_to_llvm::handle_instruction_op_image_query_order(Op_image_query_order instruction,
3999 std::size_t instruction_start_index)
4000 {
4001 #warning finish
4002 throw Parser_error(instruction_start_index,
4003 instruction_start_index,
4004 "instruction not implemented: "
4005 + std::string(get_enumerant_name(instruction.get_operation())));
4006 }
4007
4008 void Spirv_to_llvm::handle_instruction_op_image_query_size_lod(Op_image_query_size_lod instruction,
4009 std::size_t instruction_start_index)
4010 {
4011 #warning finish
4012 throw Parser_error(instruction_start_index,
4013 instruction_start_index,
4014 "instruction not implemented: "
4015 + std::string(get_enumerant_name(instruction.get_operation())));
4016 }
4017
4018 void Spirv_to_llvm::handle_instruction_op_image_query_size(Op_image_query_size instruction,
4019 std::size_t instruction_start_index)
4020 {
4021 #warning finish
4022 throw Parser_error(instruction_start_index,
4023 instruction_start_index,
4024 "instruction not implemented: "
4025 + std::string(get_enumerant_name(instruction.get_operation())));
4026 }
4027
4028 void Spirv_to_llvm::handle_instruction_op_image_query_lod(Op_image_query_lod instruction,
4029 std::size_t instruction_start_index)
4030 {
4031 #warning finish
4032 throw Parser_error(instruction_start_index,
4033 instruction_start_index,
4034 "instruction not implemented: "
4035 + std::string(get_enumerant_name(instruction.get_operation())));
4036 }
4037
4038 void Spirv_to_llvm::handle_instruction_op_image_query_levels(Op_image_query_levels instruction,
4039 std::size_t instruction_start_index)
4040 {
4041 #warning finish
4042 throw Parser_error(instruction_start_index,
4043 instruction_start_index,
4044 "instruction not implemented: "
4045 + std::string(get_enumerant_name(instruction.get_operation())));
4046 }
4047
4048 void Spirv_to_llvm::handle_instruction_op_image_query_samples(Op_image_query_samples instruction,
4049 std::size_t instruction_start_index)
4050 {
4051 #warning finish
4052 throw Parser_error(instruction_start_index,
4053 instruction_start_index,
4054 "instruction not implemented: "
4055 + std::string(get_enumerant_name(instruction.get_operation())));
4056 }
4057
4058 void Spirv_to_llvm::handle_instruction_op_convert_f_to_u(Op_convert_f_to_u instruction,
4059 std::size_t instruction_start_index)
4060 {
4061 switch(stage)
4062 {
4063 case Stage::calculate_types:
4064 break;
4065 case Stage::generate_code:
4066 {
4067 auto &state = get_id_state(instruction.result);
4068 if(!state.decorations.empty())
4069 throw Parser_error(instruction_start_index,
4070 instruction_start_index,
4071 "decorations on instruction not implemented: "
4072 + std::string(get_enumerant_name(instruction.get_operation())));
4073 auto result_type = get_type(instruction.result_type, instruction_start_index);
4074 state.value =
4075 Value(::LLVMBuildFPToUI(builder.get(),
4076 get_id_state(instruction.float_value).value.value().value,
4077 result_type->get_or_make_type().type,
4078 get_name(instruction.result).c_str()),
4079 result_type);
4080 break;
4081 }
4082 }
4083 }
4084
4085 void Spirv_to_llvm::handle_instruction_op_convert_f_to_s(Op_convert_f_to_s instruction,
4086 std::size_t instruction_start_index)
4087 {
4088 #warning finish
4089 throw Parser_error(instruction_start_index,
4090 instruction_start_index,
4091 "instruction not implemented: "
4092 + std::string(get_enumerant_name(instruction.get_operation())));
4093 }
4094
4095 void Spirv_to_llvm::handle_instruction_op_convert_s_to_f(Op_convert_s_to_f instruction,
4096 std::size_t instruction_start_index)
4097 {
4098 switch(stage)
4099 {
4100 case Stage::calculate_types:
4101 break;
4102 case Stage::generate_code:
4103 {
4104 auto &state = get_id_state(instruction.result);
4105 if(!state.decorations.empty())
4106 throw Parser_error(instruction_start_index,
4107 instruction_start_index,
4108 "decorations on instruction not implemented: "
4109 + std::string(get_enumerant_name(instruction.get_operation())));
4110 auto result_type = get_type(instruction.result_type, instruction_start_index);
4111 state.value =
4112 Value(::LLVMBuildSIToFP(builder.get(),
4113 get_id_state(instruction.signed_value).value.value().value,
4114 result_type->get_or_make_type().type,
4115 get_name(instruction.result).c_str()),
4116 result_type);
4117 break;
4118 }
4119 }
4120 }
4121
4122 void Spirv_to_llvm::handle_instruction_op_convert_u_to_f(Op_convert_u_to_f instruction,
4123 std::size_t instruction_start_index)
4124 {
4125 #warning finish
4126 throw Parser_error(instruction_start_index,
4127 instruction_start_index,
4128 "instruction not implemented: "
4129 + std::string(get_enumerant_name(instruction.get_operation())));
4130 }
4131
4132 void Spirv_to_llvm::handle_instruction_op_u_convert(Op_u_convert instruction,
4133 std::size_t instruction_start_index)
4134 {
4135 switch(stage)
4136 {
4137 case Stage::calculate_types:
4138 break;
4139 case Stage::generate_code:
4140 {
4141 auto &state = get_id_state(instruction.result);
4142 if(!state.decorations.empty())
4143 throw Parser_error(instruction_start_index,
4144 instruction_start_index,
4145 "decorations on instruction not implemented: "
4146 + std::string(get_enumerant_name(instruction.get_operation())));
4147 auto result_type = get_type(instruction.result_type, instruction_start_index);
4148 auto result_type_int_width = ::LLVMGetIntTypeWidth(
4149 llvm_wrapper::get_scalar_or_vector_element_type(result_type->get_or_make_type().type));
4150 auto &arg = get_id_state(instruction.unsigned_value).value.value();
4151 auto arg_int_width = ::LLVMGetIntTypeWidth(
4152 llvm_wrapper::get_scalar_or_vector_element_type(arg.type->get_or_make_type().type));
4153 auto opcode = ::LLVMTrunc;
4154 if(result_type_int_width > arg_int_width)
4155 opcode = ::LLVMZExt;
4156 state.value = Value(::LLVMBuildCast(builder.get(),
4157 opcode,
4158 arg.value,
4159 result_type->get_or_make_type().type,
4160 get_name(instruction.result).c_str()),
4161 result_type);
4162 break;
4163 }
4164 }
4165 }
4166
4167 void Spirv_to_llvm::handle_instruction_op_s_convert(Op_s_convert instruction,
4168 std::size_t instruction_start_index)
4169 {
4170 #warning finish
4171 throw Parser_error(instruction_start_index,
4172 instruction_start_index,
4173 "instruction not implemented: "
4174 + std::string(get_enumerant_name(instruction.get_operation())));
4175 }
4176
4177 void Spirv_to_llvm::handle_instruction_op_f_convert(Op_f_convert instruction,
4178 std::size_t instruction_start_index)
4179 {
4180 #warning finish
4181 throw Parser_error(instruction_start_index,
4182 instruction_start_index,
4183 "instruction not implemented: "
4184 + std::string(get_enumerant_name(instruction.get_operation())));
4185 }
4186
4187 void Spirv_to_llvm::handle_instruction_op_quantize_to_f16(Op_quantize_to_f16 instruction,
4188 std::size_t instruction_start_index)
4189 {
4190 #warning finish
4191 throw Parser_error(instruction_start_index,
4192 instruction_start_index,
4193 "instruction not implemented: "
4194 + std::string(get_enumerant_name(instruction.get_operation())));
4195 }
4196
4197 void Spirv_to_llvm::handle_instruction_op_convert_ptr_to_u(Op_convert_ptr_to_u instruction,
4198 std::size_t instruction_start_index)
4199 {
4200 #warning finish
4201 throw Parser_error(instruction_start_index,
4202 instruction_start_index,
4203 "instruction not implemented: "
4204 + std::string(get_enumerant_name(instruction.get_operation())));
4205 }
4206
4207 void Spirv_to_llvm::handle_instruction_op_sat_convert_s_to_u(Op_sat_convert_s_to_u instruction,
4208 std::size_t instruction_start_index)
4209 {
4210 #warning finish
4211 throw Parser_error(instruction_start_index,
4212 instruction_start_index,
4213 "instruction not implemented: "
4214 + std::string(get_enumerant_name(instruction.get_operation())));
4215 }
4216
4217 void Spirv_to_llvm::handle_instruction_op_sat_convert_u_to_s(Op_sat_convert_u_to_s instruction,
4218 std::size_t instruction_start_index)
4219 {
4220 #warning finish
4221 throw Parser_error(instruction_start_index,
4222 instruction_start_index,
4223 "instruction not implemented: "
4224 + std::string(get_enumerant_name(instruction.get_operation())));
4225 }
4226
4227 void Spirv_to_llvm::handle_instruction_op_convert_u_to_ptr(Op_convert_u_to_ptr instruction,
4228 std::size_t instruction_start_index)
4229 {
4230 #warning finish
4231 throw Parser_error(instruction_start_index,
4232 instruction_start_index,
4233 "instruction not implemented: "
4234 + std::string(get_enumerant_name(instruction.get_operation())));
4235 }
4236
4237 void Spirv_to_llvm::handle_instruction_op_ptr_cast_to_generic(Op_ptr_cast_to_generic instruction,
4238 std::size_t instruction_start_index)
4239 {
4240 #warning finish
4241 throw Parser_error(instruction_start_index,
4242 instruction_start_index,
4243 "instruction not implemented: "
4244 + std::string(get_enumerant_name(instruction.get_operation())));
4245 }
4246
4247 void Spirv_to_llvm::handle_instruction_op_generic_cast_to_ptr(Op_generic_cast_to_ptr instruction,
4248 std::size_t instruction_start_index)
4249 {
4250 #warning finish
4251 throw Parser_error(instruction_start_index,
4252 instruction_start_index,
4253 "instruction not implemented: "
4254 + std::string(get_enumerant_name(instruction.get_operation())));
4255 }
4256
4257 void Spirv_to_llvm::handle_instruction_op_generic_cast_to_ptr_explicit(
4258 Op_generic_cast_to_ptr_explicit instruction, std::size_t instruction_start_index)
4259 {
4260 #warning finish
4261 throw Parser_error(instruction_start_index,
4262 instruction_start_index,
4263 "instruction not implemented: "
4264 + std::string(get_enumerant_name(instruction.get_operation())));
4265 }
4266
4267 void Spirv_to_llvm::handle_instruction_op_bitcast(Op_bitcast instruction,
4268 std::size_t instruction_start_index)
4269 {
4270 switch(stage)
4271 {
4272 case Stage::calculate_types:
4273 break;
4274 case Stage::generate_code:
4275 {
4276 auto &state = get_id_state(instruction.result);
4277 if(!state.decorations.empty())
4278 throw Parser_error(instruction_start_index,
4279 instruction_start_index,
4280 "decorations on instruction not implemented: "
4281 + std::string(get_enumerant_name(instruction.get_operation())));
4282 auto result_type = get_type(instruction.result_type, instruction_start_index);
4283 auto &arg = get_id_state(instruction.operand).value.value();
4284 std::size_t result_element_count = 1; // scalar is equivalent to size 1 vector
4285 std::size_t arg_element_count = 1;
4286 if(auto *t = dynamic_cast<const Vector_type_descriptor *>(result_type.get()))
4287 result_element_count = t->get_element_count();
4288 if(auto *t = dynamic_cast<const Vector_type_descriptor *>(result_type.get()))
4289 arg_element_count = t->get_element_count();
4290 if(result_element_count != arg_element_count)
4291 {
4292 // need to bitcast as if on little endian system even on big endian
4293 #warning finish implementing element-count-changing bitcast
4294 throw Parser_error(instruction_start_index,
4295 instruction_start_index,
4296 "element-count-changing OpBitcast is not implemented");
4297 }
4298 state.value = Value(::LLVMBuildBitCast(builder.get(),
4299 arg.value,
4300 result_type->get_or_make_type().type,
4301 get_name(instruction.result).c_str()),
4302 result_type);
4303 break;
4304 }
4305 }
4306 }
4307
4308 void Spirv_to_llvm::handle_instruction_op_s_negate(Op_s_negate instruction,
4309 std::size_t instruction_start_index)
4310 {
4311 #warning finish
4312 throw Parser_error(instruction_start_index,
4313 instruction_start_index,
4314 "instruction not implemented: "
4315 + std::string(get_enumerant_name(instruction.get_operation())));
4316 }
4317
4318 void Spirv_to_llvm::handle_instruction_op_f_negate(Op_f_negate instruction,
4319 std::size_t instruction_start_index)
4320 {
4321 #warning finish
4322 throw Parser_error(instruction_start_index,
4323 instruction_start_index,
4324 "instruction not implemented: "
4325 + std::string(get_enumerant_name(instruction.get_operation())));
4326 }
4327
4328 void Spirv_to_llvm::handle_instruction_op_i_add(Op_i_add instruction,
4329 std::size_t instruction_start_index)
4330 {
4331 #warning finish
4332 throw Parser_error(instruction_start_index,
4333 instruction_start_index,
4334 "instruction not implemented: "
4335 + std::string(get_enumerant_name(instruction.get_operation())));
4336 }
4337
4338 void Spirv_to_llvm::handle_instruction_op_f_add(Op_f_add instruction,
4339 std::size_t instruction_start_index)
4340 {
4341 #warning finish
4342 throw Parser_error(instruction_start_index,
4343 instruction_start_index,
4344 "instruction not implemented: "
4345 + std::string(get_enumerant_name(instruction.get_operation())));
4346 }
4347
4348 void Spirv_to_llvm::handle_instruction_op_i_sub(Op_i_sub instruction,
4349 std::size_t instruction_start_index)
4350 {
4351 #warning finish
4352 throw Parser_error(instruction_start_index,
4353 instruction_start_index,
4354 "instruction not implemented: "
4355 + std::string(get_enumerant_name(instruction.get_operation())));
4356 }
4357
4358 void Spirv_to_llvm::handle_instruction_op_f_sub(Op_f_sub instruction,
4359 std::size_t instruction_start_index)
4360 {
4361 #warning finish
4362 throw Parser_error(instruction_start_index,
4363 instruction_start_index,
4364 "instruction not implemented: "
4365 + std::string(get_enumerant_name(instruction.get_operation())));
4366 }
4367
4368 void Spirv_to_llvm::handle_instruction_op_i_mul(Op_i_mul instruction,
4369 std::size_t instruction_start_index)
4370 {
4371 #warning finish
4372 throw Parser_error(instruction_start_index,
4373 instruction_start_index,
4374 "instruction not implemented: "
4375 + std::string(get_enumerant_name(instruction.get_operation())));
4376 }
4377
4378 void Spirv_to_llvm::handle_instruction_op_f_mul(Op_f_mul instruction,
4379 std::size_t instruction_start_index)
4380 {
4381 switch(stage)
4382 {
4383 case Stage::calculate_types:
4384 break;
4385 case Stage::generate_code:
4386 {
4387 auto &state = get_id_state(instruction.result);
4388 if(!state.decorations.empty())
4389 throw Parser_error(instruction_start_index,
4390 instruction_start_index,
4391 "decorations on instruction not implemented: "
4392 + std::string(get_enumerant_name(instruction.get_operation())));
4393 auto result_type = get_type(instruction.result_type, instruction_start_index);
4394 state.value = Value(::LLVMBuildFMul(builder.get(),
4395 get_id_state(instruction.operand_1).value.value().value,
4396 get_id_state(instruction.operand_2).value.value().value,
4397 get_name(instruction.result).c_str()),
4398 result_type);
4399 break;
4400 }
4401 }
4402 }
4403
4404 void Spirv_to_llvm::handle_instruction_op_u_div(Op_u_div instruction,
4405 std::size_t instruction_start_index)
4406 {
4407 #warning finish
4408 throw Parser_error(instruction_start_index,
4409 instruction_start_index,
4410 "instruction not implemented: "
4411 + std::string(get_enumerant_name(instruction.get_operation())));
4412 }
4413
4414 void Spirv_to_llvm::handle_instruction_op_s_div(Op_s_div instruction,
4415 std::size_t instruction_start_index)
4416 {
4417 #warning finish
4418 throw Parser_error(instruction_start_index,
4419 instruction_start_index,
4420 "instruction not implemented: "
4421 + std::string(get_enumerant_name(instruction.get_operation())));
4422 }
4423
4424 void Spirv_to_llvm::handle_instruction_op_f_div(Op_f_div instruction,
4425 std::size_t instruction_start_index)
4426 {
4427 #warning finish
4428 throw Parser_error(instruction_start_index,
4429 instruction_start_index,
4430 "instruction not implemented: "
4431 + std::string(get_enumerant_name(instruction.get_operation())));
4432 }
4433
4434 void Spirv_to_llvm::handle_instruction_op_u_mod(Op_u_mod instruction,
4435 std::size_t instruction_start_index)
4436 {
4437 #warning finish
4438 throw Parser_error(instruction_start_index,
4439 instruction_start_index,
4440 "instruction not implemented: "
4441 + std::string(get_enumerant_name(instruction.get_operation())));
4442 }
4443
4444 void Spirv_to_llvm::handle_instruction_op_s_rem(Op_s_rem instruction,
4445 std::size_t instruction_start_index)
4446 {
4447 #warning finish
4448 throw Parser_error(instruction_start_index,
4449 instruction_start_index,
4450 "instruction not implemented: "
4451 + std::string(get_enumerant_name(instruction.get_operation())));
4452 }
4453
4454 void Spirv_to_llvm::handle_instruction_op_s_mod(Op_s_mod instruction,
4455 std::size_t instruction_start_index)
4456 {
4457 switch(stage)
4458 {
4459 case Stage::calculate_types:
4460 break;
4461 case Stage::generate_code:
4462 {
4463 auto &state = get_id_state(instruction.result);
4464 if(!state.decorations.empty())
4465 throw Parser_error(instruction_start_index,
4466 instruction_start_index,
4467 "decorations on instruction not implemented: "
4468 + std::string(get_enumerant_name(instruction.get_operation())));
4469 auto result_type = get_type(instruction.result_type, instruction_start_index);
4470 state.value =
4471 Value(builder.build_smod(get_id_state(instruction.operand_1).value.value().value,
4472 get_id_state(instruction.operand_2).value.value().value,
4473 get_name(instruction.result).c_str()),
4474 result_type);
4475 break;
4476 }
4477 }
4478 }
4479
4480 void Spirv_to_llvm::handle_instruction_op_f_rem(Op_f_rem instruction,
4481 std::size_t instruction_start_index)
4482 {
4483 #warning finish
4484 throw Parser_error(instruction_start_index,
4485 instruction_start_index,
4486 "instruction not implemented: "
4487 + std::string(get_enumerant_name(instruction.get_operation())));
4488 }
4489
4490 void Spirv_to_llvm::handle_instruction_op_f_mod(Op_f_mod instruction,
4491 std::size_t instruction_start_index)
4492 {
4493 #warning finish
4494 throw Parser_error(instruction_start_index,
4495 instruction_start_index,
4496 "instruction not implemented: "
4497 + std::string(get_enumerant_name(instruction.get_operation())));
4498 }
4499
4500 void Spirv_to_llvm::handle_instruction_op_vector_times_scalar(Op_vector_times_scalar instruction,
4501 std::size_t instruction_start_index)
4502 {
4503 #warning finish
4504 throw Parser_error(instruction_start_index,
4505 instruction_start_index,
4506 "instruction not implemented: "
4507 + std::string(get_enumerant_name(instruction.get_operation())));
4508 }
4509
4510 void Spirv_to_llvm::handle_instruction_op_matrix_times_scalar(Op_matrix_times_scalar instruction,
4511 std::size_t instruction_start_index)
4512 {
4513 #warning finish
4514 throw Parser_error(instruction_start_index,
4515 instruction_start_index,
4516 "instruction not implemented: "
4517 + std::string(get_enumerant_name(instruction.get_operation())));
4518 }
4519
4520 void Spirv_to_llvm::handle_instruction_op_vector_times_matrix(Op_vector_times_matrix instruction,
4521 std::size_t instruction_start_index)
4522 {
4523 #warning finish
4524 throw Parser_error(instruction_start_index,
4525 instruction_start_index,
4526 "instruction not implemented: "
4527 + std::string(get_enumerant_name(instruction.get_operation())));
4528 }
4529
4530 void Spirv_to_llvm::handle_instruction_op_matrix_times_vector(Op_matrix_times_vector instruction,
4531 std::size_t instruction_start_index)
4532 {
4533 #warning finish
4534 throw Parser_error(instruction_start_index,
4535 instruction_start_index,
4536 "instruction not implemented: "
4537 + std::string(get_enumerant_name(instruction.get_operation())));
4538 }
4539
4540 void Spirv_to_llvm::handle_instruction_op_matrix_times_matrix(Op_matrix_times_matrix instruction,
4541 std::size_t instruction_start_index)
4542 {
4543 #warning finish
4544 throw Parser_error(instruction_start_index,
4545 instruction_start_index,
4546 "instruction not implemented: "
4547 + std::string(get_enumerant_name(instruction.get_operation())));
4548 }
4549
4550 void Spirv_to_llvm::handle_instruction_op_outer_product(Op_outer_product instruction,
4551 std::size_t instruction_start_index)
4552 {
4553 #warning finish
4554 throw Parser_error(instruction_start_index,
4555 instruction_start_index,
4556 "instruction not implemented: "
4557 + std::string(get_enumerant_name(instruction.get_operation())));
4558 }
4559
4560 void Spirv_to_llvm::handle_instruction_op_dot(Op_dot instruction,
4561 std::size_t instruction_start_index)
4562 {
4563 #warning finish
4564 throw Parser_error(instruction_start_index,
4565 instruction_start_index,
4566 "instruction not implemented: "
4567 + std::string(get_enumerant_name(instruction.get_operation())));
4568 }
4569
4570 void Spirv_to_llvm::handle_instruction_op_i_add_carry(Op_i_add_carry instruction,
4571 std::size_t instruction_start_index)
4572 {
4573 #warning finish
4574 throw Parser_error(instruction_start_index,
4575 instruction_start_index,
4576 "instruction not implemented: "
4577 + std::string(get_enumerant_name(instruction.get_operation())));
4578 }
4579
4580 void Spirv_to_llvm::handle_instruction_op_i_sub_borrow(Op_i_sub_borrow instruction,
4581 std::size_t instruction_start_index)
4582 {
4583 #warning finish
4584 throw Parser_error(instruction_start_index,
4585 instruction_start_index,
4586 "instruction not implemented: "
4587 + std::string(get_enumerant_name(instruction.get_operation())));
4588 }
4589
4590 void Spirv_to_llvm::handle_instruction_op_u_mul_extended(Op_u_mul_extended instruction,
4591 std::size_t instruction_start_index)
4592 {
4593 #warning finish
4594 throw Parser_error(instruction_start_index,
4595 instruction_start_index,
4596 "instruction not implemented: "
4597 + std::string(get_enumerant_name(instruction.get_operation())));
4598 }
4599
4600 void Spirv_to_llvm::handle_instruction_op_s_mul_extended(Op_s_mul_extended instruction,
4601 std::size_t instruction_start_index)
4602 {
4603 #warning finish
4604 throw Parser_error(instruction_start_index,
4605 instruction_start_index,
4606 "instruction not implemented: "
4607 + std::string(get_enumerant_name(instruction.get_operation())));
4608 }
4609
4610 void Spirv_to_llvm::handle_instruction_op_any(Op_any instruction,
4611 std::size_t instruction_start_index)
4612 {
4613 #warning finish
4614 throw Parser_error(instruction_start_index,
4615 instruction_start_index,
4616 "instruction not implemented: "
4617 + std::string(get_enumerant_name(instruction.get_operation())));
4618 }
4619
4620 void Spirv_to_llvm::handle_instruction_op_all(Op_all instruction,
4621 std::size_t instruction_start_index)
4622 {
4623 #warning finish
4624 throw Parser_error(instruction_start_index,
4625 instruction_start_index,
4626 "instruction not implemented: "
4627 + std::string(get_enumerant_name(instruction.get_operation())));
4628 }
4629
4630 void Spirv_to_llvm::handle_instruction_op_is_nan(Op_is_nan instruction,
4631 std::size_t instruction_start_index)
4632 {
4633 #warning finish
4634 throw Parser_error(instruction_start_index,
4635 instruction_start_index,
4636 "instruction not implemented: "
4637 + std::string(get_enumerant_name(instruction.get_operation())));
4638 }
4639
4640 void Spirv_to_llvm::handle_instruction_op_is_inf(Op_is_inf instruction,
4641 std::size_t instruction_start_index)
4642 {
4643 #warning finish
4644 throw Parser_error(instruction_start_index,
4645 instruction_start_index,
4646 "instruction not implemented: "
4647 + std::string(get_enumerant_name(instruction.get_operation())));
4648 }
4649
4650 void Spirv_to_llvm::handle_instruction_op_is_finite(Op_is_finite instruction,
4651 std::size_t instruction_start_index)
4652 {
4653 #warning finish
4654 throw Parser_error(instruction_start_index,
4655 instruction_start_index,
4656 "instruction not implemented: "
4657 + std::string(get_enumerant_name(instruction.get_operation())));
4658 }
4659
4660 void Spirv_to_llvm::handle_instruction_op_is_normal(Op_is_normal instruction,
4661 std::size_t instruction_start_index)
4662 {
4663 #warning finish
4664 throw Parser_error(instruction_start_index,
4665 instruction_start_index,
4666 "instruction not implemented: "
4667 + std::string(get_enumerant_name(instruction.get_operation())));
4668 }
4669
4670 void Spirv_to_llvm::handle_instruction_op_sign_bit_set(Op_sign_bit_set instruction,
4671 std::size_t instruction_start_index)
4672 {
4673 #warning finish
4674 throw Parser_error(instruction_start_index,
4675 instruction_start_index,
4676 "instruction not implemented: "
4677 + std::string(get_enumerant_name(instruction.get_operation())));
4678 }
4679
4680 void Spirv_to_llvm::handle_instruction_op_less_or_greater(Op_less_or_greater instruction,
4681 std::size_t instruction_start_index)
4682 {
4683 #warning finish
4684 throw Parser_error(instruction_start_index,
4685 instruction_start_index,
4686 "instruction not implemented: "
4687 + std::string(get_enumerant_name(instruction.get_operation())));
4688 }
4689
4690 void Spirv_to_llvm::handle_instruction_op_ordered(Op_ordered instruction,
4691 std::size_t instruction_start_index)
4692 {
4693 #warning finish
4694 throw Parser_error(instruction_start_index,
4695 instruction_start_index,
4696 "instruction not implemented: "
4697 + std::string(get_enumerant_name(instruction.get_operation())));
4698 }
4699
4700 void Spirv_to_llvm::handle_instruction_op_unordered(Op_unordered instruction,
4701 std::size_t instruction_start_index)
4702 {
4703 #warning finish
4704 throw Parser_error(instruction_start_index,
4705 instruction_start_index,
4706 "instruction not implemented: "
4707 + std::string(get_enumerant_name(instruction.get_operation())));
4708 }
4709
4710 void Spirv_to_llvm::handle_instruction_op_logical_equal(Op_logical_equal instruction,
4711 std::size_t instruction_start_index)
4712 {
4713 #warning finish
4714 throw Parser_error(instruction_start_index,
4715 instruction_start_index,
4716 "instruction not implemented: "
4717 + std::string(get_enumerant_name(instruction.get_operation())));
4718 }
4719
4720 void Spirv_to_llvm::handle_instruction_op_logical_not_equal(Op_logical_not_equal instruction,
4721 std::size_t instruction_start_index)
4722 {
4723 #warning finish
4724 throw Parser_error(instruction_start_index,
4725 instruction_start_index,
4726 "instruction not implemented: "
4727 + std::string(get_enumerant_name(instruction.get_operation())));
4728 }
4729
4730 void Spirv_to_llvm::handle_instruction_op_logical_or(Op_logical_or instruction,
4731 std::size_t instruction_start_index)
4732 {
4733 #warning finish
4734 throw Parser_error(instruction_start_index,
4735 instruction_start_index,
4736 "instruction not implemented: "
4737 + std::string(get_enumerant_name(instruction.get_operation())));
4738 }
4739
4740 void Spirv_to_llvm::handle_instruction_op_logical_and(Op_logical_and instruction,
4741 std::size_t instruction_start_index)
4742 {
4743 #warning finish
4744 throw Parser_error(instruction_start_index,
4745 instruction_start_index,
4746 "instruction not implemented: "
4747 + std::string(get_enumerant_name(instruction.get_operation())));
4748 }
4749
4750 void Spirv_to_llvm::handle_instruction_op_logical_not(Op_logical_not instruction,
4751 std::size_t instruction_start_index)
4752 {
4753 #warning finish
4754 throw Parser_error(instruction_start_index,
4755 instruction_start_index,
4756 "instruction not implemented: "
4757 + std::string(get_enumerant_name(instruction.get_operation())));
4758 }
4759
4760 void Spirv_to_llvm::handle_instruction_op_select(Op_select instruction,
4761 std::size_t instruction_start_index)
4762 {
4763 #warning finish
4764 throw Parser_error(instruction_start_index,
4765 instruction_start_index,
4766 "instruction not implemented: "
4767 + std::string(get_enumerant_name(instruction.get_operation())));
4768 }
4769
4770 void Spirv_to_llvm::handle_instruction_op_i_equal(Op_i_equal instruction,
4771 std::size_t instruction_start_index)
4772 {
4773 #warning finish
4774 throw Parser_error(instruction_start_index,
4775 instruction_start_index,
4776 "instruction not implemented: "
4777 + std::string(get_enumerant_name(instruction.get_operation())));
4778 }
4779
4780 void Spirv_to_llvm::handle_instruction_op_i_not_equal(Op_i_not_equal instruction,
4781 std::size_t instruction_start_index)
4782 {
4783 #warning finish
4784 throw Parser_error(instruction_start_index,
4785 instruction_start_index,
4786 "instruction not implemented: "
4787 + std::string(get_enumerant_name(instruction.get_operation())));
4788 }
4789
4790 void Spirv_to_llvm::handle_instruction_op_u_greater_than(Op_u_greater_than instruction,
4791 std::size_t instruction_start_index)
4792 {
4793 #warning finish
4794 throw Parser_error(instruction_start_index,
4795 instruction_start_index,
4796 "instruction not implemented: "
4797 + std::string(get_enumerant_name(instruction.get_operation())));
4798 }
4799
4800 void Spirv_to_llvm::handle_instruction_op_s_greater_than(Op_s_greater_than instruction,
4801 std::size_t instruction_start_index)
4802 {
4803 #warning finish
4804 throw Parser_error(instruction_start_index,
4805 instruction_start_index,
4806 "instruction not implemented: "
4807 + std::string(get_enumerant_name(instruction.get_operation())));
4808 }
4809
4810 void Spirv_to_llvm::handle_instruction_op_u_greater_than_equal(Op_u_greater_than_equal instruction,
4811 std::size_t instruction_start_index)
4812 {
4813 #warning finish
4814 throw Parser_error(instruction_start_index,
4815 instruction_start_index,
4816 "instruction not implemented: "
4817 + std::string(get_enumerant_name(instruction.get_operation())));
4818 }
4819
4820 void Spirv_to_llvm::handle_instruction_op_s_greater_than_equal(Op_s_greater_than_equal instruction,
4821 std::size_t instruction_start_index)
4822 {
4823 #warning finish
4824 throw Parser_error(instruction_start_index,
4825 instruction_start_index,
4826 "instruction not implemented: "
4827 + std::string(get_enumerant_name(instruction.get_operation())));
4828 }
4829
4830 void Spirv_to_llvm::handle_instruction_op_u_less_than(Op_u_less_than instruction,
4831 std::size_t instruction_start_index)
4832 {
4833 #warning finish
4834 throw Parser_error(instruction_start_index,
4835 instruction_start_index,
4836 "instruction not implemented: "
4837 + std::string(get_enumerant_name(instruction.get_operation())));
4838 }
4839
4840 void Spirv_to_llvm::handle_instruction_op_s_less_than(Op_s_less_than instruction,
4841 std::size_t instruction_start_index)
4842 {
4843 #warning finish
4844 throw Parser_error(instruction_start_index,
4845 instruction_start_index,
4846 "instruction not implemented: "
4847 + std::string(get_enumerant_name(instruction.get_operation())));
4848 }
4849
4850 void Spirv_to_llvm::handle_instruction_op_u_less_than_equal(Op_u_less_than_equal instruction,
4851 std::size_t instruction_start_index)
4852 {
4853 #warning finish
4854 throw Parser_error(instruction_start_index,
4855 instruction_start_index,
4856 "instruction not implemented: "
4857 + std::string(get_enumerant_name(instruction.get_operation())));
4858 }
4859
4860 void Spirv_to_llvm::handle_instruction_op_s_less_than_equal(Op_s_less_than_equal instruction,
4861 std::size_t instruction_start_index)
4862 {
4863 #warning finish
4864 throw Parser_error(instruction_start_index,
4865 instruction_start_index,
4866 "instruction not implemented: "
4867 + std::string(get_enumerant_name(instruction.get_operation())));
4868 }
4869
4870 void Spirv_to_llvm::handle_instruction_op_f_ord_equal(Op_f_ord_equal instruction,
4871 std::size_t instruction_start_index)
4872 {
4873 #warning finish
4874 throw Parser_error(instruction_start_index,
4875 instruction_start_index,
4876 "instruction not implemented: "
4877 + std::string(get_enumerant_name(instruction.get_operation())));
4878 }
4879
4880 void Spirv_to_llvm::handle_instruction_op_f_unord_equal(Op_f_unord_equal instruction,
4881 std::size_t instruction_start_index)
4882 {
4883 #warning finish
4884 throw Parser_error(instruction_start_index,
4885 instruction_start_index,
4886 "instruction not implemented: "
4887 + std::string(get_enumerant_name(instruction.get_operation())));
4888 }
4889
4890 void Spirv_to_llvm::handle_instruction_op_f_ord_not_equal(Op_f_ord_not_equal instruction,
4891 std::size_t instruction_start_index)
4892 {
4893 #warning finish
4894 throw Parser_error(instruction_start_index,
4895 instruction_start_index,
4896 "instruction not implemented: "
4897 + std::string(get_enumerant_name(instruction.get_operation())));
4898 }
4899
4900 void Spirv_to_llvm::handle_instruction_op_f_unord_not_equal(Op_f_unord_not_equal instruction,
4901 std::size_t instruction_start_index)
4902 {
4903 #warning finish
4904 throw Parser_error(instruction_start_index,
4905 instruction_start_index,
4906 "instruction not implemented: "
4907 + std::string(get_enumerant_name(instruction.get_operation())));
4908 }
4909
4910 void Spirv_to_llvm::handle_instruction_op_f_ord_less_than(Op_f_ord_less_than instruction,
4911 std::size_t instruction_start_index)
4912 {
4913 #warning finish
4914 throw Parser_error(instruction_start_index,
4915 instruction_start_index,
4916 "instruction not implemented: "
4917 + std::string(get_enumerant_name(instruction.get_operation())));
4918 }
4919
4920 void Spirv_to_llvm::handle_instruction_op_f_unord_less_than(Op_f_unord_less_than instruction,
4921 std::size_t instruction_start_index)
4922 {
4923 #warning finish
4924 throw Parser_error(instruction_start_index,
4925 instruction_start_index,
4926 "instruction not implemented: "
4927 + std::string(get_enumerant_name(instruction.get_operation())));
4928 }
4929
4930 void Spirv_to_llvm::handle_instruction_op_f_ord_greater_than(Op_f_ord_greater_than instruction,
4931 std::size_t instruction_start_index)
4932 {
4933 #warning finish
4934 throw Parser_error(instruction_start_index,
4935 instruction_start_index,
4936 "instruction not implemented: "
4937 + std::string(get_enumerant_name(instruction.get_operation())));
4938 }
4939
4940 void Spirv_to_llvm::handle_instruction_op_f_unord_greater_than(Op_f_unord_greater_than instruction,
4941 std::size_t instruction_start_index)
4942 {
4943 #warning finish
4944 throw Parser_error(instruction_start_index,
4945 instruction_start_index,
4946 "instruction not implemented: "
4947 + std::string(get_enumerant_name(instruction.get_operation())));
4948 }
4949
4950 void Spirv_to_llvm::handle_instruction_op_f_ord_less_than_equal(
4951 Op_f_ord_less_than_equal instruction, std::size_t instruction_start_index)
4952 {
4953 #warning finish
4954 throw Parser_error(instruction_start_index,
4955 instruction_start_index,
4956 "instruction not implemented: "
4957 + std::string(get_enumerant_name(instruction.get_operation())));
4958 }
4959
4960 void Spirv_to_llvm::handle_instruction_op_f_unord_less_than_equal(
4961 Op_f_unord_less_than_equal instruction, std::size_t instruction_start_index)
4962 {
4963 #warning finish
4964 throw Parser_error(instruction_start_index,
4965 instruction_start_index,
4966 "instruction not implemented: "
4967 + std::string(get_enumerant_name(instruction.get_operation())));
4968 }
4969
4970 void Spirv_to_llvm::handle_instruction_op_f_ord_greater_than_equal(
4971 Op_f_ord_greater_than_equal instruction, std::size_t instruction_start_index)
4972 {
4973 #warning finish
4974 throw Parser_error(instruction_start_index,
4975 instruction_start_index,
4976 "instruction not implemented: "
4977 + std::string(get_enumerant_name(instruction.get_operation())));
4978 }
4979
4980 void Spirv_to_llvm::handle_instruction_op_f_unord_greater_than_equal(
4981 Op_f_unord_greater_than_equal instruction, std::size_t instruction_start_index)
4982 {
4983 #warning finish
4984 throw Parser_error(instruction_start_index,
4985 instruction_start_index,
4986 "instruction not implemented: "
4987 + std::string(get_enumerant_name(instruction.get_operation())));
4988 }
4989
4990 void Spirv_to_llvm::handle_instruction_op_shift_right_logical(Op_shift_right_logical instruction,
4991 std::size_t instruction_start_index)
4992 {
4993 #warning finish
4994 throw Parser_error(instruction_start_index,
4995 instruction_start_index,
4996 "instruction not implemented: "
4997 + std::string(get_enumerant_name(instruction.get_operation())));
4998 }
4999
5000 void Spirv_to_llvm::handle_instruction_op_shift_right_arithmetic(
5001 Op_shift_right_arithmetic instruction, std::size_t instruction_start_index)
5002 {
5003 #warning finish
5004 throw Parser_error(instruction_start_index,
5005 instruction_start_index,
5006 "instruction not implemented: "
5007 + std::string(get_enumerant_name(instruction.get_operation())));
5008 }
5009
5010 void Spirv_to_llvm::handle_instruction_op_shift_left_logical(Op_shift_left_logical instruction,
5011 std::size_t instruction_start_index)
5012 {
5013 #warning finish
5014 throw Parser_error(instruction_start_index,
5015 instruction_start_index,
5016 "instruction not implemented: "
5017 + std::string(get_enumerant_name(instruction.get_operation())));
5018 }
5019
5020 void Spirv_to_llvm::handle_instruction_op_bitwise_or(Op_bitwise_or instruction,
5021 std::size_t instruction_start_index)
5022 {
5023 #warning finish
5024 throw Parser_error(instruction_start_index,
5025 instruction_start_index,
5026 "instruction not implemented: "
5027 + std::string(get_enumerant_name(instruction.get_operation())));
5028 }
5029
5030 void Spirv_to_llvm::handle_instruction_op_bitwise_xor(Op_bitwise_xor instruction,
5031 std::size_t instruction_start_index)
5032 {
5033 #warning finish
5034 throw Parser_error(instruction_start_index,
5035 instruction_start_index,
5036 "instruction not implemented: "
5037 + std::string(get_enumerant_name(instruction.get_operation())));
5038 }
5039
5040 void Spirv_to_llvm::handle_instruction_op_bitwise_and(Op_bitwise_and instruction,
5041 std::size_t instruction_start_index)
5042 {
5043 #warning finish
5044 throw Parser_error(instruction_start_index,
5045 instruction_start_index,
5046 "instruction not implemented: "
5047 + std::string(get_enumerant_name(instruction.get_operation())));
5048 }
5049
5050 void Spirv_to_llvm::handle_instruction_op_not(Op_not instruction,
5051 std::size_t instruction_start_index)
5052 {
5053 #warning finish
5054 throw Parser_error(instruction_start_index,
5055 instruction_start_index,
5056 "instruction not implemented: "
5057 + std::string(get_enumerant_name(instruction.get_operation())));
5058 }
5059
5060 void Spirv_to_llvm::handle_instruction_op_bit_field_insert(Op_bit_field_insert instruction,
5061 std::size_t instruction_start_index)
5062 {
5063 #warning finish
5064 throw Parser_error(instruction_start_index,
5065 instruction_start_index,
5066 "instruction not implemented: "
5067 + std::string(get_enumerant_name(instruction.get_operation())));
5068 }
5069
5070 void Spirv_to_llvm::handle_instruction_op_bit_field_s_extract(Op_bit_field_s_extract instruction,
5071 std::size_t instruction_start_index)
5072 {
5073 #warning finish
5074 throw Parser_error(instruction_start_index,
5075 instruction_start_index,
5076 "instruction not implemented: "
5077 + std::string(get_enumerant_name(instruction.get_operation())));
5078 }
5079
5080 void Spirv_to_llvm::handle_instruction_op_bit_field_u_extract(Op_bit_field_u_extract instruction,
5081 std::size_t instruction_start_index)
5082 {
5083 #warning finish
5084 throw Parser_error(instruction_start_index,
5085 instruction_start_index,
5086 "instruction not implemented: "
5087 + std::string(get_enumerant_name(instruction.get_operation())));
5088 }
5089
5090 void Spirv_to_llvm::handle_instruction_op_bit_reverse(Op_bit_reverse instruction,
5091 std::size_t instruction_start_index)
5092 {
5093 #warning finish
5094 throw Parser_error(instruction_start_index,
5095 instruction_start_index,
5096 "instruction not implemented: "
5097 + std::string(get_enumerant_name(instruction.get_operation())));
5098 }
5099
5100 void Spirv_to_llvm::handle_instruction_op_bit_count(Op_bit_count instruction,
5101 std::size_t instruction_start_index)
5102 {
5103 #warning finish
5104 throw Parser_error(instruction_start_index,
5105 instruction_start_index,
5106 "instruction not implemented: "
5107 + std::string(get_enumerant_name(instruction.get_operation())));
5108 }
5109
5110 void Spirv_to_llvm::handle_instruction_op_d_pdx(Op_d_pdx instruction,
5111 std::size_t instruction_start_index)
5112 {
5113 #warning finish
5114 throw Parser_error(instruction_start_index,
5115 instruction_start_index,
5116 "instruction not implemented: "
5117 + std::string(get_enumerant_name(instruction.get_operation())));
5118 }
5119
5120 void Spirv_to_llvm::handle_instruction_op_d_pdy(Op_d_pdy instruction,
5121 std::size_t instruction_start_index)
5122 {
5123 #warning finish
5124 throw Parser_error(instruction_start_index,
5125 instruction_start_index,
5126 "instruction not implemented: "
5127 + std::string(get_enumerant_name(instruction.get_operation())));
5128 }
5129
5130 void Spirv_to_llvm::handle_instruction_op_fwidth(Op_fwidth instruction,
5131 std::size_t instruction_start_index)
5132 {
5133 #warning finish
5134 throw Parser_error(instruction_start_index,
5135 instruction_start_index,
5136 "instruction not implemented: "
5137 + std::string(get_enumerant_name(instruction.get_operation())));
5138 }
5139
5140 void Spirv_to_llvm::handle_instruction_op_d_pdx_fine(Op_d_pdx_fine instruction,
5141 std::size_t instruction_start_index)
5142 {
5143 #warning finish
5144 throw Parser_error(instruction_start_index,
5145 instruction_start_index,
5146 "instruction not implemented: "
5147 + std::string(get_enumerant_name(instruction.get_operation())));
5148 }
5149
5150 void Spirv_to_llvm::handle_instruction_op_d_pdy_fine(Op_d_pdy_fine instruction,
5151 std::size_t instruction_start_index)
5152 {
5153 #warning finish
5154 throw Parser_error(instruction_start_index,
5155 instruction_start_index,
5156 "instruction not implemented: "
5157 + std::string(get_enumerant_name(instruction.get_operation())));
5158 }
5159
5160 void Spirv_to_llvm::handle_instruction_op_fwidth_fine(Op_fwidth_fine instruction,
5161 std::size_t instruction_start_index)
5162 {
5163 #warning finish
5164 throw Parser_error(instruction_start_index,
5165 instruction_start_index,
5166 "instruction not implemented: "
5167 + std::string(get_enumerant_name(instruction.get_operation())));
5168 }
5169
5170 void Spirv_to_llvm::handle_instruction_op_d_pdx_coarse(Op_d_pdx_coarse instruction,
5171 std::size_t instruction_start_index)
5172 {
5173 #warning finish
5174 throw Parser_error(instruction_start_index,
5175 instruction_start_index,
5176 "instruction not implemented: "
5177 + std::string(get_enumerant_name(instruction.get_operation())));
5178 }
5179
5180 void Spirv_to_llvm::handle_instruction_op_d_pdy_coarse(Op_d_pdy_coarse instruction,
5181 std::size_t instruction_start_index)
5182 {
5183 #warning finish
5184 throw Parser_error(instruction_start_index,
5185 instruction_start_index,
5186 "instruction not implemented: "
5187 + std::string(get_enumerant_name(instruction.get_operation())));
5188 }
5189
5190 void Spirv_to_llvm::handle_instruction_op_fwidth_coarse(Op_fwidth_coarse instruction,
5191 std::size_t instruction_start_index)
5192 {
5193 #warning finish
5194 throw Parser_error(instruction_start_index,
5195 instruction_start_index,
5196 "instruction not implemented: "
5197 + std::string(get_enumerant_name(instruction.get_operation())));
5198 }
5199
5200 void Spirv_to_llvm::handle_instruction_op_emit_vertex(Op_emit_vertex instruction,
5201 std::size_t instruction_start_index)
5202 {
5203 #warning finish
5204 throw Parser_error(instruction_start_index,
5205 instruction_start_index,
5206 "instruction not implemented: "
5207 + std::string(get_enumerant_name(instruction.get_operation())));
5208 }
5209
5210 void Spirv_to_llvm::handle_instruction_op_end_primitive(Op_end_primitive instruction,
5211 std::size_t instruction_start_index)
5212 {
5213 #warning finish
5214 throw Parser_error(instruction_start_index,
5215 instruction_start_index,
5216 "instruction not implemented: "
5217 + std::string(get_enumerant_name(instruction.get_operation())));
5218 }
5219
5220 void Spirv_to_llvm::handle_instruction_op_emit_stream_vertex(Op_emit_stream_vertex instruction,
5221 std::size_t instruction_start_index)
5222 {
5223 #warning finish
5224 throw Parser_error(instruction_start_index,
5225 instruction_start_index,
5226 "instruction not implemented: "
5227 + std::string(get_enumerant_name(instruction.get_operation())));
5228 }
5229
5230 void Spirv_to_llvm::handle_instruction_op_end_stream_primitive(Op_end_stream_primitive instruction,
5231 std::size_t instruction_start_index)
5232 {
5233 #warning finish
5234 throw Parser_error(instruction_start_index,
5235 instruction_start_index,
5236 "instruction not implemented: "
5237 + std::string(get_enumerant_name(instruction.get_operation())));
5238 }
5239
5240 void Spirv_to_llvm::handle_instruction_op_control_barrier(Op_control_barrier instruction,
5241 std::size_t instruction_start_index)
5242 {
5243 #warning finish
5244 throw Parser_error(instruction_start_index,
5245 instruction_start_index,
5246 "instruction not implemented: "
5247 + std::string(get_enumerant_name(instruction.get_operation())));
5248 }
5249
5250 void Spirv_to_llvm::handle_instruction_op_memory_barrier(Op_memory_barrier instruction,
5251 std::size_t instruction_start_index)
5252 {
5253 #warning finish
5254 throw Parser_error(instruction_start_index,
5255 instruction_start_index,
5256 "instruction not implemented: "
5257 + std::string(get_enumerant_name(instruction.get_operation())));
5258 }
5259
5260 void Spirv_to_llvm::handle_instruction_op_atomic_load(Op_atomic_load instruction,
5261 std::size_t instruction_start_index)
5262 {
5263 #warning finish
5264 throw Parser_error(instruction_start_index,
5265 instruction_start_index,
5266 "instruction not implemented: "
5267 + std::string(get_enumerant_name(instruction.get_operation())));
5268 }
5269
5270 void Spirv_to_llvm::handle_instruction_op_atomic_store(Op_atomic_store instruction,
5271 std::size_t instruction_start_index)
5272 {
5273 #warning finish
5274 throw Parser_error(instruction_start_index,
5275 instruction_start_index,
5276 "instruction not implemented: "
5277 + std::string(get_enumerant_name(instruction.get_operation())));
5278 }
5279
5280 void Spirv_to_llvm::handle_instruction_op_atomic_exchange(Op_atomic_exchange instruction,
5281 std::size_t instruction_start_index)
5282 {
5283 #warning finish
5284 throw Parser_error(instruction_start_index,
5285 instruction_start_index,
5286 "instruction not implemented: "
5287 + std::string(get_enumerant_name(instruction.get_operation())));
5288 }
5289
5290 void Spirv_to_llvm::handle_instruction_op_atomic_compare_exchange(
5291 Op_atomic_compare_exchange instruction, std::size_t instruction_start_index)
5292 {
5293 #warning finish
5294 throw Parser_error(instruction_start_index,
5295 instruction_start_index,
5296 "instruction not implemented: "
5297 + std::string(get_enumerant_name(instruction.get_operation())));
5298 }
5299
5300 void Spirv_to_llvm::handle_instruction_op_atomic_compare_exchange_weak(
5301 Op_atomic_compare_exchange_weak instruction, std::size_t instruction_start_index)
5302 {
5303 #warning finish
5304 throw Parser_error(instruction_start_index,
5305 instruction_start_index,
5306 "instruction not implemented: "
5307 + std::string(get_enumerant_name(instruction.get_operation())));
5308 }
5309
5310 void Spirv_to_llvm::handle_instruction_op_atomic_i_increment(Op_atomic_i_increment instruction,
5311 std::size_t instruction_start_index)
5312 {
5313 #warning finish
5314 throw Parser_error(instruction_start_index,
5315 instruction_start_index,
5316 "instruction not implemented: "
5317 + std::string(get_enumerant_name(instruction.get_operation())));
5318 }
5319
5320 void Spirv_to_llvm::handle_instruction_op_atomic_i_decrement(Op_atomic_i_decrement instruction,
5321 std::size_t instruction_start_index)
5322 {
5323 #warning finish
5324 throw Parser_error(instruction_start_index,
5325 instruction_start_index,
5326 "instruction not implemented: "
5327 + std::string(get_enumerant_name(instruction.get_operation())));
5328 }
5329
5330 void Spirv_to_llvm::handle_instruction_op_atomic_i_add(Op_atomic_i_add instruction,
5331 std::size_t instruction_start_index)
5332 {
5333 #warning finish
5334 throw Parser_error(instruction_start_index,
5335 instruction_start_index,
5336 "instruction not implemented: "
5337 + std::string(get_enumerant_name(instruction.get_operation())));
5338 }
5339
5340 void Spirv_to_llvm::handle_instruction_op_atomic_i_sub(Op_atomic_i_sub instruction,
5341 std::size_t instruction_start_index)
5342 {
5343 #warning finish
5344 throw Parser_error(instruction_start_index,
5345 instruction_start_index,
5346 "instruction not implemented: "
5347 + std::string(get_enumerant_name(instruction.get_operation())));
5348 }
5349
5350 void Spirv_to_llvm::handle_instruction_op_atomic_s_min(Op_atomic_s_min instruction,
5351 std::size_t instruction_start_index)
5352 {
5353 #warning finish
5354 throw Parser_error(instruction_start_index,
5355 instruction_start_index,
5356 "instruction not implemented: "
5357 + std::string(get_enumerant_name(instruction.get_operation())));
5358 }
5359
5360 void Spirv_to_llvm::handle_instruction_op_atomic_u_min(Op_atomic_u_min instruction,
5361 std::size_t instruction_start_index)
5362 {
5363 #warning finish
5364 throw Parser_error(instruction_start_index,
5365 instruction_start_index,
5366 "instruction not implemented: "
5367 + std::string(get_enumerant_name(instruction.get_operation())));
5368 }
5369
5370 void Spirv_to_llvm::handle_instruction_op_atomic_s_max(Op_atomic_s_max instruction,
5371 std::size_t instruction_start_index)
5372 {
5373 #warning finish
5374 throw Parser_error(instruction_start_index,
5375 instruction_start_index,
5376 "instruction not implemented: "
5377 + std::string(get_enumerant_name(instruction.get_operation())));
5378 }
5379
5380 void Spirv_to_llvm::handle_instruction_op_atomic_u_max(Op_atomic_u_max instruction,
5381 std::size_t instruction_start_index)
5382 {
5383 #warning finish
5384 throw Parser_error(instruction_start_index,
5385 instruction_start_index,
5386 "instruction not implemented: "
5387 + std::string(get_enumerant_name(instruction.get_operation())));
5388 }
5389
5390 void Spirv_to_llvm::handle_instruction_op_atomic_and(Op_atomic_and instruction,
5391 std::size_t instruction_start_index)
5392 {
5393 #warning finish
5394 throw Parser_error(instruction_start_index,
5395 instruction_start_index,
5396 "instruction not implemented: "
5397 + std::string(get_enumerant_name(instruction.get_operation())));
5398 }
5399
5400 void Spirv_to_llvm::handle_instruction_op_atomic_or(Op_atomic_or instruction,
5401 std::size_t instruction_start_index)
5402 {
5403 #warning finish
5404 throw Parser_error(instruction_start_index,
5405 instruction_start_index,
5406 "instruction not implemented: "
5407 + std::string(get_enumerant_name(instruction.get_operation())));
5408 }
5409
5410 void Spirv_to_llvm::handle_instruction_op_atomic_xor(Op_atomic_xor instruction,
5411 std::size_t instruction_start_index)
5412 {
5413 #warning finish
5414 throw Parser_error(instruction_start_index,
5415 instruction_start_index,
5416 "instruction not implemented: "
5417 + std::string(get_enumerant_name(instruction.get_operation())));
5418 }
5419
5420 void Spirv_to_llvm::handle_instruction_op_phi(Op_phi instruction,
5421 std::size_t instruction_start_index)
5422 {
5423 #warning finish
5424 throw Parser_error(instruction_start_index,
5425 instruction_start_index,
5426 "instruction not implemented: "
5427 + std::string(get_enumerant_name(instruction.get_operation())));
5428 }
5429
5430 void Spirv_to_llvm::handle_instruction_op_loop_merge(Op_loop_merge instruction,
5431 std::size_t instruction_start_index)
5432 {
5433 last_merge_instruction =
5434 Last_merge_instruction(std::move(instruction), instruction_start_index);
5435 }
5436
5437 void Spirv_to_llvm::handle_instruction_op_selection_merge(Op_selection_merge instruction,
5438 std::size_t instruction_start_index)
5439 {
5440 last_merge_instruction =
5441 Last_merge_instruction(std::move(instruction), instruction_start_index);
5442 }
5443
5444 void Spirv_to_llvm::handle_instruction_op_label(Op_label instruction,
5445 std::size_t instruction_start_index)
5446 {
5447 if(current_function_id == 0)
5448 throw Parser_error(instruction_start_index,
5449 instruction_start_index,
5450 "OpLabel not allowed outside a function");
5451 if(current_basic_block_id != 0)
5452 throw Parser_error(instruction_start_index,
5453 instruction_start_index,
5454 "missing block terminator before OpLabel");
5455 current_basic_block_id = instruction.result;
5456 switch(stage)
5457 {
5458 case Stage::calculate_types:
5459 break;
5460 case Stage::generate_code:
5461 {
5462 auto &function = get_id_state(current_function_id).function.value();
5463 if(!get_id_state(current_basic_block_id).decorations.empty())
5464 throw Parser_error(instruction_start_index,
5465 instruction_start_index,
5466 "decorations on label not implemented");
5467 auto block = get_or_make_label(instruction.result);
5468 ::LLVMPositionBuilderAtEnd(builder.get(), block);
5469 if(!function.entry_block)
5470 {
5471 auto io_struct_value = ::LLVMGetParam(function.function, io_struct_argument_index);
5472 auto inputs_struct_value = ::LLVMBuildStructGEP(
5473 builder.get(),
5474 io_struct_value,
5475 io_struct->get_members(true)[this->inputs_member].llvm_member_index,
5476 "inputs");
5477 auto outputs_struct_value = ::LLVMBuildStructGEP(
5478 builder.get(),
5479 io_struct_value,
5480 io_struct->get_members(true)[this->outputs_member].llvm_member_index,
5481 "outputs");
5482 function.entry_block = Function_state::Entry_block(
5483 block, io_struct_value, inputs_struct_value, outputs_struct_value);
5484 for(auto iter = function_entry_block_handlers.begin();
5485 iter != function_entry_block_handlers.end();)
5486 {
5487 auto fn = *iter++;
5488 // increment before calling in case the hander removes itself
5489 fn();
5490 }
5491 }
5492 break;
5493 }
5494 }
5495 }
5496
5497 void Spirv_to_llvm::handle_instruction_op_branch(
5498 Op_branch instruction, [[gnu::unused]] std::size_t instruction_start_index)
5499 {
5500 auto merge = std::move(last_merge_instruction);
5501 last_merge_instruction.reset();
5502 current_basic_block_id = 0;
5503 switch(stage)
5504 {
5505 case Stage::calculate_types:
5506 break;
5507 case Stage::generate_code:
5508 {
5509 ::LLVMBuildBr(builder.get(), get_or_make_label(instruction.target_label));
5510 break;
5511 }
5512 }
5513 }
5514
5515 void Spirv_to_llvm::handle_instruction_op_branch_conditional(Op_branch_conditional instruction,
5516 std::size_t instruction_start_index)
5517 {
5518 #warning finish
5519 throw Parser_error(instruction_start_index,
5520 instruction_start_index,
5521 "instruction not implemented: "
5522 + std::string(get_enumerant_name(instruction.get_operation())));
5523 }
5524
5525 void Spirv_to_llvm::handle_instruction_op_switch(
5526 Op_switch instruction, [[gnu::unused]] std::size_t instruction_start_index)
5527 {
5528 auto merge = std::move(last_merge_instruction.value());
5529 last_merge_instruction.reset();
5530 current_basic_block_id = 0;
5531 switch(stage)
5532 {
5533 case Stage::calculate_types:
5534 break;
5535 case Stage::generate_code:
5536 {
5537 for(auto &target : instruction.target)
5538 get_or_make_label(target.part_2); // create basic blocks first
5539 auto selector = get_id_state(instruction.selector).value.value();
5540 auto switch_instruction = ::LLVMBuildSwitch(builder.get(),
5541 selector.value,
5542 get_or_make_label(instruction.default_),
5543 instruction.target.size());
5544 for(auto &target : instruction.target)
5545 ::LLVMAddCase(
5546 switch_instruction,
5547 ::LLVMConstInt(selector.type->get_or_make_type().type, target.part_1, false),
5548 get_or_make_label(target.part_2));
5549 break;
5550 }
5551 }
5552 }
5553
5554 void Spirv_to_llvm::handle_instruction_op_kill(Op_kill instruction,
5555 std::size_t instruction_start_index)
5556 {
5557 #warning finish
5558 throw Parser_error(instruction_start_index,
5559 instruction_start_index,
5560 "instruction not implemented: "
5561 + std::string(get_enumerant_name(instruction.get_operation())));
5562 }
5563
5564 void Spirv_to_llvm::handle_instruction_op_return(
5565 [[gnu::unused]] Op_return instruction, [[gnu::unused]] std::size_t instruction_start_index)
5566 {
5567 current_basic_block_id = 0;
5568 switch(stage)
5569 {
5570 case Stage::calculate_types:
5571 break;
5572 case Stage::generate_code:
5573 {
5574 ::LLVMBuildRetVoid(builder.get());
5575 break;
5576 }
5577 }
5578 }
5579
5580 void Spirv_to_llvm::handle_instruction_op_return_value(Op_return_value instruction,
5581 std::size_t instruction_start_index)
5582 {
5583 #warning finish
5584 throw Parser_error(instruction_start_index,
5585 instruction_start_index,
5586 "instruction not implemented: "
5587 + std::string(get_enumerant_name(instruction.get_operation())));
5588 }
5589
5590 void Spirv_to_llvm::handle_instruction_op_unreachable(Op_unreachable instruction,
5591 std::size_t instruction_start_index)
5592 {
5593 #warning finish
5594 throw Parser_error(instruction_start_index,
5595 instruction_start_index,
5596 "instruction not implemented: "
5597 + std::string(get_enumerant_name(instruction.get_operation())));
5598 }
5599
5600 void Spirv_to_llvm::handle_instruction_op_lifetime_start(Op_lifetime_start instruction,
5601 std::size_t instruction_start_index)
5602 {
5603 #warning finish
5604 throw Parser_error(instruction_start_index,
5605 instruction_start_index,
5606 "instruction not implemented: "
5607 + std::string(get_enumerant_name(instruction.get_operation())));
5608 }
5609
5610 void Spirv_to_llvm::handle_instruction_op_lifetime_stop(Op_lifetime_stop instruction,
5611 std::size_t instruction_start_index)
5612 {
5613 #warning finish
5614 throw Parser_error(instruction_start_index,
5615 instruction_start_index,
5616 "instruction not implemented: "
5617 + std::string(get_enumerant_name(instruction.get_operation())));
5618 }
5619
5620 void Spirv_to_llvm::handle_instruction_op_group_async_copy(Op_group_async_copy instruction,
5621 std::size_t instruction_start_index)
5622 {
5623 #warning finish
5624 throw Parser_error(instruction_start_index,
5625 instruction_start_index,
5626 "instruction not implemented: "
5627 + std::string(get_enumerant_name(instruction.get_operation())));
5628 }
5629
5630 void Spirv_to_llvm::handle_instruction_op_group_wait_events(Op_group_wait_events instruction,
5631 std::size_t instruction_start_index)
5632 {
5633 #warning finish
5634 throw Parser_error(instruction_start_index,
5635 instruction_start_index,
5636 "instruction not implemented: "
5637 + std::string(get_enumerant_name(instruction.get_operation())));
5638 }
5639
5640 void Spirv_to_llvm::handle_instruction_op_group_all(Op_group_all instruction,
5641 std::size_t instruction_start_index)
5642 {
5643 #warning finish
5644 throw Parser_error(instruction_start_index,
5645 instruction_start_index,
5646 "instruction not implemented: "
5647 + std::string(get_enumerant_name(instruction.get_operation())));
5648 }
5649
5650 void Spirv_to_llvm::handle_instruction_op_group_any(Op_group_any instruction,
5651 std::size_t instruction_start_index)
5652 {
5653 #warning finish
5654 throw Parser_error(instruction_start_index,
5655 instruction_start_index,
5656 "instruction not implemented: "
5657 + std::string(get_enumerant_name(instruction.get_operation())));
5658 }
5659
5660 void Spirv_to_llvm::handle_instruction_op_group_broadcast(Op_group_broadcast instruction,
5661 std::size_t instruction_start_index)
5662 {
5663 #warning finish
5664 throw Parser_error(instruction_start_index,
5665 instruction_start_index,
5666 "instruction not implemented: "
5667 + std::string(get_enumerant_name(instruction.get_operation())));
5668 }
5669
5670 void Spirv_to_llvm::handle_instruction_op_group_i_add(Op_group_i_add instruction,
5671 std::size_t instruction_start_index)
5672 {
5673 #warning finish
5674 throw Parser_error(instruction_start_index,
5675 instruction_start_index,
5676 "instruction not implemented: "
5677 + std::string(get_enumerant_name(instruction.get_operation())));
5678 }
5679
5680 void Spirv_to_llvm::handle_instruction_op_group_f_add(Op_group_f_add instruction,
5681 std::size_t instruction_start_index)
5682 {
5683 #warning finish
5684 throw Parser_error(instruction_start_index,
5685 instruction_start_index,
5686 "instruction not implemented: "
5687 + std::string(get_enumerant_name(instruction.get_operation())));
5688 }
5689
5690 void Spirv_to_llvm::handle_instruction_op_group_f_min(Op_group_f_min instruction,
5691 std::size_t instruction_start_index)
5692 {
5693 #warning finish
5694 throw Parser_error(instruction_start_index,
5695 instruction_start_index,
5696 "instruction not implemented: "
5697 + std::string(get_enumerant_name(instruction.get_operation())));
5698 }
5699
5700 void Spirv_to_llvm::handle_instruction_op_group_u_min(Op_group_u_min instruction,
5701 std::size_t instruction_start_index)
5702 {
5703 #warning finish
5704 throw Parser_error(instruction_start_index,
5705 instruction_start_index,
5706 "instruction not implemented: "
5707 + std::string(get_enumerant_name(instruction.get_operation())));
5708 }
5709
5710 void Spirv_to_llvm::handle_instruction_op_group_s_min(Op_group_s_min instruction,
5711 std::size_t instruction_start_index)
5712 {
5713 #warning finish
5714 throw Parser_error(instruction_start_index,
5715 instruction_start_index,
5716 "instruction not implemented: "
5717 + std::string(get_enumerant_name(instruction.get_operation())));
5718 }
5719
5720 void Spirv_to_llvm::handle_instruction_op_group_f_max(Op_group_f_max instruction,
5721 std::size_t instruction_start_index)
5722 {
5723 #warning finish
5724 throw Parser_error(instruction_start_index,
5725 instruction_start_index,
5726 "instruction not implemented: "
5727 + std::string(get_enumerant_name(instruction.get_operation())));
5728 }
5729
5730 void Spirv_to_llvm::handle_instruction_op_group_u_max(Op_group_u_max instruction,
5731 std::size_t instruction_start_index)
5732 {
5733 #warning finish
5734 throw Parser_error(instruction_start_index,
5735 instruction_start_index,
5736 "instruction not implemented: "
5737 + std::string(get_enumerant_name(instruction.get_operation())));
5738 }
5739
5740 void Spirv_to_llvm::handle_instruction_op_group_s_max(Op_group_s_max instruction,
5741 std::size_t instruction_start_index)
5742 {
5743 #warning finish
5744 throw Parser_error(instruction_start_index,
5745 instruction_start_index,
5746 "instruction not implemented: "
5747 + std::string(get_enumerant_name(instruction.get_operation())));
5748 }
5749
5750 void Spirv_to_llvm::handle_instruction_op_read_pipe(Op_read_pipe instruction,
5751 std::size_t instruction_start_index)
5752 {
5753 #warning finish
5754 throw Parser_error(instruction_start_index,
5755 instruction_start_index,
5756 "instruction not implemented: "
5757 + std::string(get_enumerant_name(instruction.get_operation())));
5758 }
5759
5760 void Spirv_to_llvm::handle_instruction_op_write_pipe(Op_write_pipe instruction,
5761 std::size_t instruction_start_index)
5762 {
5763 #warning finish
5764 throw Parser_error(instruction_start_index,
5765 instruction_start_index,
5766 "instruction not implemented: "
5767 + std::string(get_enumerant_name(instruction.get_operation())));
5768 }
5769
5770 void Spirv_to_llvm::handle_instruction_op_reserved_read_pipe(Op_reserved_read_pipe instruction,
5771 std::size_t instruction_start_index)
5772 {
5773 #warning finish
5774 throw Parser_error(instruction_start_index,
5775 instruction_start_index,
5776 "instruction not implemented: "
5777 + std::string(get_enumerant_name(instruction.get_operation())));
5778 }
5779
5780 void Spirv_to_llvm::handle_instruction_op_reserved_write_pipe(Op_reserved_write_pipe instruction,
5781 std::size_t instruction_start_index)
5782 {
5783 #warning finish
5784 throw Parser_error(instruction_start_index,
5785 instruction_start_index,
5786 "instruction not implemented: "
5787 + std::string(get_enumerant_name(instruction.get_operation())));
5788 }
5789
5790 void Spirv_to_llvm::handle_instruction_op_reserve_read_pipe_packets(
5791 Op_reserve_read_pipe_packets instruction, std::size_t instruction_start_index)
5792 {
5793 #warning finish
5794 throw Parser_error(instruction_start_index,
5795 instruction_start_index,
5796 "instruction not implemented: "
5797 + std::string(get_enumerant_name(instruction.get_operation())));
5798 }
5799
5800 void Spirv_to_llvm::handle_instruction_op_reserve_write_pipe_packets(
5801 Op_reserve_write_pipe_packets instruction, std::size_t instruction_start_index)
5802 {
5803 #warning finish
5804 throw Parser_error(instruction_start_index,
5805 instruction_start_index,
5806 "instruction not implemented: "
5807 + std::string(get_enumerant_name(instruction.get_operation())));
5808 }
5809
5810 void Spirv_to_llvm::handle_instruction_op_commit_read_pipe(Op_commit_read_pipe instruction,
5811 std::size_t instruction_start_index)
5812 {
5813 #warning finish
5814 throw Parser_error(instruction_start_index,
5815 instruction_start_index,
5816 "instruction not implemented: "
5817 + std::string(get_enumerant_name(instruction.get_operation())));
5818 }
5819
5820 void Spirv_to_llvm::handle_instruction_op_commit_write_pipe(Op_commit_write_pipe instruction,
5821 std::size_t instruction_start_index)
5822 {
5823 #warning finish
5824 throw Parser_error(instruction_start_index,
5825 instruction_start_index,
5826 "instruction not implemented: "
5827 + std::string(get_enumerant_name(instruction.get_operation())));
5828 }
5829
5830 void Spirv_to_llvm::handle_instruction_op_is_valid_reserve_id(Op_is_valid_reserve_id instruction,
5831 std::size_t instruction_start_index)
5832 {
5833 #warning finish
5834 throw Parser_error(instruction_start_index,
5835 instruction_start_index,
5836 "instruction not implemented: "
5837 + std::string(get_enumerant_name(instruction.get_operation())));
5838 }
5839
5840 void Spirv_to_llvm::handle_instruction_op_get_num_pipe_packets(Op_get_num_pipe_packets instruction,
5841 std::size_t instruction_start_index)
5842 {
5843 #warning finish
5844 throw Parser_error(instruction_start_index,
5845 instruction_start_index,
5846 "instruction not implemented: "
5847 + std::string(get_enumerant_name(instruction.get_operation())));
5848 }
5849
5850 void Spirv_to_llvm::handle_instruction_op_get_max_pipe_packets(Op_get_max_pipe_packets instruction,
5851 std::size_t instruction_start_index)
5852 {
5853 #warning finish
5854 throw Parser_error(instruction_start_index,
5855 instruction_start_index,
5856 "instruction not implemented: "
5857 + std::string(get_enumerant_name(instruction.get_operation())));
5858 }
5859
5860 void Spirv_to_llvm::handle_instruction_op_group_reserve_read_pipe_packets(
5861 Op_group_reserve_read_pipe_packets instruction, std::size_t instruction_start_index)
5862 {
5863 #warning finish
5864 throw Parser_error(instruction_start_index,
5865 instruction_start_index,
5866 "instruction not implemented: "
5867 + std::string(get_enumerant_name(instruction.get_operation())));
5868 }
5869
5870 void Spirv_to_llvm::handle_instruction_op_group_reserve_write_pipe_packets(
5871 Op_group_reserve_write_pipe_packets instruction, std::size_t instruction_start_index)
5872 {
5873 #warning finish
5874 throw Parser_error(instruction_start_index,
5875 instruction_start_index,
5876 "instruction not implemented: "
5877 + std::string(get_enumerant_name(instruction.get_operation())));
5878 }
5879
5880 void Spirv_to_llvm::handle_instruction_op_group_commit_read_pipe(
5881 Op_group_commit_read_pipe instruction, std::size_t instruction_start_index)
5882 {
5883 #warning finish
5884 throw Parser_error(instruction_start_index,
5885 instruction_start_index,
5886 "instruction not implemented: "
5887 + std::string(get_enumerant_name(instruction.get_operation())));
5888 }
5889
5890 void Spirv_to_llvm::handle_instruction_op_group_commit_write_pipe(
5891 Op_group_commit_write_pipe instruction, std::size_t instruction_start_index)
5892 {
5893 #warning finish
5894 throw Parser_error(instruction_start_index,
5895 instruction_start_index,
5896 "instruction not implemented: "
5897 + std::string(get_enumerant_name(instruction.get_operation())));
5898 }
5899
5900 void Spirv_to_llvm::handle_instruction_op_enqueue_marker(Op_enqueue_marker instruction,
5901 std::size_t instruction_start_index)
5902 {
5903 #warning finish
5904 throw Parser_error(instruction_start_index,
5905 instruction_start_index,
5906 "instruction not implemented: "
5907 + std::string(get_enumerant_name(instruction.get_operation())));
5908 }
5909
5910 void Spirv_to_llvm::handle_instruction_op_enqueue_kernel(Op_enqueue_kernel instruction,
5911 std::size_t instruction_start_index)
5912 {
5913 #warning finish
5914 throw Parser_error(instruction_start_index,
5915 instruction_start_index,
5916 "instruction not implemented: "
5917 + std::string(get_enumerant_name(instruction.get_operation())));
5918 }
5919
5920 void Spirv_to_llvm::handle_instruction_op_get_kernel_n_drange_sub_group_count(
5921 Op_get_kernel_n_drange_sub_group_count instruction, std::size_t instruction_start_index)
5922 {
5923 #warning finish
5924 throw Parser_error(instruction_start_index,
5925 instruction_start_index,
5926 "instruction not implemented: "
5927 + std::string(get_enumerant_name(instruction.get_operation())));
5928 }
5929
5930 void Spirv_to_llvm::handle_instruction_op_get_kernel_n_drange_max_sub_group_size(
5931 Op_get_kernel_n_drange_max_sub_group_size instruction, std::size_t instruction_start_index)
5932 {
5933 #warning finish
5934 throw Parser_error(instruction_start_index,
5935 instruction_start_index,
5936 "instruction not implemented: "
5937 + std::string(get_enumerant_name(instruction.get_operation())));
5938 }
5939
5940 void Spirv_to_llvm::handle_instruction_op_get_kernel_work_group_size(
5941 Op_get_kernel_work_group_size instruction, std::size_t instruction_start_index)
5942 {
5943 #warning finish
5944 throw Parser_error(instruction_start_index,
5945 instruction_start_index,
5946 "instruction not implemented: "
5947 + std::string(get_enumerant_name(instruction.get_operation())));
5948 }
5949
5950 void Spirv_to_llvm::handle_instruction_op_get_kernel_preferred_work_group_size_multiple(
5951 Op_get_kernel_preferred_work_group_size_multiple instruction,
5952 std::size_t instruction_start_index)
5953 {
5954 #warning finish
5955 throw Parser_error(instruction_start_index,
5956 instruction_start_index,
5957 "instruction not implemented: "
5958 + std::string(get_enumerant_name(instruction.get_operation())));
5959 }
5960
5961 void Spirv_to_llvm::handle_instruction_op_retain_event(Op_retain_event instruction,
5962 std::size_t instruction_start_index)
5963 {
5964 #warning finish
5965 throw Parser_error(instruction_start_index,
5966 instruction_start_index,
5967 "instruction not implemented: "
5968 + std::string(get_enumerant_name(instruction.get_operation())));
5969 }
5970
5971 void Spirv_to_llvm::handle_instruction_op_release_event(Op_release_event instruction,
5972 std::size_t instruction_start_index)
5973 {
5974 #warning finish
5975 throw Parser_error(instruction_start_index,
5976 instruction_start_index,
5977 "instruction not implemented: "
5978 + std::string(get_enumerant_name(instruction.get_operation())));
5979 }
5980
5981 void Spirv_to_llvm::handle_instruction_op_create_user_event(Op_create_user_event instruction,
5982 std::size_t instruction_start_index)
5983 {
5984 #warning finish
5985 throw Parser_error(instruction_start_index,
5986 instruction_start_index,
5987 "instruction not implemented: "
5988 + std::string(get_enumerant_name(instruction.get_operation())));
5989 }
5990
5991 void Spirv_to_llvm::handle_instruction_op_is_valid_event(Op_is_valid_event instruction,
5992 std::size_t instruction_start_index)
5993 {
5994 #warning finish
5995 throw Parser_error(instruction_start_index,
5996 instruction_start_index,
5997 "instruction not implemented: "
5998 + std::string(get_enumerant_name(instruction.get_operation())));
5999 }
6000
6001 void Spirv_to_llvm::handle_instruction_op_set_user_event_status(
6002 Op_set_user_event_status instruction, std::size_t instruction_start_index)
6003 {
6004 #warning finish
6005 throw Parser_error(instruction_start_index,
6006 instruction_start_index,
6007 "instruction not implemented: "
6008 + std::string(get_enumerant_name(instruction.get_operation())));
6009 }
6010
6011 void Spirv_to_llvm::handle_instruction_op_capture_event_profiling_info(
6012 Op_capture_event_profiling_info instruction, std::size_t instruction_start_index)
6013 {
6014 #warning finish
6015 throw Parser_error(instruction_start_index,
6016 instruction_start_index,
6017 "instruction not implemented: "
6018 + std::string(get_enumerant_name(instruction.get_operation())));
6019 }
6020
6021 void Spirv_to_llvm::handle_instruction_op_get_default_queue(Op_get_default_queue instruction,
6022 std::size_t instruction_start_index)
6023 {
6024 #warning finish
6025 throw Parser_error(instruction_start_index,
6026 instruction_start_index,
6027 "instruction not implemented: "
6028 + std::string(get_enumerant_name(instruction.get_operation())));
6029 }
6030
6031 void Spirv_to_llvm::handle_instruction_op_build_nd_range(Op_build_nd_range instruction,
6032 std::size_t instruction_start_index)
6033 {
6034 #warning finish
6035 throw Parser_error(instruction_start_index,
6036 instruction_start_index,
6037 "instruction not implemented: "
6038 + std::string(get_enumerant_name(instruction.get_operation())));
6039 }
6040
6041 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_implicit_lod(
6042 Op_image_sparse_sample_implicit_lod instruction, std::size_t instruction_start_index)
6043 {
6044 #warning finish
6045 throw Parser_error(instruction_start_index,
6046 instruction_start_index,
6047 "instruction not implemented: "
6048 + std::string(get_enumerant_name(instruction.get_operation())));
6049 }
6050
6051 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_explicit_lod(
6052 Op_image_sparse_sample_explicit_lod instruction, std::size_t instruction_start_index)
6053 {
6054 #warning finish
6055 throw Parser_error(instruction_start_index,
6056 instruction_start_index,
6057 "instruction not implemented: "
6058 + std::string(get_enumerant_name(instruction.get_operation())));
6059 }
6060
6061 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_dref_implicit_lod(
6062 Op_image_sparse_sample_dref_implicit_lod instruction, std::size_t instruction_start_index)
6063 {
6064 #warning finish
6065 throw Parser_error(instruction_start_index,
6066 instruction_start_index,
6067 "instruction not implemented: "
6068 + std::string(get_enumerant_name(instruction.get_operation())));
6069 }
6070
6071 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_dref_explicit_lod(
6072 Op_image_sparse_sample_dref_explicit_lod instruction, std::size_t instruction_start_index)
6073 {
6074 #warning finish
6075 throw Parser_error(instruction_start_index,
6076 instruction_start_index,
6077 "instruction not implemented: "
6078 + std::string(get_enumerant_name(instruction.get_operation())));
6079 }
6080
6081 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_proj_implicit_lod(
6082 Op_image_sparse_sample_proj_implicit_lod instruction, std::size_t instruction_start_index)
6083 {
6084 #warning finish
6085 throw Parser_error(instruction_start_index,
6086 instruction_start_index,
6087 "instruction not implemented: "
6088 + std::string(get_enumerant_name(instruction.get_operation())));
6089 }
6090
6091 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_proj_explicit_lod(
6092 Op_image_sparse_sample_proj_explicit_lod instruction, std::size_t instruction_start_index)
6093 {
6094 #warning finish
6095 throw Parser_error(instruction_start_index,
6096 instruction_start_index,
6097 "instruction not implemented: "
6098 + std::string(get_enumerant_name(instruction.get_operation())));
6099 }
6100
6101 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_proj_dref_implicit_lod(
6102 Op_image_sparse_sample_proj_dref_implicit_lod instruction, std::size_t instruction_start_index)
6103 {
6104 #warning finish
6105 throw Parser_error(instruction_start_index,
6106 instruction_start_index,
6107 "instruction not implemented: "
6108 + std::string(get_enumerant_name(instruction.get_operation())));
6109 }
6110
6111 void Spirv_to_llvm::handle_instruction_op_image_sparse_sample_proj_dref_explicit_lod(
6112 Op_image_sparse_sample_proj_dref_explicit_lod instruction, std::size_t instruction_start_index)
6113 {
6114 #warning finish
6115 throw Parser_error(instruction_start_index,
6116 instruction_start_index,
6117 "instruction not implemented: "
6118 + std::string(get_enumerant_name(instruction.get_operation())));
6119 }
6120
6121 void Spirv_to_llvm::handle_instruction_op_image_sparse_fetch(Op_image_sparse_fetch instruction,
6122 std::size_t instruction_start_index)
6123 {
6124 #warning finish
6125 throw Parser_error(instruction_start_index,
6126 instruction_start_index,
6127 "instruction not implemented: "
6128 + std::string(get_enumerant_name(instruction.get_operation())));
6129 }
6130
6131 void Spirv_to_llvm::handle_instruction_op_image_sparse_gather(Op_image_sparse_gather instruction,
6132 std::size_t instruction_start_index)
6133 {
6134 #warning finish
6135 throw Parser_error(instruction_start_index,
6136 instruction_start_index,
6137 "instruction not implemented: "
6138 + std::string(get_enumerant_name(instruction.get_operation())));
6139 }
6140
6141 void Spirv_to_llvm::handle_instruction_op_image_sparse_dref_gather(
6142 Op_image_sparse_dref_gather instruction, std::size_t instruction_start_index)
6143 {
6144 #warning finish
6145 throw Parser_error(instruction_start_index,
6146 instruction_start_index,
6147 "instruction not implemented: "
6148 + std::string(get_enumerant_name(instruction.get_operation())));
6149 }
6150
6151 void Spirv_to_llvm::handle_instruction_op_image_sparse_texels_resident(
6152 Op_image_sparse_texels_resident instruction, std::size_t instruction_start_index)
6153 {
6154 #warning finish
6155 throw Parser_error(instruction_start_index,
6156 instruction_start_index,
6157 "instruction not implemented: "
6158 + std::string(get_enumerant_name(instruction.get_operation())));
6159 }
6160
6161 void Spirv_to_llvm::handle_instruction_op_no_line(Op_no_line instruction,
6162 std::size_t instruction_start_index)
6163 {
6164 #warning finish
6165 throw Parser_error(instruction_start_index,
6166 instruction_start_index,
6167 "instruction not implemented: "
6168 + std::string(get_enumerant_name(instruction.get_operation())));
6169 }
6170
6171 void Spirv_to_llvm::handle_instruction_op_atomic_flag_test_and_set(
6172 Op_atomic_flag_test_and_set instruction, std::size_t instruction_start_index)
6173 {
6174 #warning finish
6175 throw Parser_error(instruction_start_index,
6176 instruction_start_index,
6177 "instruction not implemented: "
6178 + std::string(get_enumerant_name(instruction.get_operation())));
6179 }
6180
6181 void Spirv_to_llvm::handle_instruction_op_atomic_flag_clear(Op_atomic_flag_clear instruction,
6182 std::size_t instruction_start_index)
6183 {
6184 #warning finish
6185 throw Parser_error(instruction_start_index,
6186 instruction_start_index,
6187 "instruction not implemented: "
6188 + std::string(get_enumerant_name(instruction.get_operation())));
6189 }
6190
6191 void Spirv_to_llvm::handle_instruction_op_image_sparse_read(Op_image_sparse_read instruction,
6192 std::size_t instruction_start_index)
6193 {
6194 #warning finish
6195 throw Parser_error(instruction_start_index,
6196 instruction_start_index,
6197 "instruction not implemented: "
6198 + std::string(get_enumerant_name(instruction.get_operation())));
6199 }
6200
6201 void Spirv_to_llvm::handle_instruction_op_size_of(Op_size_of instruction,
6202 std::size_t instruction_start_index)
6203 {
6204 #warning finish
6205 throw Parser_error(instruction_start_index,
6206 instruction_start_index,
6207 "instruction not implemented: "
6208 + std::string(get_enumerant_name(instruction.get_operation())));
6209 }
6210
6211 void Spirv_to_llvm::handle_instruction_op_type_pipe_storage(Op_type_pipe_storage instruction,
6212 std::size_t instruction_start_index)
6213 {
6214 #warning finish
6215 throw Parser_error(instruction_start_index,
6216 instruction_start_index,
6217 "instruction not implemented: "
6218 + std::string(get_enumerant_name(instruction.get_operation())));
6219 }
6220
6221 void Spirv_to_llvm::handle_instruction_op_constant_pipe_storage(
6222 Op_constant_pipe_storage instruction, std::size_t instruction_start_index)
6223 {
6224 #warning finish
6225 throw Parser_error(instruction_start_index,
6226 instruction_start_index,
6227 "instruction not implemented: "
6228 + std::string(get_enumerant_name(instruction.get_operation())));
6229 }
6230
6231 void Spirv_to_llvm::handle_instruction_op_create_pipe_from_pipe_storage(
6232 Op_create_pipe_from_pipe_storage instruction, std::size_t instruction_start_index)
6233 {
6234 #warning finish
6235 throw Parser_error(instruction_start_index,
6236 instruction_start_index,
6237 "instruction not implemented: "
6238 + std::string(get_enumerant_name(instruction.get_operation())));
6239 }
6240
6241 void Spirv_to_llvm::handle_instruction_op_get_kernel_local_size_for_subgroup_count(
6242 Op_get_kernel_local_size_for_subgroup_count instruction, std::size_t instruction_start_index)
6243 {
6244 #warning finish
6245 throw Parser_error(instruction_start_index,
6246 instruction_start_index,
6247 "instruction not implemented: "
6248 + std::string(get_enumerant_name(instruction.get_operation())));
6249 }
6250
6251 void Spirv_to_llvm::handle_instruction_op_get_kernel_max_num_subgroups(
6252 Op_get_kernel_max_num_subgroups instruction, std::size_t instruction_start_index)
6253 {
6254 #warning finish
6255 throw Parser_error(instruction_start_index,
6256 instruction_start_index,
6257 "instruction not implemented: "
6258 + std::string(get_enumerant_name(instruction.get_operation())));
6259 }
6260
6261 void Spirv_to_llvm::handle_instruction_op_type_named_barrier(Op_type_named_barrier instruction,
6262 std::size_t instruction_start_index)
6263 {
6264 #warning finish
6265 throw Parser_error(instruction_start_index,
6266 instruction_start_index,
6267 "instruction not implemented: "
6268 + std::string(get_enumerant_name(instruction.get_operation())));
6269 }
6270
6271 void Spirv_to_llvm::handle_instruction_op_named_barrier_initialize(
6272 Op_named_barrier_initialize instruction, std::size_t instruction_start_index)
6273 {
6274 #warning finish
6275 throw Parser_error(instruction_start_index,
6276 instruction_start_index,
6277 "instruction not implemented: "
6278 + std::string(get_enumerant_name(instruction.get_operation())));
6279 }
6280
6281 void Spirv_to_llvm::handle_instruction_op_memory_named_barrier(Op_memory_named_barrier instruction,
6282 std::size_t instruction_start_index)
6283 {
6284 #warning finish
6285 throw Parser_error(instruction_start_index,
6286 instruction_start_index,
6287 "instruction not implemented: "
6288 + std::string(get_enumerant_name(instruction.get_operation())));
6289 }
6290
6291 void Spirv_to_llvm::handle_instruction_op_module_processed(Op_module_processed instruction,
6292 std::size_t instruction_start_index)
6293 {
6294 #warning finish
6295 throw Parser_error(instruction_start_index,
6296 instruction_start_index,
6297 "instruction not implemented: "
6298 + std::string(get_enumerant_name(instruction.get_operation())));
6299 }
6300
6301 void Spirv_to_llvm::handle_instruction_op_execution_mode_id(Op_execution_mode_id instruction,
6302 std::size_t instruction_start_index)
6303 {
6304 #warning finish
6305 throw Parser_error(instruction_start_index,
6306 instruction_start_index,
6307 "instruction not implemented: "
6308 + std::string(get_enumerant_name(instruction.get_operation())));
6309 }
6310
6311 void Spirv_to_llvm::handle_instruction_op_decorate_id(Op_decorate_id instruction,
6312 std::size_t instruction_start_index)
6313 {
6314 #warning finish
6315 throw Parser_error(instruction_start_index,
6316 instruction_start_index,
6317 "instruction not implemented: "
6318 + std::string(get_enumerant_name(instruction.get_operation())));
6319 }
6320
6321 void Spirv_to_llvm::handle_instruction_op_subgroup_ballot_khr(Op_subgroup_ballot_khr instruction,
6322 std::size_t instruction_start_index)
6323 {
6324 #warning finish
6325 throw Parser_error(instruction_start_index,
6326 instruction_start_index,
6327 "instruction not implemented: "
6328 + std::string(get_enumerant_name(instruction.get_operation())));
6329 }
6330
6331 void Spirv_to_llvm::handle_instruction_op_subgroup_first_invocation_khr(
6332 Op_subgroup_first_invocation_khr instruction, std::size_t instruction_start_index)
6333 {
6334 #warning finish
6335 throw Parser_error(instruction_start_index,
6336 instruction_start_index,
6337 "instruction not implemented: "
6338 + std::string(get_enumerant_name(instruction.get_operation())));
6339 }
6340
6341 void Spirv_to_llvm::handle_instruction_op_subgroup_all_khr(Op_subgroup_all_khr instruction,
6342 std::size_t instruction_start_index)
6343 {
6344 #warning finish
6345 throw Parser_error(instruction_start_index,
6346 instruction_start_index,
6347 "instruction not implemented: "
6348 + std::string(get_enumerant_name(instruction.get_operation())));
6349 }
6350
6351 void Spirv_to_llvm::handle_instruction_op_subgroup_any_khr(Op_subgroup_any_khr instruction,
6352 std::size_t instruction_start_index)
6353 {
6354 #warning finish
6355 throw Parser_error(instruction_start_index,
6356 instruction_start_index,
6357 "instruction not implemented: "
6358 + std::string(get_enumerant_name(instruction.get_operation())));
6359 }
6360
6361 void Spirv_to_llvm::handle_instruction_op_subgroup_all_equal_khr(
6362 Op_subgroup_all_equal_khr instruction, std::size_t instruction_start_index)
6363 {
6364 #warning finish
6365 throw Parser_error(instruction_start_index,
6366 instruction_start_index,
6367 "instruction not implemented: "
6368 + std::string(get_enumerant_name(instruction.get_operation())));
6369 }
6370
6371 void Spirv_to_llvm::handle_instruction_op_subgroup_read_invocation_khr(
6372 Op_subgroup_read_invocation_khr instruction, std::size_t instruction_start_index)
6373 {
6374 #warning finish
6375 throw Parser_error(instruction_start_index,
6376 instruction_start_index,
6377 "instruction not implemented: "
6378 + std::string(get_enumerant_name(instruction.get_operation())));
6379 }
6380
6381 void Spirv_to_llvm::handle_instruction_open_cl_std_op_acos(Open_cl_std_op_acos instruction,
6382 std::size_t instruction_start_index)
6383 {
6384 #warning finish
6385 throw Parser_error(instruction_start_index,
6386 instruction_start_index,
6387 "instruction not implemented: "
6388 + std::string(get_enumerant_name(instruction.get_operation())));
6389 }
6390
6391 void Spirv_to_llvm::handle_instruction_open_cl_std_op_acosh(Open_cl_std_op_acosh instruction,
6392 std::size_t instruction_start_index)
6393 {
6394 #warning finish
6395 throw Parser_error(instruction_start_index,
6396 instruction_start_index,
6397 "instruction not implemented: "
6398 + std::string(get_enumerant_name(instruction.get_operation())));
6399 }
6400
6401 void Spirv_to_llvm::handle_instruction_open_cl_std_op_acospi(Open_cl_std_op_acospi instruction,
6402 std::size_t instruction_start_index)
6403 {
6404 #warning finish
6405 throw Parser_error(instruction_start_index,
6406 instruction_start_index,
6407 "instruction not implemented: "
6408 + std::string(get_enumerant_name(instruction.get_operation())));
6409 }
6410
6411 void Spirv_to_llvm::handle_instruction_open_cl_std_op_asin(Open_cl_std_op_asin instruction,
6412 std::size_t instruction_start_index)
6413 {
6414 #warning finish
6415 throw Parser_error(instruction_start_index,
6416 instruction_start_index,
6417 "instruction not implemented: "
6418 + std::string(get_enumerant_name(instruction.get_operation())));
6419 }
6420
6421 void Spirv_to_llvm::handle_instruction_open_cl_std_op_asinh(Open_cl_std_op_asinh instruction,
6422 std::size_t instruction_start_index)
6423 {
6424 #warning finish
6425 throw Parser_error(instruction_start_index,
6426 instruction_start_index,
6427 "instruction not implemented: "
6428 + std::string(get_enumerant_name(instruction.get_operation())));
6429 }
6430
6431 void Spirv_to_llvm::handle_instruction_open_cl_std_op_asinpi(Open_cl_std_op_asinpi instruction,
6432 std::size_t instruction_start_index)
6433 {
6434 #warning finish
6435 throw Parser_error(instruction_start_index,
6436 instruction_start_index,
6437 "instruction not implemented: "
6438 + std::string(get_enumerant_name(instruction.get_operation())));
6439 }
6440
6441 void Spirv_to_llvm::handle_instruction_open_cl_std_op_atan(Open_cl_std_op_atan instruction,
6442 std::size_t instruction_start_index)
6443 {
6444 #warning finish
6445 throw Parser_error(instruction_start_index,
6446 instruction_start_index,
6447 "instruction not implemented: "
6448 + std::string(get_enumerant_name(instruction.get_operation())));
6449 }
6450
6451 void Spirv_to_llvm::handle_instruction_open_cl_std_op_atan2(Open_cl_std_op_atan2 instruction,
6452 std::size_t instruction_start_index)
6453 {
6454 #warning finish
6455 throw Parser_error(instruction_start_index,
6456 instruction_start_index,
6457 "instruction not implemented: "
6458 + std::string(get_enumerant_name(instruction.get_operation())));
6459 }
6460
6461 void Spirv_to_llvm::handle_instruction_open_cl_std_op_atanh(Open_cl_std_op_atanh instruction,
6462 std::size_t instruction_start_index)
6463 {
6464 #warning finish
6465 throw Parser_error(instruction_start_index,
6466 instruction_start_index,
6467 "instruction not implemented: "
6468 + std::string(get_enumerant_name(instruction.get_operation())));
6469 }
6470
6471 void Spirv_to_llvm::handle_instruction_open_cl_std_op_atanpi(Open_cl_std_op_atanpi instruction,
6472 std::size_t instruction_start_index)
6473 {
6474 #warning finish
6475 throw Parser_error(instruction_start_index,
6476 instruction_start_index,
6477 "instruction not implemented: "
6478 + std::string(get_enumerant_name(instruction.get_operation())));
6479 }
6480
6481 void Spirv_to_llvm::handle_instruction_open_cl_std_op_atan2pi(Open_cl_std_op_atan2pi instruction,
6482 std::size_t instruction_start_index)
6483 {
6484 #warning finish
6485 throw Parser_error(instruction_start_index,
6486 instruction_start_index,
6487 "instruction not implemented: "
6488 + std::string(get_enumerant_name(instruction.get_operation())));
6489 }
6490
6491 void Spirv_to_llvm::handle_instruction_open_cl_std_op_cbrt(Open_cl_std_op_cbrt instruction,
6492 std::size_t instruction_start_index)
6493 {
6494 #warning finish
6495 throw Parser_error(instruction_start_index,
6496 instruction_start_index,
6497 "instruction not implemented: "
6498 + std::string(get_enumerant_name(instruction.get_operation())));
6499 }
6500
6501 void Spirv_to_llvm::handle_instruction_open_cl_std_op_ceil(Open_cl_std_op_ceil instruction,
6502 std::size_t instruction_start_index)
6503 {
6504 #warning finish
6505 throw Parser_error(instruction_start_index,
6506 instruction_start_index,
6507 "instruction not implemented: "
6508 + std::string(get_enumerant_name(instruction.get_operation())));
6509 }
6510
6511 void Spirv_to_llvm::handle_instruction_open_cl_std_op_copysign(Open_cl_std_op_copysign instruction,
6512 std::size_t instruction_start_index)
6513 {
6514 #warning finish
6515 throw Parser_error(instruction_start_index,
6516 instruction_start_index,
6517 "instruction not implemented: "
6518 + std::string(get_enumerant_name(instruction.get_operation())));
6519 }
6520
6521 void Spirv_to_llvm::handle_instruction_open_cl_std_op_cos(Open_cl_std_op_cos instruction,
6522 std::size_t instruction_start_index)
6523 {
6524 #warning finish
6525 throw Parser_error(instruction_start_index,
6526 instruction_start_index,
6527 "instruction not implemented: "
6528 + std::string(get_enumerant_name(instruction.get_operation())));
6529 }
6530
6531 void Spirv_to_llvm::handle_instruction_open_cl_std_op_cosh(Open_cl_std_op_cosh instruction,
6532 std::size_t instruction_start_index)
6533 {
6534 #warning finish
6535 throw Parser_error(instruction_start_index,
6536 instruction_start_index,
6537 "instruction not implemented: "
6538 + std::string(get_enumerant_name(instruction.get_operation())));
6539 }
6540
6541 void Spirv_to_llvm::handle_instruction_open_cl_std_op_cospi(Open_cl_std_op_cospi instruction,
6542 std::size_t instruction_start_index)
6543 {
6544 #warning finish
6545 throw Parser_error(instruction_start_index,
6546 instruction_start_index,
6547 "instruction not implemented: "
6548 + std::string(get_enumerant_name(instruction.get_operation())));
6549 }
6550
6551 void Spirv_to_llvm::handle_instruction_open_cl_std_op_erfc(Open_cl_std_op_erfc instruction,
6552 std::size_t instruction_start_index)
6553 {
6554 #warning finish
6555 throw Parser_error(instruction_start_index,
6556 instruction_start_index,
6557 "instruction not implemented: "
6558 + std::string(get_enumerant_name(instruction.get_operation())));
6559 }
6560
6561 void Spirv_to_llvm::handle_instruction_open_cl_std_op_erf(Open_cl_std_op_erf instruction,
6562 std::size_t instruction_start_index)
6563 {
6564 #warning finish
6565 throw Parser_error(instruction_start_index,
6566 instruction_start_index,
6567 "instruction not implemented: "
6568 + std::string(get_enumerant_name(instruction.get_operation())));
6569 }
6570
6571 void Spirv_to_llvm::handle_instruction_open_cl_std_op_exp(Open_cl_std_op_exp instruction,
6572 std::size_t instruction_start_index)
6573 {
6574 #warning finish
6575 throw Parser_error(instruction_start_index,
6576 instruction_start_index,
6577 "instruction not implemented: "
6578 + std::string(get_enumerant_name(instruction.get_operation())));
6579 }
6580
6581 void Spirv_to_llvm::handle_instruction_open_cl_std_op_exp2(Open_cl_std_op_exp2 instruction,
6582 std::size_t instruction_start_index)
6583 {
6584 #warning finish
6585 throw Parser_error(instruction_start_index,
6586 instruction_start_index,
6587 "instruction not implemented: "
6588 + std::string(get_enumerant_name(instruction.get_operation())));
6589 }
6590
6591 void Spirv_to_llvm::handle_instruction_open_cl_std_op_exp10(Open_cl_std_op_exp10 instruction,
6592 std::size_t instruction_start_index)
6593 {
6594 #warning finish
6595 throw Parser_error(instruction_start_index,
6596 instruction_start_index,
6597 "instruction not implemented: "
6598 + std::string(get_enumerant_name(instruction.get_operation())));
6599 }
6600
6601 void Spirv_to_llvm::handle_instruction_open_cl_std_op_expm1(Open_cl_std_op_expm1 instruction,
6602 std::size_t instruction_start_index)
6603 {
6604 #warning finish
6605 throw Parser_error(instruction_start_index,
6606 instruction_start_index,
6607 "instruction not implemented: "
6608 + std::string(get_enumerant_name(instruction.get_operation())));
6609 }
6610
6611 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fabs(Open_cl_std_op_fabs instruction,
6612 std::size_t instruction_start_index)
6613 {
6614 #warning finish
6615 throw Parser_error(instruction_start_index,
6616 instruction_start_index,
6617 "instruction not implemented: "
6618 + std::string(get_enumerant_name(instruction.get_operation())));
6619 }
6620
6621 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fdim(Open_cl_std_op_fdim instruction,
6622 std::size_t instruction_start_index)
6623 {
6624 #warning finish
6625 throw Parser_error(instruction_start_index,
6626 instruction_start_index,
6627 "instruction not implemented: "
6628 + std::string(get_enumerant_name(instruction.get_operation())));
6629 }
6630
6631 void Spirv_to_llvm::handle_instruction_open_cl_std_op_floor(Open_cl_std_op_floor instruction,
6632 std::size_t instruction_start_index)
6633 {
6634 #warning finish
6635 throw Parser_error(instruction_start_index,
6636 instruction_start_index,
6637 "instruction not implemented: "
6638 + std::string(get_enumerant_name(instruction.get_operation())));
6639 }
6640
6641 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fma(Open_cl_std_op_fma instruction,
6642 std::size_t instruction_start_index)
6643 {
6644 #warning finish
6645 throw Parser_error(instruction_start_index,
6646 instruction_start_index,
6647 "instruction not implemented: "
6648 + std::string(get_enumerant_name(instruction.get_operation())));
6649 }
6650
6651 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fmax(Open_cl_std_op_fmax instruction,
6652 std::size_t instruction_start_index)
6653 {
6654 #warning finish
6655 throw Parser_error(instruction_start_index,
6656 instruction_start_index,
6657 "instruction not implemented: "
6658 + std::string(get_enumerant_name(instruction.get_operation())));
6659 }
6660
6661 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fmin(Open_cl_std_op_fmin instruction,
6662 std::size_t instruction_start_index)
6663 {
6664 #warning finish
6665 throw Parser_error(instruction_start_index,
6666 instruction_start_index,
6667 "instruction not implemented: "
6668 + std::string(get_enumerant_name(instruction.get_operation())));
6669 }
6670
6671 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fmod(Open_cl_std_op_fmod instruction,
6672 std::size_t instruction_start_index)
6673 {
6674 #warning finish
6675 throw Parser_error(instruction_start_index,
6676 instruction_start_index,
6677 "instruction not implemented: "
6678 + std::string(get_enumerant_name(instruction.get_operation())));
6679 }
6680
6681 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fract(Open_cl_std_op_fract instruction,
6682 std::size_t instruction_start_index)
6683 {
6684 #warning finish
6685 throw Parser_error(instruction_start_index,
6686 instruction_start_index,
6687 "instruction not implemented: "
6688 + std::string(get_enumerant_name(instruction.get_operation())));
6689 }
6690
6691 void Spirv_to_llvm::handle_instruction_open_cl_std_op_frexp(Open_cl_std_op_frexp instruction,
6692 std::size_t instruction_start_index)
6693 {
6694 #warning finish
6695 throw Parser_error(instruction_start_index,
6696 instruction_start_index,
6697 "instruction not implemented: "
6698 + std::string(get_enumerant_name(instruction.get_operation())));
6699 }
6700
6701 void Spirv_to_llvm::handle_instruction_open_cl_std_op_hypot(Open_cl_std_op_hypot instruction,
6702 std::size_t instruction_start_index)
6703 {
6704 #warning finish
6705 throw Parser_error(instruction_start_index,
6706 instruction_start_index,
6707 "instruction not implemented: "
6708 + std::string(get_enumerant_name(instruction.get_operation())));
6709 }
6710
6711 void Spirv_to_llvm::handle_instruction_open_cl_std_op_ilogb(Open_cl_std_op_ilogb instruction,
6712 std::size_t instruction_start_index)
6713 {
6714 #warning finish
6715 throw Parser_error(instruction_start_index,
6716 instruction_start_index,
6717 "instruction not implemented: "
6718 + std::string(get_enumerant_name(instruction.get_operation())));
6719 }
6720
6721 void Spirv_to_llvm::handle_instruction_open_cl_std_op_ldexp(Open_cl_std_op_ldexp instruction,
6722 std::size_t instruction_start_index)
6723 {
6724 #warning finish
6725 throw Parser_error(instruction_start_index,
6726 instruction_start_index,
6727 "instruction not implemented: "
6728 + std::string(get_enumerant_name(instruction.get_operation())));
6729 }
6730
6731 void Spirv_to_llvm::handle_instruction_open_cl_std_op_lgamma(Open_cl_std_op_lgamma instruction,
6732 std::size_t instruction_start_index)
6733 {
6734 #warning finish
6735 throw Parser_error(instruction_start_index,
6736 instruction_start_index,
6737 "instruction not implemented: "
6738 + std::string(get_enumerant_name(instruction.get_operation())));
6739 }
6740
6741 void Spirv_to_llvm::handle_instruction_open_cl_std_op_lgamma_r(Open_cl_std_op_lgamma_r instruction,
6742 std::size_t instruction_start_index)
6743 {
6744 #warning finish
6745 throw Parser_error(instruction_start_index,
6746 instruction_start_index,
6747 "instruction not implemented: "
6748 + std::string(get_enumerant_name(instruction.get_operation())));
6749 }
6750
6751 void Spirv_to_llvm::handle_instruction_open_cl_std_op_log(Open_cl_std_op_log instruction,
6752 std::size_t instruction_start_index)
6753 {
6754 #warning finish
6755 throw Parser_error(instruction_start_index,
6756 instruction_start_index,
6757 "instruction not implemented: "
6758 + std::string(get_enumerant_name(instruction.get_operation())));
6759 }
6760
6761 void Spirv_to_llvm::handle_instruction_open_cl_std_op_log2(Open_cl_std_op_log2 instruction,
6762 std::size_t instruction_start_index)
6763 {
6764 #warning finish
6765 throw Parser_error(instruction_start_index,
6766 instruction_start_index,
6767 "instruction not implemented: "
6768 + std::string(get_enumerant_name(instruction.get_operation())));
6769 }
6770
6771 void Spirv_to_llvm::handle_instruction_open_cl_std_op_log10(Open_cl_std_op_log10 instruction,
6772 std::size_t instruction_start_index)
6773 {
6774 #warning finish
6775 throw Parser_error(instruction_start_index,
6776 instruction_start_index,
6777 "instruction not implemented: "
6778 + std::string(get_enumerant_name(instruction.get_operation())));
6779 }
6780
6781 void Spirv_to_llvm::handle_instruction_open_cl_std_op_log1p(Open_cl_std_op_log1p instruction,
6782 std::size_t instruction_start_index)
6783 {
6784 #warning finish
6785 throw Parser_error(instruction_start_index,
6786 instruction_start_index,
6787 "instruction not implemented: "
6788 + std::string(get_enumerant_name(instruction.get_operation())));
6789 }
6790
6791 void Spirv_to_llvm::handle_instruction_open_cl_std_op_logb(Open_cl_std_op_logb instruction,
6792 std::size_t instruction_start_index)
6793 {
6794 #warning finish
6795 throw Parser_error(instruction_start_index,
6796 instruction_start_index,
6797 "instruction not implemented: "
6798 + std::string(get_enumerant_name(instruction.get_operation())));
6799 }
6800
6801 void Spirv_to_llvm::handle_instruction_open_cl_std_op_mad(Open_cl_std_op_mad instruction,
6802 std::size_t instruction_start_index)
6803 {
6804 #warning finish
6805 throw Parser_error(instruction_start_index,
6806 instruction_start_index,
6807 "instruction not implemented: "
6808 + std::string(get_enumerant_name(instruction.get_operation())));
6809 }
6810
6811 void Spirv_to_llvm::handle_instruction_open_cl_std_op_maxmag(Open_cl_std_op_maxmag instruction,
6812 std::size_t instruction_start_index)
6813 {
6814 #warning finish
6815 throw Parser_error(instruction_start_index,
6816 instruction_start_index,
6817 "instruction not implemented: "
6818 + std::string(get_enumerant_name(instruction.get_operation())));
6819 }
6820
6821 void Spirv_to_llvm::handle_instruction_open_cl_std_op_minmag(Open_cl_std_op_minmag instruction,
6822 std::size_t instruction_start_index)
6823 {
6824 #warning finish
6825 throw Parser_error(instruction_start_index,
6826 instruction_start_index,
6827 "instruction not implemented: "
6828 + std::string(get_enumerant_name(instruction.get_operation())));
6829 }
6830
6831 void Spirv_to_llvm::handle_instruction_open_cl_std_op_modf(Open_cl_std_op_modf instruction,
6832 std::size_t instruction_start_index)
6833 {
6834 #warning finish
6835 throw Parser_error(instruction_start_index,
6836 instruction_start_index,
6837 "instruction not implemented: "
6838 + std::string(get_enumerant_name(instruction.get_operation())));
6839 }
6840
6841 void Spirv_to_llvm::handle_instruction_open_cl_std_op_nan(Open_cl_std_op_nan instruction,
6842 std::size_t instruction_start_index)
6843 {
6844 #warning finish
6845 throw Parser_error(instruction_start_index,
6846 instruction_start_index,
6847 "instruction not implemented: "
6848 + std::string(get_enumerant_name(instruction.get_operation())));
6849 }
6850
6851 void Spirv_to_llvm::handle_instruction_open_cl_std_op_nextafter(
6852 Open_cl_std_op_nextafter instruction, std::size_t instruction_start_index)
6853 {
6854 #warning finish
6855 throw Parser_error(instruction_start_index,
6856 instruction_start_index,
6857 "instruction not implemented: "
6858 + std::string(get_enumerant_name(instruction.get_operation())));
6859 }
6860
6861 void Spirv_to_llvm::handle_instruction_open_cl_std_op_pow(Open_cl_std_op_pow instruction,
6862 std::size_t instruction_start_index)
6863 {
6864 #warning finish
6865 throw Parser_error(instruction_start_index,
6866 instruction_start_index,
6867 "instruction not implemented: "
6868 + std::string(get_enumerant_name(instruction.get_operation())));
6869 }
6870
6871 void Spirv_to_llvm::handle_instruction_open_cl_std_op_pown(Open_cl_std_op_pown instruction,
6872 std::size_t instruction_start_index)
6873 {
6874 #warning finish
6875 throw Parser_error(instruction_start_index,
6876 instruction_start_index,
6877 "instruction not implemented: "
6878 + std::string(get_enumerant_name(instruction.get_operation())));
6879 }
6880
6881 void Spirv_to_llvm::handle_instruction_open_cl_std_op_powr(Open_cl_std_op_powr instruction,
6882 std::size_t instruction_start_index)
6883 {
6884 #warning finish
6885 throw Parser_error(instruction_start_index,
6886 instruction_start_index,
6887 "instruction not implemented: "
6888 + std::string(get_enumerant_name(instruction.get_operation())));
6889 }
6890
6891 void Spirv_to_llvm::handle_instruction_open_cl_std_op_remainder(
6892 Open_cl_std_op_remainder instruction, std::size_t instruction_start_index)
6893 {
6894 #warning finish
6895 throw Parser_error(instruction_start_index,
6896 instruction_start_index,
6897 "instruction not implemented: "
6898 + std::string(get_enumerant_name(instruction.get_operation())));
6899 }
6900
6901 void Spirv_to_llvm::handle_instruction_open_cl_std_op_remquo(Open_cl_std_op_remquo instruction,
6902 std::size_t instruction_start_index)
6903 {
6904 #warning finish
6905 throw Parser_error(instruction_start_index,
6906 instruction_start_index,
6907 "instruction not implemented: "
6908 + std::string(get_enumerant_name(instruction.get_operation())));
6909 }
6910
6911 void Spirv_to_llvm::handle_instruction_open_cl_std_op_rint(Open_cl_std_op_rint instruction,
6912 std::size_t instruction_start_index)
6913 {
6914 #warning finish
6915 throw Parser_error(instruction_start_index,
6916 instruction_start_index,
6917 "instruction not implemented: "
6918 + std::string(get_enumerant_name(instruction.get_operation())));
6919 }
6920
6921 void Spirv_to_llvm::handle_instruction_open_cl_std_op_rootn(Open_cl_std_op_rootn instruction,
6922 std::size_t instruction_start_index)
6923 {
6924 #warning finish
6925 throw Parser_error(instruction_start_index,
6926 instruction_start_index,
6927 "instruction not implemented: "
6928 + std::string(get_enumerant_name(instruction.get_operation())));
6929 }
6930
6931 void Spirv_to_llvm::handle_instruction_open_cl_std_op_round(Open_cl_std_op_round instruction,
6932 std::size_t instruction_start_index)
6933 {
6934 #warning finish
6935 throw Parser_error(instruction_start_index,
6936 instruction_start_index,
6937 "instruction not implemented: "
6938 + std::string(get_enumerant_name(instruction.get_operation())));
6939 }
6940
6941 void Spirv_to_llvm::handle_instruction_open_cl_std_op_rsqrt(Open_cl_std_op_rsqrt instruction,
6942 std::size_t instruction_start_index)
6943 {
6944 #warning finish
6945 throw Parser_error(instruction_start_index,
6946 instruction_start_index,
6947 "instruction not implemented: "
6948 + std::string(get_enumerant_name(instruction.get_operation())));
6949 }
6950
6951 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sin(Open_cl_std_op_sin instruction,
6952 std::size_t instruction_start_index)
6953 {
6954 #warning finish
6955 throw Parser_error(instruction_start_index,
6956 instruction_start_index,
6957 "instruction not implemented: "
6958 + std::string(get_enumerant_name(instruction.get_operation())));
6959 }
6960
6961 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sincos(Open_cl_std_op_sincos instruction,
6962 std::size_t instruction_start_index)
6963 {
6964 #warning finish
6965 throw Parser_error(instruction_start_index,
6966 instruction_start_index,
6967 "instruction not implemented: "
6968 + std::string(get_enumerant_name(instruction.get_operation())));
6969 }
6970
6971 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sinh(Open_cl_std_op_sinh instruction,
6972 std::size_t instruction_start_index)
6973 {
6974 #warning finish
6975 throw Parser_error(instruction_start_index,
6976 instruction_start_index,
6977 "instruction not implemented: "
6978 + std::string(get_enumerant_name(instruction.get_operation())));
6979 }
6980
6981 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sinpi(Open_cl_std_op_sinpi instruction,
6982 std::size_t instruction_start_index)
6983 {
6984 #warning finish
6985 throw Parser_error(instruction_start_index,
6986 instruction_start_index,
6987 "instruction not implemented: "
6988 + std::string(get_enumerant_name(instruction.get_operation())));
6989 }
6990
6991 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sqrt(Open_cl_std_op_sqrt instruction,
6992 std::size_t instruction_start_index)
6993 {
6994 #warning finish
6995 throw Parser_error(instruction_start_index,
6996 instruction_start_index,
6997 "instruction not implemented: "
6998 + std::string(get_enumerant_name(instruction.get_operation())));
6999 }
7000
7001 void Spirv_to_llvm::handle_instruction_open_cl_std_op_tan(Open_cl_std_op_tan instruction,
7002 std::size_t instruction_start_index)
7003 {
7004 #warning finish
7005 throw Parser_error(instruction_start_index,
7006 instruction_start_index,
7007 "instruction not implemented: "
7008 + std::string(get_enumerant_name(instruction.get_operation())));
7009 }
7010
7011 void Spirv_to_llvm::handle_instruction_open_cl_std_op_tanh(Open_cl_std_op_tanh instruction,
7012 std::size_t instruction_start_index)
7013 {
7014 #warning finish
7015 throw Parser_error(instruction_start_index,
7016 instruction_start_index,
7017 "instruction not implemented: "
7018 + std::string(get_enumerant_name(instruction.get_operation())));
7019 }
7020
7021 void Spirv_to_llvm::handle_instruction_open_cl_std_op_tanpi(Open_cl_std_op_tanpi instruction,
7022 std::size_t instruction_start_index)
7023 {
7024 #warning finish
7025 throw Parser_error(instruction_start_index,
7026 instruction_start_index,
7027 "instruction not implemented: "
7028 + std::string(get_enumerant_name(instruction.get_operation())));
7029 }
7030
7031 void Spirv_to_llvm::handle_instruction_open_cl_std_op_tgamma(Open_cl_std_op_tgamma instruction,
7032 std::size_t instruction_start_index)
7033 {
7034 #warning finish
7035 throw Parser_error(instruction_start_index,
7036 instruction_start_index,
7037 "instruction not implemented: "
7038 + std::string(get_enumerant_name(instruction.get_operation())));
7039 }
7040
7041 void Spirv_to_llvm::handle_instruction_open_cl_std_op_trunc(Open_cl_std_op_trunc instruction,
7042 std::size_t instruction_start_index)
7043 {
7044 #warning finish
7045 throw Parser_error(instruction_start_index,
7046 instruction_start_index,
7047 "instruction not implemented: "
7048 + std::string(get_enumerant_name(instruction.get_operation())));
7049 }
7050
7051 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_cos(Open_cl_std_op_half_cos instruction,
7052 std::size_t instruction_start_index)
7053 {
7054 #warning finish
7055 throw Parser_error(instruction_start_index,
7056 instruction_start_index,
7057 "instruction not implemented: "
7058 + std::string(get_enumerant_name(instruction.get_operation())));
7059 }
7060
7061 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_divide(
7062 Open_cl_std_op_half_divide instruction, std::size_t instruction_start_index)
7063 {
7064 #warning finish
7065 throw Parser_error(instruction_start_index,
7066 instruction_start_index,
7067 "instruction not implemented: "
7068 + std::string(get_enumerant_name(instruction.get_operation())));
7069 }
7070
7071 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_exp(Open_cl_std_op_half_exp instruction,
7072 std::size_t instruction_start_index)
7073 {
7074 #warning finish
7075 throw Parser_error(instruction_start_index,
7076 instruction_start_index,
7077 "instruction not implemented: "
7078 + std::string(get_enumerant_name(instruction.get_operation())));
7079 }
7080
7081 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_exp2(
7082 Open_cl_std_op_half_exp2 instruction, std::size_t instruction_start_index)
7083 {
7084 #warning finish
7085 throw Parser_error(instruction_start_index,
7086 instruction_start_index,
7087 "instruction not implemented: "
7088 + std::string(get_enumerant_name(instruction.get_operation())));
7089 }
7090
7091 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_exp10(
7092 Open_cl_std_op_half_exp10 instruction, std::size_t instruction_start_index)
7093 {
7094 #warning finish
7095 throw Parser_error(instruction_start_index,
7096 instruction_start_index,
7097 "instruction not implemented: "
7098 + std::string(get_enumerant_name(instruction.get_operation())));
7099 }
7100
7101 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_log(Open_cl_std_op_half_log instruction,
7102 std::size_t instruction_start_index)
7103 {
7104 #warning finish
7105 throw Parser_error(instruction_start_index,
7106 instruction_start_index,
7107 "instruction not implemented: "
7108 + std::string(get_enumerant_name(instruction.get_operation())));
7109 }
7110
7111 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_log2(
7112 Open_cl_std_op_half_log2 instruction, std::size_t instruction_start_index)
7113 {
7114 #warning finish
7115 throw Parser_error(instruction_start_index,
7116 instruction_start_index,
7117 "instruction not implemented: "
7118 + std::string(get_enumerant_name(instruction.get_operation())));
7119 }
7120
7121 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_log10(
7122 Open_cl_std_op_half_log10 instruction, std::size_t instruction_start_index)
7123 {
7124 #warning finish
7125 throw Parser_error(instruction_start_index,
7126 instruction_start_index,
7127 "instruction not implemented: "
7128 + std::string(get_enumerant_name(instruction.get_operation())));
7129 }
7130
7131 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_powr(
7132 Open_cl_std_op_half_powr instruction, std::size_t instruction_start_index)
7133 {
7134 #warning finish
7135 throw Parser_error(instruction_start_index,
7136 instruction_start_index,
7137 "instruction not implemented: "
7138 + std::string(get_enumerant_name(instruction.get_operation())));
7139 }
7140
7141 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_recip(
7142 Open_cl_std_op_half_recip instruction, std::size_t instruction_start_index)
7143 {
7144 #warning finish
7145 throw Parser_error(instruction_start_index,
7146 instruction_start_index,
7147 "instruction not implemented: "
7148 + std::string(get_enumerant_name(instruction.get_operation())));
7149 }
7150
7151 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_rsqrt(
7152 Open_cl_std_op_half_rsqrt instruction, std::size_t instruction_start_index)
7153 {
7154 #warning finish
7155 throw Parser_error(instruction_start_index,
7156 instruction_start_index,
7157 "instruction not implemented: "
7158 + std::string(get_enumerant_name(instruction.get_operation())));
7159 }
7160
7161 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_sin(Open_cl_std_op_half_sin instruction,
7162 std::size_t instruction_start_index)
7163 {
7164 #warning finish
7165 throw Parser_error(instruction_start_index,
7166 instruction_start_index,
7167 "instruction not implemented: "
7168 + std::string(get_enumerant_name(instruction.get_operation())));
7169 }
7170
7171 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_sqrt(
7172 Open_cl_std_op_half_sqrt instruction, std::size_t instruction_start_index)
7173 {
7174 #warning finish
7175 throw Parser_error(instruction_start_index,
7176 instruction_start_index,
7177 "instruction not implemented: "
7178 + std::string(get_enumerant_name(instruction.get_operation())));
7179 }
7180
7181 void Spirv_to_llvm::handle_instruction_open_cl_std_op_half_tan(Open_cl_std_op_half_tan instruction,
7182 std::size_t instruction_start_index)
7183 {
7184 #warning finish
7185 throw Parser_error(instruction_start_index,
7186 instruction_start_index,
7187 "instruction not implemented: "
7188 + std::string(get_enumerant_name(instruction.get_operation())));
7189 }
7190
7191 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_cos(
7192 Open_cl_std_op_native_cos instruction, std::size_t instruction_start_index)
7193 {
7194 #warning finish
7195 throw Parser_error(instruction_start_index,
7196 instruction_start_index,
7197 "instruction not implemented: "
7198 + std::string(get_enumerant_name(instruction.get_operation())));
7199 }
7200
7201 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_divide(
7202 Open_cl_std_op_native_divide instruction, std::size_t instruction_start_index)
7203 {
7204 #warning finish
7205 throw Parser_error(instruction_start_index,
7206 instruction_start_index,
7207 "instruction not implemented: "
7208 + std::string(get_enumerant_name(instruction.get_operation())));
7209 }
7210
7211 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_exp(
7212 Open_cl_std_op_native_exp instruction, std::size_t instruction_start_index)
7213 {
7214 #warning finish
7215 throw Parser_error(instruction_start_index,
7216 instruction_start_index,
7217 "instruction not implemented: "
7218 + std::string(get_enumerant_name(instruction.get_operation())));
7219 }
7220
7221 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_exp2(
7222 Open_cl_std_op_native_exp2 instruction, std::size_t instruction_start_index)
7223 {
7224 #warning finish
7225 throw Parser_error(instruction_start_index,
7226 instruction_start_index,
7227 "instruction not implemented: "
7228 + std::string(get_enumerant_name(instruction.get_operation())));
7229 }
7230
7231 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_exp10(
7232 Open_cl_std_op_native_exp10 instruction, std::size_t instruction_start_index)
7233 {
7234 #warning finish
7235 throw Parser_error(instruction_start_index,
7236 instruction_start_index,
7237 "instruction not implemented: "
7238 + std::string(get_enumerant_name(instruction.get_operation())));
7239 }
7240
7241 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_log(
7242 Open_cl_std_op_native_log instruction, std::size_t instruction_start_index)
7243 {
7244 #warning finish
7245 throw Parser_error(instruction_start_index,
7246 instruction_start_index,
7247 "instruction not implemented: "
7248 + std::string(get_enumerant_name(instruction.get_operation())));
7249 }
7250
7251 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_log2(
7252 Open_cl_std_op_native_log2 instruction, std::size_t instruction_start_index)
7253 {
7254 #warning finish
7255 throw Parser_error(instruction_start_index,
7256 instruction_start_index,
7257 "instruction not implemented: "
7258 + std::string(get_enumerant_name(instruction.get_operation())));
7259 }
7260
7261 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_log10(
7262 Open_cl_std_op_native_log10 instruction, std::size_t instruction_start_index)
7263 {
7264 #warning finish
7265 throw Parser_error(instruction_start_index,
7266 instruction_start_index,
7267 "instruction not implemented: "
7268 + std::string(get_enumerant_name(instruction.get_operation())));
7269 }
7270
7271 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_powr(
7272 Open_cl_std_op_native_powr instruction, std::size_t instruction_start_index)
7273 {
7274 #warning finish
7275 throw Parser_error(instruction_start_index,
7276 instruction_start_index,
7277 "instruction not implemented: "
7278 + std::string(get_enumerant_name(instruction.get_operation())));
7279 }
7280
7281 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_recip(
7282 Open_cl_std_op_native_recip instruction, std::size_t instruction_start_index)
7283 {
7284 #warning finish
7285 throw Parser_error(instruction_start_index,
7286 instruction_start_index,
7287 "instruction not implemented: "
7288 + std::string(get_enumerant_name(instruction.get_operation())));
7289 }
7290
7291 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_rsqrt(
7292 Open_cl_std_op_native_rsqrt instruction, std::size_t instruction_start_index)
7293 {
7294 #warning finish
7295 throw Parser_error(instruction_start_index,
7296 instruction_start_index,
7297 "instruction not implemented: "
7298 + std::string(get_enumerant_name(instruction.get_operation())));
7299 }
7300
7301 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_sin(
7302 Open_cl_std_op_native_sin instruction, std::size_t instruction_start_index)
7303 {
7304 #warning finish
7305 throw Parser_error(instruction_start_index,
7306 instruction_start_index,
7307 "instruction not implemented: "
7308 + std::string(get_enumerant_name(instruction.get_operation())));
7309 }
7310
7311 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_sqrt(
7312 Open_cl_std_op_native_sqrt instruction, std::size_t instruction_start_index)
7313 {
7314 #warning finish
7315 throw Parser_error(instruction_start_index,
7316 instruction_start_index,
7317 "instruction not implemented: "
7318 + std::string(get_enumerant_name(instruction.get_operation())));
7319 }
7320
7321 void Spirv_to_llvm::handle_instruction_open_cl_std_op_native_tan(
7322 Open_cl_std_op_native_tan instruction, std::size_t instruction_start_index)
7323 {
7324 #warning finish
7325 throw Parser_error(instruction_start_index,
7326 instruction_start_index,
7327 "instruction not implemented: "
7328 + std::string(get_enumerant_name(instruction.get_operation())));
7329 }
7330
7331 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_abs(Open_cl_std_op_s_abs instruction,
7332 std::size_t instruction_start_index)
7333 {
7334 #warning finish
7335 throw Parser_error(instruction_start_index,
7336 instruction_start_index,
7337 "instruction not implemented: "
7338 + std::string(get_enumerant_name(instruction.get_operation())));
7339 }
7340
7341 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_abs_diff(
7342 Open_cl_std_op_s_abs_diff instruction, std::size_t instruction_start_index)
7343 {
7344 #warning finish
7345 throw Parser_error(instruction_start_index,
7346 instruction_start_index,
7347 "instruction not implemented: "
7348 + std::string(get_enumerant_name(instruction.get_operation())));
7349 }
7350
7351 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_add_sat(
7352 Open_cl_std_op_s_add_sat instruction, std::size_t instruction_start_index)
7353 {
7354 #warning finish
7355 throw Parser_error(instruction_start_index,
7356 instruction_start_index,
7357 "instruction not implemented: "
7358 + std::string(get_enumerant_name(instruction.get_operation())));
7359 }
7360
7361 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_add_sat(
7362 Open_cl_std_op_u_add_sat instruction, std::size_t instruction_start_index)
7363 {
7364 #warning finish
7365 throw Parser_error(instruction_start_index,
7366 instruction_start_index,
7367 "instruction not implemented: "
7368 + std::string(get_enumerant_name(instruction.get_operation())));
7369 }
7370
7371 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_hadd(Open_cl_std_op_s_hadd instruction,
7372 std::size_t instruction_start_index)
7373 {
7374 #warning finish
7375 throw Parser_error(instruction_start_index,
7376 instruction_start_index,
7377 "instruction not implemented: "
7378 + std::string(get_enumerant_name(instruction.get_operation())));
7379 }
7380
7381 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_hadd(Open_cl_std_op_u_hadd instruction,
7382 std::size_t instruction_start_index)
7383 {
7384 #warning finish
7385 throw Parser_error(instruction_start_index,
7386 instruction_start_index,
7387 "instruction not implemented: "
7388 + std::string(get_enumerant_name(instruction.get_operation())));
7389 }
7390
7391 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_rhadd(Open_cl_std_op_s_rhadd instruction,
7392 std::size_t instruction_start_index)
7393 {
7394 #warning finish
7395 throw Parser_error(instruction_start_index,
7396 instruction_start_index,
7397 "instruction not implemented: "
7398 + std::string(get_enumerant_name(instruction.get_operation())));
7399 }
7400
7401 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_rhadd(Open_cl_std_op_u_rhadd instruction,
7402 std::size_t instruction_start_index)
7403 {
7404 #warning finish
7405 throw Parser_error(instruction_start_index,
7406 instruction_start_index,
7407 "instruction not implemented: "
7408 + std::string(get_enumerant_name(instruction.get_operation())));
7409 }
7410
7411 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_clamp(Open_cl_std_op_s_clamp instruction,
7412 std::size_t instruction_start_index)
7413 {
7414 #warning finish
7415 throw Parser_error(instruction_start_index,
7416 instruction_start_index,
7417 "instruction not implemented: "
7418 + std::string(get_enumerant_name(instruction.get_operation())));
7419 }
7420
7421 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_clamp(Open_cl_std_op_u_clamp instruction,
7422 std::size_t instruction_start_index)
7423 {
7424 #warning finish
7425 throw Parser_error(instruction_start_index,
7426 instruction_start_index,
7427 "instruction not implemented: "
7428 + std::string(get_enumerant_name(instruction.get_operation())));
7429 }
7430
7431 void Spirv_to_llvm::handle_instruction_open_cl_std_op_clz(Open_cl_std_op_clz instruction,
7432 std::size_t instruction_start_index)
7433 {
7434 #warning finish
7435 throw Parser_error(instruction_start_index,
7436 instruction_start_index,
7437 "instruction not implemented: "
7438 + std::string(get_enumerant_name(instruction.get_operation())));
7439 }
7440
7441 void Spirv_to_llvm::handle_instruction_open_cl_std_op_ctz(Open_cl_std_op_ctz instruction,
7442 std::size_t instruction_start_index)
7443 {
7444 #warning finish
7445 throw Parser_error(instruction_start_index,
7446 instruction_start_index,
7447 "instruction not implemented: "
7448 + std::string(get_enumerant_name(instruction.get_operation())));
7449 }
7450
7451 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_mad_hi(Open_cl_std_op_s_mad_hi instruction,
7452 std::size_t instruction_start_index)
7453 {
7454 #warning finish
7455 throw Parser_error(instruction_start_index,
7456 instruction_start_index,
7457 "instruction not implemented: "
7458 + std::string(get_enumerant_name(instruction.get_operation())));
7459 }
7460
7461 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_mad_sat(
7462 Open_cl_std_op_u_mad_sat instruction, std::size_t instruction_start_index)
7463 {
7464 #warning finish
7465 throw Parser_error(instruction_start_index,
7466 instruction_start_index,
7467 "instruction not implemented: "
7468 + std::string(get_enumerant_name(instruction.get_operation())));
7469 }
7470
7471 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_mad_sat(
7472 Open_cl_std_op_s_mad_sat instruction, std::size_t instruction_start_index)
7473 {
7474 #warning finish
7475 throw Parser_error(instruction_start_index,
7476 instruction_start_index,
7477 "instruction not implemented: "
7478 + std::string(get_enumerant_name(instruction.get_operation())));
7479 }
7480
7481 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_max(Open_cl_std_op_s_max instruction,
7482 std::size_t instruction_start_index)
7483 {
7484 #warning finish
7485 throw Parser_error(instruction_start_index,
7486 instruction_start_index,
7487 "instruction not implemented: "
7488 + std::string(get_enumerant_name(instruction.get_operation())));
7489 }
7490
7491 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_max(Open_cl_std_op_u_max instruction,
7492 std::size_t instruction_start_index)
7493 {
7494 #warning finish
7495 throw Parser_error(instruction_start_index,
7496 instruction_start_index,
7497 "instruction not implemented: "
7498 + std::string(get_enumerant_name(instruction.get_operation())));
7499 }
7500
7501 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_min(Open_cl_std_op_s_min instruction,
7502 std::size_t instruction_start_index)
7503 {
7504 #warning finish
7505 throw Parser_error(instruction_start_index,
7506 instruction_start_index,
7507 "instruction not implemented: "
7508 + std::string(get_enumerant_name(instruction.get_operation())));
7509 }
7510
7511 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_min(Open_cl_std_op_u_min instruction,
7512 std::size_t instruction_start_index)
7513 {
7514 #warning finish
7515 throw Parser_error(instruction_start_index,
7516 instruction_start_index,
7517 "instruction not implemented: "
7518 + std::string(get_enumerant_name(instruction.get_operation())));
7519 }
7520
7521 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_mul_hi(Open_cl_std_op_s_mul_hi instruction,
7522 std::size_t instruction_start_index)
7523 {
7524 #warning finish
7525 throw Parser_error(instruction_start_index,
7526 instruction_start_index,
7527 "instruction not implemented: "
7528 + std::string(get_enumerant_name(instruction.get_operation())));
7529 }
7530
7531 void Spirv_to_llvm::handle_instruction_open_cl_std_op_rotate(Open_cl_std_op_rotate instruction,
7532 std::size_t instruction_start_index)
7533 {
7534 #warning finish
7535 throw Parser_error(instruction_start_index,
7536 instruction_start_index,
7537 "instruction not implemented: "
7538 + std::string(get_enumerant_name(instruction.get_operation())));
7539 }
7540
7541 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_sub_sat(
7542 Open_cl_std_op_s_sub_sat instruction, std::size_t instruction_start_index)
7543 {
7544 #warning finish
7545 throw Parser_error(instruction_start_index,
7546 instruction_start_index,
7547 "instruction not implemented: "
7548 + std::string(get_enumerant_name(instruction.get_operation())));
7549 }
7550
7551 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_sub_sat(
7552 Open_cl_std_op_u_sub_sat instruction, std::size_t instruction_start_index)
7553 {
7554 #warning finish
7555 throw Parser_error(instruction_start_index,
7556 instruction_start_index,
7557 "instruction not implemented: "
7558 + std::string(get_enumerant_name(instruction.get_operation())));
7559 }
7560
7561 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_upsample(
7562 Open_cl_std_op_u_upsample instruction, std::size_t instruction_start_index)
7563 {
7564 #warning finish
7565 throw Parser_error(instruction_start_index,
7566 instruction_start_index,
7567 "instruction not implemented: "
7568 + std::string(get_enumerant_name(instruction.get_operation())));
7569 }
7570
7571 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_upsample(
7572 Open_cl_std_op_s_upsample instruction, std::size_t instruction_start_index)
7573 {
7574 #warning finish
7575 throw Parser_error(instruction_start_index,
7576 instruction_start_index,
7577 "instruction not implemented: "
7578 + std::string(get_enumerant_name(instruction.get_operation())));
7579 }
7580
7581 void Spirv_to_llvm::handle_instruction_open_cl_std_op_popcount(Open_cl_std_op_popcount instruction,
7582 std::size_t instruction_start_index)
7583 {
7584 #warning finish
7585 throw Parser_error(instruction_start_index,
7586 instruction_start_index,
7587 "instruction not implemented: "
7588 + std::string(get_enumerant_name(instruction.get_operation())));
7589 }
7590
7591 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_mad24(Open_cl_std_op_s_mad24 instruction,
7592 std::size_t instruction_start_index)
7593 {
7594 #warning finish
7595 throw Parser_error(instruction_start_index,
7596 instruction_start_index,
7597 "instruction not implemented: "
7598 + std::string(get_enumerant_name(instruction.get_operation())));
7599 }
7600
7601 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_mad24(Open_cl_std_op_u_mad24 instruction,
7602 std::size_t instruction_start_index)
7603 {
7604 #warning finish
7605 throw Parser_error(instruction_start_index,
7606 instruction_start_index,
7607 "instruction not implemented: "
7608 + std::string(get_enumerant_name(instruction.get_operation())));
7609 }
7610
7611 void Spirv_to_llvm::handle_instruction_open_cl_std_op_s_mul24(Open_cl_std_op_s_mul24 instruction,
7612 std::size_t instruction_start_index)
7613 {
7614 #warning finish
7615 throw Parser_error(instruction_start_index,
7616 instruction_start_index,
7617 "instruction not implemented: "
7618 + std::string(get_enumerant_name(instruction.get_operation())));
7619 }
7620
7621 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_mul24(Open_cl_std_op_u_mul24 instruction,
7622 std::size_t instruction_start_index)
7623 {
7624 #warning finish
7625 throw Parser_error(instruction_start_index,
7626 instruction_start_index,
7627 "instruction not implemented: "
7628 + std::string(get_enumerant_name(instruction.get_operation())));
7629 }
7630
7631 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_abs(Open_cl_std_op_u_abs instruction,
7632 std::size_t instruction_start_index)
7633 {
7634 #warning finish
7635 throw Parser_error(instruction_start_index,
7636 instruction_start_index,
7637 "instruction not implemented: "
7638 + std::string(get_enumerant_name(instruction.get_operation())));
7639 }
7640
7641 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_abs_diff(
7642 Open_cl_std_op_u_abs_diff instruction, std::size_t instruction_start_index)
7643 {
7644 #warning finish
7645 throw Parser_error(instruction_start_index,
7646 instruction_start_index,
7647 "instruction not implemented: "
7648 + std::string(get_enumerant_name(instruction.get_operation())));
7649 }
7650
7651 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_mul_hi(Open_cl_std_op_u_mul_hi instruction,
7652 std::size_t instruction_start_index)
7653 {
7654 #warning finish
7655 throw Parser_error(instruction_start_index,
7656 instruction_start_index,
7657 "instruction not implemented: "
7658 + std::string(get_enumerant_name(instruction.get_operation())));
7659 }
7660
7661 void Spirv_to_llvm::handle_instruction_open_cl_std_op_u_mad_hi(Open_cl_std_op_u_mad_hi instruction,
7662 std::size_t instruction_start_index)
7663 {
7664 #warning finish
7665 throw Parser_error(instruction_start_index,
7666 instruction_start_index,
7667 "instruction not implemented: "
7668 + std::string(get_enumerant_name(instruction.get_operation())));
7669 }
7670
7671 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fclamp(Open_cl_std_op_fclamp instruction,
7672 std::size_t instruction_start_index)
7673 {
7674 #warning finish
7675 throw Parser_error(instruction_start_index,
7676 instruction_start_index,
7677 "instruction not implemented: "
7678 + std::string(get_enumerant_name(instruction.get_operation())));
7679 }
7680
7681 void Spirv_to_llvm::handle_instruction_open_cl_std_op_degrees(Open_cl_std_op_degrees instruction,
7682 std::size_t instruction_start_index)
7683 {
7684 #warning finish
7685 throw Parser_error(instruction_start_index,
7686 instruction_start_index,
7687 "instruction not implemented: "
7688 + std::string(get_enumerant_name(instruction.get_operation())));
7689 }
7690
7691 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fmax_common(
7692 Open_cl_std_op_fmax_common instruction, std::size_t instruction_start_index)
7693 {
7694 #warning finish
7695 throw Parser_error(instruction_start_index,
7696 instruction_start_index,
7697 "instruction not implemented: "
7698 + std::string(get_enumerant_name(instruction.get_operation())));
7699 }
7700
7701 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fmin_common(
7702 Open_cl_std_op_fmin_common instruction, std::size_t instruction_start_index)
7703 {
7704 #warning finish
7705 throw Parser_error(instruction_start_index,
7706 instruction_start_index,
7707 "instruction not implemented: "
7708 + std::string(get_enumerant_name(instruction.get_operation())));
7709 }
7710
7711 void Spirv_to_llvm::handle_instruction_open_cl_std_op_mix(Open_cl_std_op_mix instruction,
7712 std::size_t instruction_start_index)
7713 {
7714 #warning finish
7715 throw Parser_error(instruction_start_index,
7716 instruction_start_index,
7717 "instruction not implemented: "
7718 + std::string(get_enumerant_name(instruction.get_operation())));
7719 }
7720
7721 void Spirv_to_llvm::handle_instruction_open_cl_std_op_radians(Open_cl_std_op_radians instruction,
7722 std::size_t instruction_start_index)
7723 {
7724 #warning finish
7725 throw Parser_error(instruction_start_index,
7726 instruction_start_index,
7727 "instruction not implemented: "
7728 + std::string(get_enumerant_name(instruction.get_operation())));
7729 }
7730
7731 void Spirv_to_llvm::handle_instruction_open_cl_std_op_step(Open_cl_std_op_step instruction,
7732 std::size_t instruction_start_index)
7733 {
7734 #warning finish
7735 throw Parser_error(instruction_start_index,
7736 instruction_start_index,
7737 "instruction not implemented: "
7738 + std::string(get_enumerant_name(instruction.get_operation())));
7739 }
7740
7741 void Spirv_to_llvm::handle_instruction_open_cl_std_op_smoothstep(
7742 Open_cl_std_op_smoothstep instruction, std::size_t instruction_start_index)
7743 {
7744 #warning finish
7745 throw Parser_error(instruction_start_index,
7746 instruction_start_index,
7747 "instruction not implemented: "
7748 + std::string(get_enumerant_name(instruction.get_operation())));
7749 }
7750
7751 void Spirv_to_llvm::handle_instruction_open_cl_std_op_sign(Open_cl_std_op_sign instruction,
7752 std::size_t instruction_start_index)
7753 {
7754 #warning finish
7755 throw Parser_error(instruction_start_index,
7756 instruction_start_index,
7757 "instruction not implemented: "
7758 + std::string(get_enumerant_name(instruction.get_operation())));
7759 }
7760
7761 void Spirv_to_llvm::handle_instruction_open_cl_std_op_cross(Open_cl_std_op_cross instruction,
7762 std::size_t instruction_start_index)
7763 {
7764 #warning finish
7765 throw Parser_error(instruction_start_index,
7766 instruction_start_index,
7767 "instruction not implemented: "
7768 + std::string(get_enumerant_name(instruction.get_operation())));
7769 }
7770
7771 void Spirv_to_llvm::handle_instruction_open_cl_std_op_distance(Open_cl_std_op_distance instruction,
7772 std::size_t instruction_start_index)
7773 {
7774 #warning finish
7775 throw Parser_error(instruction_start_index,
7776 instruction_start_index,
7777 "instruction not implemented: "
7778 + std::string(get_enumerant_name(instruction.get_operation())));
7779 }
7780
7781 void Spirv_to_llvm::handle_instruction_open_cl_std_op_length(Open_cl_std_op_length instruction,
7782 std::size_t instruction_start_index)
7783 {
7784 #warning finish
7785 throw Parser_error(instruction_start_index,
7786 instruction_start_index,
7787 "instruction not implemented: "
7788 + std::string(get_enumerant_name(instruction.get_operation())));
7789 }
7790
7791 void Spirv_to_llvm::handle_instruction_open_cl_std_op_normalize(
7792 Open_cl_std_op_normalize instruction, std::size_t instruction_start_index)
7793 {
7794 #warning finish
7795 throw Parser_error(instruction_start_index,
7796 instruction_start_index,
7797 "instruction not implemented: "
7798 + std::string(get_enumerant_name(instruction.get_operation())));
7799 }
7800
7801 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fast_distance(
7802 Open_cl_std_op_fast_distance instruction, std::size_t instruction_start_index)
7803 {
7804 #warning finish
7805 throw Parser_error(instruction_start_index,
7806 instruction_start_index,
7807 "instruction not implemented: "
7808 + std::string(get_enumerant_name(instruction.get_operation())));
7809 }
7810
7811 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fast_length(
7812 Open_cl_std_op_fast_length instruction, std::size_t instruction_start_index)
7813 {
7814 #warning finish
7815 throw Parser_error(instruction_start_index,
7816 instruction_start_index,
7817 "instruction not implemented: "
7818 + std::string(get_enumerant_name(instruction.get_operation())));
7819 }
7820
7821 void Spirv_to_llvm::handle_instruction_open_cl_std_op_fast_normalize(
7822 Open_cl_std_op_fast_normalize instruction, std::size_t instruction_start_index)
7823 {
7824 #warning finish
7825 throw Parser_error(instruction_start_index,
7826 instruction_start_index,
7827 "instruction not implemented: "
7828 + std::string(get_enumerant_name(instruction.get_operation())));
7829 }
7830
7831 void Spirv_to_llvm::handle_instruction_open_cl_std_op_bitselect(
7832 Open_cl_std_op_bitselect instruction, std::size_t instruction_start_index)
7833 {
7834 #warning finish
7835 throw Parser_error(instruction_start_index,
7836 instruction_start_index,
7837 "instruction not implemented: "
7838 + std::string(get_enumerant_name(instruction.get_operation())));
7839 }
7840
7841 void Spirv_to_llvm::handle_instruction_open_cl_std_op_select(Open_cl_std_op_select instruction,
7842 std::size_t instruction_start_index)
7843 {
7844 #warning finish
7845 throw Parser_error(instruction_start_index,
7846 instruction_start_index,
7847 "instruction not implemented: "
7848 + std::string(get_enumerant_name(instruction.get_operation())));
7849 }
7850
7851 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vloadn(Open_cl_std_op_vloadn instruction,
7852 std::size_t instruction_start_index)
7853 {
7854 #warning finish
7855 throw Parser_error(instruction_start_index,
7856 instruction_start_index,
7857 "instruction not implemented: "
7858 + std::string(get_enumerant_name(instruction.get_operation())));
7859 }
7860
7861 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstoren(Open_cl_std_op_vstoren instruction,
7862 std::size_t instruction_start_index)
7863 {
7864 #warning finish
7865 throw Parser_error(instruction_start_index,
7866 instruction_start_index,
7867 "instruction not implemented: "
7868 + std::string(get_enumerant_name(instruction.get_operation())));
7869 }
7870
7871 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vload_half(
7872 Open_cl_std_op_vload_half instruction, std::size_t instruction_start_index)
7873 {
7874 #warning finish
7875 throw Parser_error(instruction_start_index,
7876 instruction_start_index,
7877 "instruction not implemented: "
7878 + std::string(get_enumerant_name(instruction.get_operation())));
7879 }
7880
7881 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vload_halfn(
7882 Open_cl_std_op_vload_halfn instruction, std::size_t instruction_start_index)
7883 {
7884 #warning finish
7885 throw Parser_error(instruction_start_index,
7886 instruction_start_index,
7887 "instruction not implemented: "
7888 + std::string(get_enumerant_name(instruction.get_operation())));
7889 }
7890
7891 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstore_half(
7892 Open_cl_std_op_vstore_half instruction, std::size_t instruction_start_index)
7893 {
7894 #warning finish
7895 throw Parser_error(instruction_start_index,
7896 instruction_start_index,
7897 "instruction not implemented: "
7898 + std::string(get_enumerant_name(instruction.get_operation())));
7899 }
7900
7901 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstore_half_r(
7902 Open_cl_std_op_vstore_half_r instruction, std::size_t instruction_start_index)
7903 {
7904 #warning finish
7905 throw Parser_error(instruction_start_index,
7906 instruction_start_index,
7907 "instruction not implemented: "
7908 + std::string(get_enumerant_name(instruction.get_operation())));
7909 }
7910
7911 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstore_halfn(
7912 Open_cl_std_op_vstore_halfn instruction, std::size_t instruction_start_index)
7913 {
7914 #warning finish
7915 throw Parser_error(instruction_start_index,
7916 instruction_start_index,
7917 "instruction not implemented: "
7918 + std::string(get_enumerant_name(instruction.get_operation())));
7919 }
7920
7921 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstore_halfn_r(
7922 Open_cl_std_op_vstore_halfn_r instruction, std::size_t instruction_start_index)
7923 {
7924 #warning finish
7925 throw Parser_error(instruction_start_index,
7926 instruction_start_index,
7927 "instruction not implemented: "
7928 + std::string(get_enumerant_name(instruction.get_operation())));
7929 }
7930
7931 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vloada_halfn(
7932 Open_cl_std_op_vloada_halfn instruction, std::size_t instruction_start_index)
7933 {
7934 #warning finish
7935 throw Parser_error(instruction_start_index,
7936 instruction_start_index,
7937 "instruction not implemented: "
7938 + std::string(get_enumerant_name(instruction.get_operation())));
7939 }
7940
7941 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstorea_halfn(
7942 Open_cl_std_op_vstorea_halfn instruction, std::size_t instruction_start_index)
7943 {
7944 #warning finish
7945 throw Parser_error(instruction_start_index,
7946 instruction_start_index,
7947 "instruction not implemented: "
7948 + std::string(get_enumerant_name(instruction.get_operation())));
7949 }
7950
7951 void Spirv_to_llvm::handle_instruction_open_cl_std_op_vstorea_halfn_r(
7952 Open_cl_std_op_vstorea_halfn_r instruction, std::size_t instruction_start_index)
7953 {
7954 #warning finish
7955 throw Parser_error(instruction_start_index,
7956 instruction_start_index,
7957 "instruction not implemented: "
7958 + std::string(get_enumerant_name(instruction.get_operation())));
7959 }
7960
7961 void Spirv_to_llvm::handle_instruction_open_cl_std_op_shuffle(Open_cl_std_op_shuffle instruction,
7962 std::size_t instruction_start_index)
7963 {
7964 #warning finish
7965 throw Parser_error(instruction_start_index,
7966 instruction_start_index,
7967 "instruction not implemented: "
7968 + std::string(get_enumerant_name(instruction.get_operation())));
7969 }
7970
7971 void Spirv_to_llvm::handle_instruction_open_cl_std_op_shuffle2(Open_cl_std_op_shuffle2 instruction,
7972 std::size_t instruction_start_index)
7973 {
7974 #warning finish
7975 throw Parser_error(instruction_start_index,
7976 instruction_start_index,
7977 "instruction not implemented: "
7978 + std::string(get_enumerant_name(instruction.get_operation())));
7979 }
7980
7981 void Spirv_to_llvm::handle_instruction_open_cl_std_op_printf(Open_cl_std_op_printf instruction,
7982 std::size_t instruction_start_index)
7983 {
7984 #warning finish
7985 throw Parser_error(instruction_start_index,
7986 instruction_start_index,
7987 "instruction not implemented: "
7988 + std::string(get_enumerant_name(instruction.get_operation())));
7989 }
7990
7991 void Spirv_to_llvm::handle_instruction_open_cl_std_op_prefetch(Open_cl_std_op_prefetch instruction,
7992 std::size_t instruction_start_index)
7993 {
7994 #warning finish
7995 throw Parser_error(instruction_start_index,
7996 instruction_start_index,
7997 "instruction not implemented: "
7998 + std::string(get_enumerant_name(instruction.get_operation())));
7999 }
8000
8001 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_round(Glsl_std_450_op_round instruction,
8002 std::size_t instruction_start_index)
8003 {
8004 #warning finish
8005 throw Parser_error(instruction_start_index,
8006 instruction_start_index,
8007 "instruction not implemented: "
8008 + std::string(get_enumerant_name(instruction.get_operation())));
8009 }
8010
8011 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_round_even(
8012 Glsl_std_450_op_round_even instruction, std::size_t instruction_start_index)
8013 {
8014 #warning finish
8015 throw Parser_error(instruction_start_index,
8016 instruction_start_index,
8017 "instruction not implemented: "
8018 + std::string(get_enumerant_name(instruction.get_operation())));
8019 }
8020
8021 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_trunc(Glsl_std_450_op_trunc instruction,
8022 std::size_t instruction_start_index)
8023 {
8024 #warning finish
8025 throw Parser_error(instruction_start_index,
8026 instruction_start_index,
8027 "instruction not implemented: "
8028 + std::string(get_enumerant_name(instruction.get_operation())));
8029 }
8030
8031 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_abs(Glsl_std_450_op_f_abs instruction,
8032 std::size_t instruction_start_index)
8033 {
8034 #warning finish
8035 throw Parser_error(instruction_start_index,
8036 instruction_start_index,
8037 "instruction not implemented: "
8038 + std::string(get_enumerant_name(instruction.get_operation())));
8039 }
8040
8041 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_s_abs(Glsl_std_450_op_s_abs instruction,
8042 std::size_t instruction_start_index)
8043 {
8044 #warning finish
8045 throw Parser_error(instruction_start_index,
8046 instruction_start_index,
8047 "instruction not implemented: "
8048 + std::string(get_enumerant_name(instruction.get_operation())));
8049 }
8050
8051 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_sign(Glsl_std_450_op_f_sign instruction,
8052 std::size_t instruction_start_index)
8053 {
8054 #warning finish
8055 throw Parser_error(instruction_start_index,
8056 instruction_start_index,
8057 "instruction not implemented: "
8058 + std::string(get_enumerant_name(instruction.get_operation())));
8059 }
8060
8061 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_s_sign(Glsl_std_450_op_s_sign instruction,
8062 std::size_t instruction_start_index)
8063 {
8064 #warning finish
8065 throw Parser_error(instruction_start_index,
8066 instruction_start_index,
8067 "instruction not implemented: "
8068 + std::string(get_enumerant_name(instruction.get_operation())));
8069 }
8070
8071 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_floor(Glsl_std_450_op_floor instruction,
8072 std::size_t instruction_start_index)
8073 {
8074 #warning finish
8075 throw Parser_error(instruction_start_index,
8076 instruction_start_index,
8077 "instruction not implemented: "
8078 + std::string(get_enumerant_name(instruction.get_operation())));
8079 }
8080
8081 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_ceil(Glsl_std_450_op_ceil instruction,
8082 std::size_t instruction_start_index)
8083 {
8084 #warning finish
8085 throw Parser_error(instruction_start_index,
8086 instruction_start_index,
8087 "instruction not implemented: "
8088 + std::string(get_enumerant_name(instruction.get_operation())));
8089 }
8090
8091 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_fract(Glsl_std_450_op_fract instruction,
8092 std::size_t instruction_start_index)
8093 {
8094 #warning finish
8095 throw Parser_error(instruction_start_index,
8096 instruction_start_index,
8097 "instruction not implemented: "
8098 + std::string(get_enumerant_name(instruction.get_operation())));
8099 }
8100
8101 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_radians(Glsl_std_450_op_radians instruction,
8102 std::size_t instruction_start_index)
8103 {
8104 #warning finish
8105 throw Parser_error(instruction_start_index,
8106 instruction_start_index,
8107 "instruction not implemented: "
8108 + std::string(get_enumerant_name(instruction.get_operation())));
8109 }
8110
8111 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_degrees(Glsl_std_450_op_degrees instruction,
8112 std::size_t instruction_start_index)
8113 {
8114 #warning finish
8115 throw Parser_error(instruction_start_index,
8116 instruction_start_index,
8117 "instruction not implemented: "
8118 + std::string(get_enumerant_name(instruction.get_operation())));
8119 }
8120
8121 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_sin(Glsl_std_450_op_sin instruction,
8122 std::size_t instruction_start_index)
8123 {
8124 #warning finish
8125 throw Parser_error(instruction_start_index,
8126 instruction_start_index,
8127 "instruction not implemented: "
8128 + std::string(get_enumerant_name(instruction.get_operation())));
8129 }
8130
8131 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_cos(Glsl_std_450_op_cos instruction,
8132 std::size_t instruction_start_index)
8133 {
8134 #warning finish
8135 throw Parser_error(instruction_start_index,
8136 instruction_start_index,
8137 "instruction not implemented: "
8138 + std::string(get_enumerant_name(instruction.get_operation())));
8139 }
8140
8141 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_tan(Glsl_std_450_op_tan instruction,
8142 std::size_t instruction_start_index)
8143 {
8144 #warning finish
8145 throw Parser_error(instruction_start_index,
8146 instruction_start_index,
8147 "instruction not implemented: "
8148 + std::string(get_enumerant_name(instruction.get_operation())));
8149 }
8150
8151 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_asin(Glsl_std_450_op_asin instruction,
8152 std::size_t instruction_start_index)
8153 {
8154 #warning finish
8155 throw Parser_error(instruction_start_index,
8156 instruction_start_index,
8157 "instruction not implemented: "
8158 + std::string(get_enumerant_name(instruction.get_operation())));
8159 }
8160
8161 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_acos(Glsl_std_450_op_acos instruction,
8162 std::size_t instruction_start_index)
8163 {
8164 #warning finish
8165 throw Parser_error(instruction_start_index,
8166 instruction_start_index,
8167 "instruction not implemented: "
8168 + std::string(get_enumerant_name(instruction.get_operation())));
8169 }
8170
8171 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_atan(Glsl_std_450_op_atan instruction,
8172 std::size_t instruction_start_index)
8173 {
8174 #warning finish
8175 throw Parser_error(instruction_start_index,
8176 instruction_start_index,
8177 "instruction not implemented: "
8178 + std::string(get_enumerant_name(instruction.get_operation())));
8179 }
8180
8181 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_sinh(Glsl_std_450_op_sinh instruction,
8182 std::size_t instruction_start_index)
8183 {
8184 #warning finish
8185 throw Parser_error(instruction_start_index,
8186 instruction_start_index,
8187 "instruction not implemented: "
8188 + std::string(get_enumerant_name(instruction.get_operation())));
8189 }
8190
8191 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_cosh(Glsl_std_450_op_cosh instruction,
8192 std::size_t instruction_start_index)
8193 {
8194 #warning finish
8195 throw Parser_error(instruction_start_index,
8196 instruction_start_index,
8197 "instruction not implemented: "
8198 + std::string(get_enumerant_name(instruction.get_operation())));
8199 }
8200
8201 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_tanh(Glsl_std_450_op_tanh instruction,
8202 std::size_t instruction_start_index)
8203 {
8204 #warning finish
8205 throw Parser_error(instruction_start_index,
8206 instruction_start_index,
8207 "instruction not implemented: "
8208 + std::string(get_enumerant_name(instruction.get_operation())));
8209 }
8210
8211 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_asinh(Glsl_std_450_op_asinh instruction,
8212 std::size_t instruction_start_index)
8213 {
8214 #warning finish
8215 throw Parser_error(instruction_start_index,
8216 instruction_start_index,
8217 "instruction not implemented: "
8218 + std::string(get_enumerant_name(instruction.get_operation())));
8219 }
8220
8221 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_acosh(Glsl_std_450_op_acosh instruction,
8222 std::size_t instruction_start_index)
8223 {
8224 #warning finish
8225 throw Parser_error(instruction_start_index,
8226 instruction_start_index,
8227 "instruction not implemented: "
8228 + std::string(get_enumerant_name(instruction.get_operation())));
8229 }
8230
8231 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_atanh(Glsl_std_450_op_atanh instruction,
8232 std::size_t instruction_start_index)
8233 {
8234 #warning finish
8235 throw Parser_error(instruction_start_index,
8236 instruction_start_index,
8237 "instruction not implemented: "
8238 + std::string(get_enumerant_name(instruction.get_operation())));
8239 }
8240
8241 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_atan2(Glsl_std_450_op_atan2 instruction,
8242 std::size_t instruction_start_index)
8243 {
8244 #warning finish
8245 throw Parser_error(instruction_start_index,
8246 instruction_start_index,
8247 "instruction not implemented: "
8248 + std::string(get_enumerant_name(instruction.get_operation())));
8249 }
8250
8251 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pow(Glsl_std_450_op_pow instruction,
8252 std::size_t instruction_start_index)
8253 {
8254 #warning finish
8255 throw Parser_error(instruction_start_index,
8256 instruction_start_index,
8257 "instruction not implemented: "
8258 + std::string(get_enumerant_name(instruction.get_operation())));
8259 }
8260
8261 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_exp(Glsl_std_450_op_exp instruction,
8262 std::size_t instruction_start_index)
8263 {
8264 #warning finish
8265 throw Parser_error(instruction_start_index,
8266 instruction_start_index,
8267 "instruction not implemented: "
8268 + std::string(get_enumerant_name(instruction.get_operation())));
8269 }
8270
8271 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_log(Glsl_std_450_op_log instruction,
8272 std::size_t instruction_start_index)
8273 {
8274 #warning finish
8275 throw Parser_error(instruction_start_index,
8276 instruction_start_index,
8277 "instruction not implemented: "
8278 + std::string(get_enumerant_name(instruction.get_operation())));
8279 }
8280
8281 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_exp2(Glsl_std_450_op_exp2 instruction,
8282 std::size_t instruction_start_index)
8283 {
8284 #warning finish
8285 throw Parser_error(instruction_start_index,
8286 instruction_start_index,
8287 "instruction not implemented: "
8288 + std::string(get_enumerant_name(instruction.get_operation())));
8289 }
8290
8291 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_log2(Glsl_std_450_op_log2 instruction,
8292 std::size_t instruction_start_index)
8293 {
8294 #warning finish
8295 throw Parser_error(instruction_start_index,
8296 instruction_start_index,
8297 "instruction not implemented: "
8298 + std::string(get_enumerant_name(instruction.get_operation())));
8299 }
8300
8301 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_sqrt(Glsl_std_450_op_sqrt instruction,
8302 std::size_t instruction_start_index)
8303 {
8304 #warning finish
8305 throw Parser_error(instruction_start_index,
8306 instruction_start_index,
8307 "instruction not implemented: "
8308 + std::string(get_enumerant_name(instruction.get_operation())));
8309 }
8310
8311 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_inverse_sqrt(
8312 Glsl_std_450_op_inverse_sqrt instruction, std::size_t instruction_start_index)
8313 {
8314 #warning finish
8315 throw Parser_error(instruction_start_index,
8316 instruction_start_index,
8317 "instruction not implemented: "
8318 + std::string(get_enumerant_name(instruction.get_operation())));
8319 }
8320
8321 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_determinant(
8322 Glsl_std_450_op_determinant instruction, std::size_t instruction_start_index)
8323 {
8324 #warning finish
8325 throw Parser_error(instruction_start_index,
8326 instruction_start_index,
8327 "instruction not implemented: "
8328 + std::string(get_enumerant_name(instruction.get_operation())));
8329 }
8330
8331 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_matrix_inverse(
8332 Glsl_std_450_op_matrix_inverse instruction, std::size_t instruction_start_index)
8333 {
8334 #warning finish
8335 throw Parser_error(instruction_start_index,
8336 instruction_start_index,
8337 "instruction not implemented: "
8338 + std::string(get_enumerant_name(instruction.get_operation())));
8339 }
8340
8341 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_modf(Glsl_std_450_op_modf instruction,
8342 std::size_t instruction_start_index)
8343 {
8344 #warning finish
8345 throw Parser_error(instruction_start_index,
8346 instruction_start_index,
8347 "instruction not implemented: "
8348 + std::string(get_enumerant_name(instruction.get_operation())));
8349 }
8350
8351 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_modf_struct(
8352 Glsl_std_450_op_modf_struct instruction, std::size_t instruction_start_index)
8353 {
8354 #warning finish
8355 throw Parser_error(instruction_start_index,
8356 instruction_start_index,
8357 "instruction not implemented: "
8358 + std::string(get_enumerant_name(instruction.get_operation())));
8359 }
8360
8361 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_min(Glsl_std_450_op_f_min instruction,
8362 std::size_t instruction_start_index)
8363 {
8364 #warning finish
8365 throw Parser_error(instruction_start_index,
8366 instruction_start_index,
8367 "instruction not implemented: "
8368 + std::string(get_enumerant_name(instruction.get_operation())));
8369 }
8370
8371 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_u_min(Glsl_std_450_op_u_min instruction,
8372 std::size_t instruction_start_index)
8373 {
8374 #warning finish
8375 throw Parser_error(instruction_start_index,
8376 instruction_start_index,
8377 "instruction not implemented: "
8378 + std::string(get_enumerant_name(instruction.get_operation())));
8379 }
8380
8381 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_s_min(Glsl_std_450_op_s_min instruction,
8382 std::size_t instruction_start_index)
8383 {
8384 #warning finish
8385 throw Parser_error(instruction_start_index,
8386 instruction_start_index,
8387 "instruction not implemented: "
8388 + std::string(get_enumerant_name(instruction.get_operation())));
8389 }
8390
8391 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_max(Glsl_std_450_op_f_max instruction,
8392 std::size_t instruction_start_index)
8393 {
8394 #warning finish
8395 throw Parser_error(instruction_start_index,
8396 instruction_start_index,
8397 "instruction not implemented: "
8398 + std::string(get_enumerant_name(instruction.get_operation())));
8399 }
8400
8401 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_u_max(Glsl_std_450_op_u_max instruction,
8402 std::size_t instruction_start_index)
8403 {
8404 #warning finish
8405 throw Parser_error(instruction_start_index,
8406 instruction_start_index,
8407 "instruction not implemented: "
8408 + std::string(get_enumerant_name(instruction.get_operation())));
8409 }
8410
8411 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_s_max(Glsl_std_450_op_s_max instruction,
8412 std::size_t instruction_start_index)
8413 {
8414 #warning finish
8415 throw Parser_error(instruction_start_index,
8416 instruction_start_index,
8417 "instruction not implemented: "
8418 + std::string(get_enumerant_name(instruction.get_operation())));
8419 }
8420
8421 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_clamp(Glsl_std_450_op_f_clamp instruction,
8422 std::size_t instruction_start_index)
8423 {
8424 #warning finish
8425 throw Parser_error(instruction_start_index,
8426 instruction_start_index,
8427 "instruction not implemented: "
8428 + std::string(get_enumerant_name(instruction.get_operation())));
8429 }
8430
8431 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_u_clamp(Glsl_std_450_op_u_clamp instruction,
8432 std::size_t instruction_start_index)
8433 {
8434 #warning finish
8435 throw Parser_error(instruction_start_index,
8436 instruction_start_index,
8437 "instruction not implemented: "
8438 + std::string(get_enumerant_name(instruction.get_operation())));
8439 }
8440
8441 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_s_clamp(Glsl_std_450_op_s_clamp instruction,
8442 std::size_t instruction_start_index)
8443 {
8444 #warning finish
8445 throw Parser_error(instruction_start_index,
8446 instruction_start_index,
8447 "instruction not implemented: "
8448 + std::string(get_enumerant_name(instruction.get_operation())));
8449 }
8450
8451 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_f_mix(Glsl_std_450_op_f_mix instruction,
8452 std::size_t instruction_start_index)
8453 {
8454 #warning finish
8455 throw Parser_error(instruction_start_index,
8456 instruction_start_index,
8457 "instruction not implemented: "
8458 + std::string(get_enumerant_name(instruction.get_operation())));
8459 }
8460
8461 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_i_mix(Glsl_std_450_op_i_mix instruction,
8462 std::size_t instruction_start_index)
8463 {
8464 #warning finish
8465 throw Parser_error(instruction_start_index,
8466 instruction_start_index,
8467 "instruction not implemented: "
8468 + std::string(get_enumerant_name(instruction.get_operation())));
8469 }
8470
8471 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_step(Glsl_std_450_op_step instruction,
8472 std::size_t instruction_start_index)
8473 {
8474 #warning finish
8475 throw Parser_error(instruction_start_index,
8476 instruction_start_index,
8477 "instruction not implemented: "
8478 + std::string(get_enumerant_name(instruction.get_operation())));
8479 }
8480
8481 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_smooth_step(
8482 Glsl_std_450_op_smooth_step instruction, std::size_t instruction_start_index)
8483 {
8484 #warning finish
8485 throw Parser_error(instruction_start_index,
8486 instruction_start_index,
8487 "instruction not implemented: "
8488 + std::string(get_enumerant_name(instruction.get_operation())));
8489 }
8490
8491 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_fma(Glsl_std_450_op_fma instruction,
8492 std::size_t instruction_start_index)
8493 {
8494 #warning finish
8495 throw Parser_error(instruction_start_index,
8496 instruction_start_index,
8497 "instruction not implemented: "
8498 + std::string(get_enumerant_name(instruction.get_operation())));
8499 }
8500
8501 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_frexp(Glsl_std_450_op_frexp instruction,
8502 std::size_t instruction_start_index)
8503 {
8504 #warning finish
8505 throw Parser_error(instruction_start_index,
8506 instruction_start_index,
8507 "instruction not implemented: "
8508 + std::string(get_enumerant_name(instruction.get_operation())));
8509 }
8510
8511 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_frexp_struct(
8512 Glsl_std_450_op_frexp_struct instruction, std::size_t instruction_start_index)
8513 {
8514 #warning finish
8515 throw Parser_error(instruction_start_index,
8516 instruction_start_index,
8517 "instruction not implemented: "
8518 + std::string(get_enumerant_name(instruction.get_operation())));
8519 }
8520
8521 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_ldexp(Glsl_std_450_op_ldexp instruction,
8522 std::size_t instruction_start_index)
8523 {
8524 #warning finish
8525 throw Parser_error(instruction_start_index,
8526 instruction_start_index,
8527 "instruction not implemented: "
8528 + std::string(get_enumerant_name(instruction.get_operation())));
8529 }
8530
8531 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_snorm4x8(
8532 Glsl_std_450_op_pack_snorm4x8 instruction, std::size_t instruction_start_index)
8533 {
8534 #warning finish
8535 throw Parser_error(instruction_start_index,
8536 instruction_start_index,
8537 "instruction not implemented: "
8538 + std::string(get_enumerant_name(instruction.get_operation())));
8539 }
8540
8541 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_unorm4x8(
8542 Glsl_std_450_op_pack_unorm4x8 instruction, std::size_t instruction_start_index)
8543 {
8544 #warning finish
8545 throw Parser_error(instruction_start_index,
8546 instruction_start_index,
8547 "instruction not implemented: "
8548 + std::string(get_enumerant_name(instruction.get_operation())));
8549 }
8550
8551 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_snorm2x16(
8552 Glsl_std_450_op_pack_snorm2x16 instruction, std::size_t instruction_start_index)
8553 {
8554 #warning finish
8555 throw Parser_error(instruction_start_index,
8556 instruction_start_index,
8557 "instruction not implemented: "
8558 + std::string(get_enumerant_name(instruction.get_operation())));
8559 }
8560
8561 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_unorm2x16(
8562 Glsl_std_450_op_pack_unorm2x16 instruction, std::size_t instruction_start_index)
8563 {
8564 #warning finish
8565 throw Parser_error(instruction_start_index,
8566 instruction_start_index,
8567 "instruction not implemented: "
8568 + std::string(get_enumerant_name(instruction.get_operation())));
8569 }
8570
8571 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_half2x16(
8572 Glsl_std_450_op_pack_half2x16 instruction, std::size_t instruction_start_index)
8573 {
8574 #warning finish
8575 throw Parser_error(instruction_start_index,
8576 instruction_start_index,
8577 "instruction not implemented: "
8578 + std::string(get_enumerant_name(instruction.get_operation())));
8579 }
8580
8581 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_pack_double2x32(
8582 Glsl_std_450_op_pack_double2x32 instruction, std::size_t instruction_start_index)
8583 {
8584 #warning finish
8585 throw Parser_error(instruction_start_index,
8586 instruction_start_index,
8587 "instruction not implemented: "
8588 + std::string(get_enumerant_name(instruction.get_operation())));
8589 }
8590
8591 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_snorm2x16(
8592 Glsl_std_450_op_unpack_snorm2x16 instruction, std::size_t instruction_start_index)
8593 {
8594 #warning finish
8595 throw Parser_error(instruction_start_index,
8596 instruction_start_index,
8597 "instruction not implemented: "
8598 + std::string(get_enumerant_name(instruction.get_operation())));
8599 }
8600
8601 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_unorm2x16(
8602 Glsl_std_450_op_unpack_unorm2x16 instruction, std::size_t instruction_start_index)
8603 {
8604 #warning finish
8605 throw Parser_error(instruction_start_index,
8606 instruction_start_index,
8607 "instruction not implemented: "
8608 + std::string(get_enumerant_name(instruction.get_operation())));
8609 }
8610
8611 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_half2x16(
8612 Glsl_std_450_op_unpack_half2x16 instruction, std::size_t instruction_start_index)
8613 {
8614 #warning finish
8615 throw Parser_error(instruction_start_index,
8616 instruction_start_index,
8617 "instruction not implemented: "
8618 + std::string(get_enumerant_name(instruction.get_operation())));
8619 }
8620
8621 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_snorm4x8(
8622 Glsl_std_450_op_unpack_snorm4x8 instruction, std::size_t instruction_start_index)
8623 {
8624 #warning finish
8625 throw Parser_error(instruction_start_index,
8626 instruction_start_index,
8627 "instruction not implemented: "
8628 + std::string(get_enumerant_name(instruction.get_operation())));
8629 }
8630
8631 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_unorm4x8(
8632 Glsl_std_450_op_unpack_unorm4x8 instruction, std::size_t instruction_start_index)
8633 {
8634 #warning finish
8635 throw Parser_error(instruction_start_index,
8636 instruction_start_index,
8637 "instruction not implemented: "
8638 + std::string(get_enumerant_name(instruction.get_operation())));
8639 }
8640
8641 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_unpack_double2x32(
8642 Glsl_std_450_op_unpack_double2x32 instruction, std::size_t instruction_start_index)
8643 {
8644 #warning finish
8645 throw Parser_error(instruction_start_index,
8646 instruction_start_index,
8647 "instruction not implemented: "
8648 + std::string(get_enumerant_name(instruction.get_operation())));
8649 }
8650
8651 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_length(Glsl_std_450_op_length instruction,
8652 std::size_t instruction_start_index)
8653 {
8654 #warning finish
8655 throw Parser_error(instruction_start_index,
8656 instruction_start_index,
8657 "instruction not implemented: "
8658 + std::string(get_enumerant_name(instruction.get_operation())));
8659 }
8660
8661 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_distance(
8662 Glsl_std_450_op_distance instruction, std::size_t instruction_start_index)
8663 {
8664 #warning finish
8665 throw Parser_error(instruction_start_index,
8666 instruction_start_index,
8667 "instruction not implemented: "
8668 + std::string(get_enumerant_name(instruction.get_operation())));
8669 }
8670
8671 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_cross(Glsl_std_450_op_cross instruction,
8672 std::size_t instruction_start_index)
8673 {
8674 #warning finish
8675 throw Parser_error(instruction_start_index,
8676 instruction_start_index,
8677 "instruction not implemented: "
8678 + std::string(get_enumerant_name(instruction.get_operation())));
8679 }
8680
8681 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_normalize(
8682 Glsl_std_450_op_normalize instruction, std::size_t instruction_start_index)
8683 {
8684 #warning finish
8685 throw Parser_error(instruction_start_index,
8686 instruction_start_index,
8687 "instruction not implemented: "
8688 + std::string(get_enumerant_name(instruction.get_operation())));
8689 }
8690
8691 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_face_forward(
8692 Glsl_std_450_op_face_forward instruction, std::size_t instruction_start_index)
8693 {
8694 #warning finish
8695 throw Parser_error(instruction_start_index,
8696 instruction_start_index,
8697 "instruction not implemented: "
8698 + std::string(get_enumerant_name(instruction.get_operation())));
8699 }
8700
8701 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_reflect(Glsl_std_450_op_reflect instruction,
8702 std::size_t instruction_start_index)
8703 {
8704 #warning finish
8705 throw Parser_error(instruction_start_index,
8706 instruction_start_index,
8707 "instruction not implemented: "
8708 + std::string(get_enumerant_name(instruction.get_operation())));
8709 }
8710
8711 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_refract(Glsl_std_450_op_refract instruction,
8712 std::size_t instruction_start_index)
8713 {
8714 #warning finish
8715 throw Parser_error(instruction_start_index,
8716 instruction_start_index,
8717 "instruction not implemented: "
8718 + std::string(get_enumerant_name(instruction.get_operation())));
8719 }
8720
8721 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_find_i_lsb(
8722 Glsl_std_450_op_find_i_lsb instruction, std::size_t instruction_start_index)
8723 {
8724 #warning finish
8725 throw Parser_error(instruction_start_index,
8726 instruction_start_index,
8727 "instruction not implemented: "
8728 + std::string(get_enumerant_name(instruction.get_operation())));
8729 }
8730
8731 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_find_s_msb(
8732 Glsl_std_450_op_find_s_msb instruction, std::size_t instruction_start_index)
8733 {
8734 #warning finish
8735 throw Parser_error(instruction_start_index,
8736 instruction_start_index,
8737 "instruction not implemented: "
8738 + std::string(get_enumerant_name(instruction.get_operation())));
8739 }
8740
8741 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_find_u_msb(
8742 Glsl_std_450_op_find_u_msb instruction, std::size_t instruction_start_index)
8743 {
8744 #warning finish
8745 throw Parser_error(instruction_start_index,
8746 instruction_start_index,
8747 "instruction not implemented: "
8748 + std::string(get_enumerant_name(instruction.get_operation())));
8749 }
8750
8751 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_interpolate_at_centroid(
8752 Glsl_std_450_op_interpolate_at_centroid instruction, std::size_t instruction_start_index)
8753 {
8754 #warning finish
8755 throw Parser_error(instruction_start_index,
8756 instruction_start_index,
8757 "instruction not implemented: "
8758 + std::string(get_enumerant_name(instruction.get_operation())));
8759 }
8760
8761 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_interpolate_at_sample(
8762 Glsl_std_450_op_interpolate_at_sample instruction, std::size_t instruction_start_index)
8763 {
8764 #warning finish
8765 throw Parser_error(instruction_start_index,
8766 instruction_start_index,
8767 "instruction not implemented: "
8768 + std::string(get_enumerant_name(instruction.get_operation())));
8769 }
8770
8771 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_interpolate_at_offset(
8772 Glsl_std_450_op_interpolate_at_offset instruction, std::size_t instruction_start_index)
8773 {
8774 #warning finish
8775 throw Parser_error(instruction_start_index,
8776 instruction_start_index,
8777 "instruction not implemented: "
8778 + std::string(get_enumerant_name(instruction.get_operation())));
8779 }
8780
8781 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_n_min(Glsl_std_450_op_n_min instruction,
8782 std::size_t instruction_start_index)
8783 {
8784 #warning finish
8785 throw Parser_error(instruction_start_index,
8786 instruction_start_index,
8787 "instruction not implemented: "
8788 + std::string(get_enumerant_name(instruction.get_operation())));
8789 }
8790
8791 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_n_max(Glsl_std_450_op_n_max instruction,
8792 std::size_t instruction_start_index)
8793 {
8794 #warning finish
8795 throw Parser_error(instruction_start_index,
8796 instruction_start_index,
8797 "instruction not implemented: "
8798 + std::string(get_enumerant_name(instruction.get_operation())));
8799 }
8800
8801 void Spirv_to_llvm::handle_instruction_glsl_std_450_op_n_clamp(Glsl_std_450_op_n_clamp instruction,
8802 std::size_t instruction_start_index)
8803 {
8804 #warning finish
8805 throw Parser_error(instruction_start_index,
8806 instruction_start_index,
8807 "instruction not implemented: "
8808 + std::string(get_enumerant_name(instruction.get_operation())));
8809 }
8810
8811 Converted_module spirv_to_llvm(::LLVMContextRef context,
8812 ::LLVMTargetMachineRef target_machine,
8813 const Word *shader_words,
8814 std::size_t shader_size,
8815 std::uint64_t shader_id)
8816 {
8817 return Spirv_to_llvm(context, target_machine, shader_id).run(shader_words, shader_size);
8818 }
8819 }
8820 }