summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend')
-rw-r--r--src/shader_recompiler/frontend/ir/abstract_syntax_list.h5
-rw-r--r--src/shader_recompiler/frontend/ir/attribute.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/attribute.h5
-rw-r--r--src/shader_recompiler/frontend/ir/basic_block.cpp7
-rw-r--r--src/shader_recompiler/frontend/ir/basic_block.h5
-rw-r--r--src/shader_recompiler/frontend/ir/breadth_first_search.h5
-rw-r--r--src/shader_recompiler/frontend/ir/condition.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/condition.h6
-rw-r--r--src/shader_recompiler/frontend/ir/flow_test.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/flow_test.h5
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp10
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h7
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp10
-rw-r--r--src/shader_recompiler/frontend/ir/modifiers.h5
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.cpp7
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.h8
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc5
-rw-r--r--src/shader_recompiler/frontend/ir/patch.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/patch.h5
-rw-r--r--src/shader_recompiler/frontend/ir/post_order.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/post_order.h5
-rw-r--r--src/shader_recompiler/frontend/ir/pred.h5
-rw-r--r--src/shader_recompiler/frontend/ir/program.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/program.h5
-rw-r--r--src/shader_recompiler/frontend/ir/reg.h5
-rw-r--r--src/shader_recompiler/frontend/ir/type.cpp5
-rw-r--r--src/shader_recompiler/frontend/ir/type.h5
-rw-r--r--src/shader_recompiler/frontend/ir/value.cpp6
-rw-r--r--src/shader_recompiler/frontend/ir/value.h9
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.h9
-rw-r--r--src/shader_recompiler/frontend/maxwell/decode.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/decode.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.h6
-rw-r--r--src/shader_recompiler/frontend/maxwell/instruction.h6
-rw-r--r--src/shader_recompiler/frontend/maxwell/location.h8
-rw-r--r--src/shader_recompiler/frontend/maxwell/maxwell.inc5
-rw-r--r--src/shader_recompiler/frontend/maxwell/opcodes.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/opcodes.h7
-rw-r--r--src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp19
-rw-r--r--src/shader_recompiler/frontend/maxwell/structured_control_flow.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_insert.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/branch_indirect.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/condition_code_set.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_compare_and_set.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_min_max.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/double_set_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp10
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/find_leading_one.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multi_function.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_range_reduction.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/impl.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_funnel_shift.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_minimum_maximum.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_popcount.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_scaled_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_set_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_left.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_right.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_short_multiply_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp19
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_effective_address.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input.cpp585
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py90
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_predicate_to_register.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_register_to_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/output_geometry.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/pixel_load.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/select_source_with_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp8
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_gradient.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp9
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp9
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp6
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_multiply_add.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp7
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/translate.cpp5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/translate.h5
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.cpp9
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.h10
138 files changed, 941 insertions, 527 deletions
diff --git a/src/shader_recompiler/frontend/ir/abstract_syntax_list.h b/src/shader_recompiler/frontend/ir/abstract_syntax_list.h
index b61773487..7edf21e8a 100644
--- a/src/shader_recompiler/frontend/ir/abstract_syntax_list.h
+++ b/src/shader_recompiler/frontend/ir/abstract_syntax_list.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/attribute.cpp b/src/shader_recompiler/frontend/ir/attribute.cpp
index 4d0b8b8e5..7d3d882e4 100644
--- a/src/shader_recompiler/frontend/ir/attribute.cpp
+++ b/src/shader_recompiler/frontend/ir/attribute.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <fmt/format.h> 4#include <fmt/format.h>
6 5
diff --git a/src/shader_recompiler/frontend/ir/attribute.h b/src/shader_recompiler/frontend/ir/attribute.h
index 3bbd38a03..6ee3947b1 100644
--- a/src/shader_recompiler/frontend/ir/attribute.h
+++ b/src/shader_recompiler/frontend/ir/attribute.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/basic_block.cpp b/src/shader_recompiler/frontend/ir/basic_block.cpp
index 974efa4a0..14293770e 100644
--- a/src/shader_recompiler/frontend/ir/basic_block.cpp
+++ b/src/shader_recompiler/frontend/ir/basic_block.cpp
@@ -1,13 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <initializer_list> 5#include <initializer_list>
7#include <map> 6#include <map>
8#include <memory>
9 7
10#include "common/bit_cast.h"
11#include "common/common_types.h" 8#include "common/common_types.h"
12#include "shader_recompiler/frontend/ir/basic_block.h" 9#include "shader_recompiler/frontend/ir/basic_block.h"
13#include "shader_recompiler/frontend/ir/value.h" 10#include "shader_recompiler/frontend/ir/value.h"
diff --git a/src/shader_recompiler/frontend/ir/basic_block.h b/src/shader_recompiler/frontend/ir/basic_block.h
index fbfe98266..c9d83661a 100644
--- a/src/shader_recompiler/frontend/ir/basic_block.h
+++ b/src/shader_recompiler/frontend/ir/basic_block.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/breadth_first_search.h b/src/shader_recompiler/frontend/ir/breadth_first_search.h
index a52ccbd58..ec5542554 100644
--- a/src/shader_recompiler/frontend/ir/breadth_first_search.h
+++ b/src/shader_recompiler/frontend/ir/breadth_first_search.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/condition.cpp b/src/shader_recompiler/frontend/ir/condition.cpp
index fc18ea2a2..fb6b141d3 100644
--- a/src/shader_recompiler/frontend/ir/condition.cpp
+++ b/src/shader_recompiler/frontend/ir/condition.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <string> 4#include <string>
6 5
diff --git a/src/shader_recompiler/frontend/ir/condition.h b/src/shader_recompiler/frontend/ir/condition.h
index aa8597c60..1cad46b9b 100644
--- a/src/shader_recompiler/frontend/ir/condition.h
+++ b/src/shader_recompiler/frontend/ir/condition.h
@@ -1,10 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include <compare>
8#include <string> 6#include <string>
9 7
10#include <fmt/format.h> 8#include <fmt/format.h>
diff --git a/src/shader_recompiler/frontend/ir/flow_test.cpp b/src/shader_recompiler/frontend/ir/flow_test.cpp
index 6ebb4ad89..a859efdde 100644
--- a/src/shader_recompiler/frontend/ir/flow_test.cpp
+++ b/src/shader_recompiler/frontend/ir/flow_test.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <string> 4#include <string>
6 5
diff --git a/src/shader_recompiler/frontend/ir/flow_test.h b/src/shader_recompiler/frontend/ir/flow_test.h
index 09e113773..88f7c9e82 100644
--- a/src/shader_recompiler/frontend/ir/flow_test.h
+++ b/src/shader_recompiler/frontend/ir/flow_test.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 356f889ac..11086ed8c 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_cast.h" 4#include "common/bit_cast.h"
6#include "shader_recompiler/frontend/ir/ir_emitter.h" 5#include "shader_recompiler/frontend/ir/ir_emitter.h"
@@ -1833,6 +1832,11 @@ Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod) {
1833 return Inst(op, handle, lod); 1832 return Inst(op, handle, lod);
1834} 1833}
1835 1834
1835Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod,
1836 TextureInstInfo info) {
1837 return Inst(Opcode::ImageQueryDimensions, Flags{info}, handle, lod);
1838}
1839
1836Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, TextureInstInfo info) { 1840Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, TextureInstInfo info) {
1837 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryLod 1841 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryLod
1838 : Opcode::BindlessImageQueryLod}; 1842 : Opcode::BindlessImageQueryLod};
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 13eefa88b..25839a371 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
@@ -316,6 +315,8 @@ public:
316 const F32& dref, const F32& lod, 315 const F32& dref, const F32& lod,
317 const Value& offset, TextureInstInfo info); 316 const Value& offset, TextureInstInfo info);
318 [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod); 317 [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod);
318 [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod,
319 TextureInstInfo info);
319 320
320 [[nodiscard]] Value ImageQueryLod(const Value& handle, const Value& coords, 321 [[nodiscard]] Value ImageQueryLod(const Value& handle, const Value& coords,
321 TextureInstInfo info); 322 TextureInstInfo info);
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp
index 631446cf7..468782eb1 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.cpp
+++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <memory> 5#include <memory>
@@ -326,6 +325,11 @@ void Inst::AddPhiOperand(Block* predecessor, const Value& value) {
326 phi_args.emplace_back(predecessor, value); 325 phi_args.emplace_back(predecessor, value);
327} 326}
328 327
328void Inst::ErasePhiOperand(size_t index) {
329 const auto operand_it{phi_args.begin() + static_cast<ptrdiff_t>(index)};
330 phi_args.erase(operand_it);
331}
332
329void Inst::OrderPhiArgs() { 333void Inst::OrderPhiArgs() {
330 if (op != Opcode::Phi) { 334 if (op != Opcode::Phi) {
331 throw LogicError("{} is not a Phi instruction", op); 335 throw LogicError("{} is not a Phi instruction", op);
diff --git a/src/shader_recompiler/frontend/ir/modifiers.h b/src/shader_recompiler/frontend/ir/modifiers.h
index 77cda1f8a..69035d462 100644
--- a/src/shader_recompiler/frontend/ir/modifiers.h
+++ b/src/shader_recompiler/frontend/ir/modifiers.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/opcodes.cpp b/src/shader_recompiler/frontend/ir/opcodes.cpp
index 24d024ad7..9e4d9e65a 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.cpp
+++ b/src/shader_recompiler/frontend/ir/opcodes.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <string_view>
6 3
7#include "shader_recompiler/frontend/ir/opcodes.h" 4#include "shader_recompiler/frontend/ir/opcodes.h"
8 5
diff --git a/src/shader_recompiler/frontend/ir/opcodes.h b/src/shader_recompiler/frontend/ir/opcodes.h
index 9ab108292..752879a18 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.h
+++ b/src/shader_recompiler/frontend/ir/opcodes.h
@@ -1,12 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include <algorithm> 6#include <algorithm>
8#include <array> 7#include <array>
9#include <string_view>
10 8
11#include <fmt/format.h> 9#include <fmt/format.h>
12 10
@@ -105,6 +103,6 @@ struct fmt::formatter<Shader::IR::Opcode> {
105 } 103 }
106 template <typename FormatContext> 104 template <typename FormatContext>
107 auto format(const Shader::IR::Opcode& op, FormatContext& ctx) { 105 auto format(const Shader::IR::Opcode& op, FormatContext& ctx) {
108 return format_to(ctx.out(), "{}", Shader::IR::NameOf(op)); 106 return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(op));
109 } 107 }
110}; 108};
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index efb6bfac3..86410ddfc 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5// opcode name, return type, arg1 type, arg2 type, arg3 type, arg4 type, arg4 type, ... 4// opcode name, return type, arg1 type, arg2 type, arg3 type, arg4 type, arg4 type, ...
6OPCODE(Phi, Opaque, ) 5OPCODE(Phi, Opaque, )
diff --git a/src/shader_recompiler/frontend/ir/patch.cpp b/src/shader_recompiler/frontend/ir/patch.cpp
index 4c956a970..b0707d85a 100644
--- a/src/shader_recompiler/frontend/ir/patch.cpp
+++ b/src/shader_recompiler/frontend/ir/patch.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/exception.h" 4#include "shader_recompiler/exception.h"
6#include "shader_recompiler/frontend/ir/patch.h" 5#include "shader_recompiler/frontend/ir/patch.h"
diff --git a/src/shader_recompiler/frontend/ir/patch.h b/src/shader_recompiler/frontend/ir/patch.h
index 6d66ff0d6..1e37c8eb6 100644
--- a/src/shader_recompiler/frontend/ir/patch.h
+++ b/src/shader_recompiler/frontend/ir/patch.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/post_order.cpp b/src/shader_recompiler/frontend/ir/post_order.cpp
index 16bc44101..f526615fc 100644
--- a/src/shader_recompiler/frontend/ir/post_order.cpp
+++ b/src/shader_recompiler/frontend/ir/post_order.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6 5
diff --git a/src/shader_recompiler/frontend/ir/post_order.h b/src/shader_recompiler/frontend/ir/post_order.h
index 07bfbadc3..d93071b07 100644
--- a/src/shader_recompiler/frontend/ir/post_order.h
+++ b/src/shader_recompiler/frontend/ir/post_order.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/pred.h b/src/shader_recompiler/frontend/ir/pred.h
index 4e7f32423..a77c1e2a7 100644
--- a/src/shader_recompiler/frontend/ir/pred.h
+++ b/src/shader_recompiler/frontend/ir/pred.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/program.cpp b/src/shader_recompiler/frontend/ir/program.cpp
index 3fc06f855..bda56ff46 100644
--- a/src/shader_recompiler/frontend/ir/program.cpp
+++ b/src/shader_recompiler/frontend/ir/program.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <map> 4#include <map>
6#include <string> 5#include <string>
diff --git a/src/shader_recompiler/frontend/ir/program.h b/src/shader_recompiler/frontend/ir/program.h
index ebcaa8bc2..6b4a05c59 100644
--- a/src/shader_recompiler/frontend/ir/program.h
+++ b/src/shader_recompiler/frontend/ir/program.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/reg.h b/src/shader_recompiler/frontend/ir/reg.h
index a4b635792..f7cb716a9 100644
--- a/src/shader_recompiler/frontend/ir/reg.h
+++ b/src/shader_recompiler/frontend/ir/reg.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/type.cpp b/src/shader_recompiler/frontend/ir/type.cpp
index f28341bfe..32657cb05 100644
--- a/src/shader_recompiler/frontend/ir/type.cpp
+++ b/src/shader_recompiler/frontend/ir/type.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <string> 5#include <string>
diff --git a/src/shader_recompiler/frontend/ir/type.h b/src/shader_recompiler/frontend/ir/type.h
index 294b230c4..04c8c4ddb 100644
--- a/src/shader_recompiler/frontend/ir/type.h
+++ b/src/shader_recompiler/frontend/ir/type.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index d365ea1bc..346169328 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -1,8 +1,6 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/ir/opcodes.h"
6#include "shader_recompiler/frontend/ir/value.h" 4#include "shader_recompiler/frontend/ir/value.h"
7 5
8namespace Shader::IR { 6namespace Shader::IR {
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 947579852..1a2e4ccb6 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
@@ -179,9 +178,13 @@ public:
179 178
180 /// Get a pointer to the block of a phi argument. 179 /// Get a pointer to the block of a phi argument.
181 [[nodiscard]] Block* PhiBlock(size_t index) const; 180 [[nodiscard]] Block* PhiBlock(size_t index) const;
181
182 /// Add phi operand to a phi instruction. 182 /// Add phi operand to a phi instruction.
183 void AddPhiOperand(Block* predecessor, const Value& value); 183 void AddPhiOperand(Block* predecessor, const Value& value);
184 184
185 // Erase the phi operand at the given index.
186 void ErasePhiOperand(size_t index);
187
185 /// Orders the Phi arguments from farthest away to nearest. 188 /// Orders the Phi arguments from farthest away to nearest.
186 void OrderPhiArgs(); 189 void OrderPhiArgs();
187 190
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
index efe457baa..6939692cd 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <array> 5#include <array>
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.h b/src/shader_recompiler/frontend/maxwell/control_flow.h
index a6bd3e196..1ce45b3a5 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.h
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.h
@@ -1,10 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include <compare>
8#include <optional> 6#include <optional>
9#include <span> 7#include <span>
10#include <string> 8#include <string>
@@ -15,6 +13,7 @@
15 13
16#include "shader_recompiler/environment.h" 14#include "shader_recompiler/environment.h"
17#include "shader_recompiler/frontend/ir/condition.h" 15#include "shader_recompiler/frontend/ir/condition.h"
16#include "shader_recompiler/frontend/ir/reg.h"
18#include "shader_recompiler/frontend/maxwell/instruction.h" 17#include "shader_recompiler/frontend/maxwell/instruction.h"
19#include "shader_recompiler/frontend/maxwell/location.h" 18#include "shader_recompiler/frontend/maxwell/location.h"
20#include "shader_recompiler/frontend/maxwell/opcodes.h" 19#include "shader_recompiler/frontend/maxwell/opcodes.h"
@@ -59,7 +58,7 @@ public:
59 [[nodiscard]] Stack Remove(Token token) const; 58 [[nodiscard]] Stack Remove(Token token) const;
60 59
61private: 60private:
62 boost::container::small_vector<StackEntry, 3> entries; 61 std::vector<StackEntry> entries;
63}; 62};
64 63
65struct IndirectBranch { 64struct IndirectBranch {
diff --git a/src/shader_recompiler/frontend/maxwell/decode.cpp b/src/shader_recompiler/frontend/maxwell/decode.cpp
index 972f677dc..455c91470 100644
--- a/src/shader_recompiler/frontend/maxwell/decode.cpp
+++ b/src/shader_recompiler/frontend/maxwell/decode.cpp
@@ -1,12 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <array> 5#include <array>
7#include <bit> 6#include <bit>
8#include <memory> 7#include <memory>
9#include <string_view>
10 8
11#include "common/common_types.h" 9#include "common/common_types.h"
12#include "shader_recompiler/exception.h" 10#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/decode.h b/src/shader_recompiler/frontend/maxwell/decode.h
index b4f080fd7..fc2fc016a 100644
--- a/src/shader_recompiler/frontend/maxwell/decode.h
+++ b/src/shader_recompiler/frontend/maxwell/decode.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.cpp b/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.cpp
index 008625cb3..712aefaa0 100644
--- a/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.cpp
+++ b/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <optional> 4#include <optional>
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.h b/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.h
index eee5102fa..9a3afd19c 100644
--- a/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.h
+++ b/src/shader_recompiler/frontend/maxwell/indirect_branch_table_track.h
@@ -1,12 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include <optional> 6#include <optional>
8 7
9#include "common/bit_field.h"
10#include "common/common_types.h" 8#include "common/common_types.h"
11#include "shader_recompiler/environment.h" 9#include "shader_recompiler/environment.h"
12#include "shader_recompiler/frontend/ir/reg.h" 10#include "shader_recompiler/frontend/ir/reg.h"
diff --git a/src/shader_recompiler/frontend/maxwell/instruction.h b/src/shader_recompiler/frontend/maxwell/instruction.h
index 743d68d61..d86c8cd34 100644
--- a/src/shader_recompiler/frontend/maxwell/instruction.h
+++ b/src/shader_recompiler/frontend/maxwell/instruction.h
@@ -1,13 +1,11 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include "common/bit_field.h" 6#include "common/bit_field.h"
8#include "common/common_types.h" 7#include "common/common_types.h"
9#include "shader_recompiler/frontend/ir/flow_test.h" 8#include "shader_recompiler/frontend/ir/flow_test.h"
10#include "shader_recompiler/frontend/ir/reg.h"
11 9
12namespace Shader::Maxwell { 10namespace Shader::Maxwell {
13 11
diff --git a/src/shader_recompiler/frontend/maxwell/location.h b/src/shader_recompiler/frontend/maxwell/location.h
index 26d29eae2..0c0477e2d 100644
--- a/src/shader_recompiler/frontend/maxwell/location.h
+++ b/src/shader_recompiler/frontend/maxwell/location.h
@@ -1,12 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include <compare>
8#include <iterator>
9
10#include <fmt/format.h> 6#include <fmt/format.h>
11 7
12#include "common/common_types.h" 8#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/maxwell.inc b/src/shader_recompiler/frontend/maxwell/maxwell.inc
index 2fee591bb..495b3e9f1 100644
--- a/src/shader_recompiler/frontend/maxwell/maxwell.inc
+++ b/src/shader_recompiler/frontend/maxwell/maxwell.inc
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5INST(AL2P, "AL2P", "1110 1111 1010 0---") 4INST(AL2P, "AL2P", "1110 1111 1010 0---")
6INST(ALD, "ALD", "1110 1111 1101 1---") 5INST(ALD, "ALD", "1110 1111 1101 1---")
diff --git a/src/shader_recompiler/frontend/maxwell/opcodes.cpp b/src/shader_recompiler/frontend/maxwell/opcodes.cpp
index ccc40c20c..2d5c4d79e 100644
--- a/src/shader_recompiler/frontend/maxwell/opcodes.cpp
+++ b/src/shader_recompiler/frontend/maxwell/opcodes.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/opcodes.h b/src/shader_recompiler/frontend/maxwell/opcodes.h
index cd574f29d..72dd143c2 100644
--- a/src/shader_recompiler/frontend/maxwell/opcodes.h
+++ b/src/shader_recompiler/frontend/maxwell/opcodes.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
@@ -25,6 +24,6 @@ struct fmt::formatter<Shader::Maxwell::Opcode> {
25 } 24 }
26 template <typename FormatContext> 25 template <typename FormatContext>
27 auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) { 26 auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) {
28 return format_to(ctx.out(), "{}", NameOf(opcode)); 27 return fmt::format_to(ctx.out(), "{}", NameOf(opcode));
29 } 28 }
30}; 29};
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
index 69eeaa3e6..ce42475d4 100644
--- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <memory> 5#include <memory>
@@ -8,7 +7,6 @@
8#include <unordered_map> 7#include <unordered_map>
9#include <utility> 8#include <utility>
10#include <vector> 9#include <vector>
11#include <version>
12 10
13#include <fmt/format.h> 11#include <fmt/format.h>
14 12
@@ -17,7 +15,6 @@
17#include "shader_recompiler/environment.h" 15#include "shader_recompiler/environment.h"
18#include "shader_recompiler/frontend/ir/basic_block.h" 16#include "shader_recompiler/frontend/ir/basic_block.h"
19#include "shader_recompiler/frontend/ir/ir_emitter.h" 17#include "shader_recompiler/frontend/ir/ir_emitter.h"
20#include "shader_recompiler/frontend/maxwell/decode.h"
21#include "shader_recompiler/frontend/maxwell/structured_control_flow.h" 18#include "shader_recompiler/frontend/maxwell/structured_control_flow.h"
22#include "shader_recompiler/frontend/maxwell/translate/translate.h" 19#include "shader_recompiler/frontend/maxwell/translate/translate.h"
23#include "shader_recompiler/host_translate_info.h" 20#include "shader_recompiler/host_translate_info.h"
@@ -967,9 +964,9 @@ private:
967 demote_endif_node.type = Type::EndIf; 964 demote_endif_node.type = Type::EndIf;
968 demote_endif_node.data.end_if.merge = return_block_it->data.block; 965 demote_endif_node.data.end_if.merge = return_block_it->data.block;
969 966
970 asl.insert(return_block_it, demote_endif_node); 967 const auto next_it_1 = asl.insert(return_block_it, demote_endif_node);
971 asl.insert(return_block_it, demote_node); 968 const auto next_it_2 = asl.insert(next_it_1, demote_node);
972 asl.insert(return_block_it, demote_if_node); 969 asl.insert(next_it_2, demote_if_node);
973 } 970 }
974 971
975 ObjectPool<Statement>& stmt_pool; 972 ObjectPool<Statement>& stmt_pool;
@@ -978,13 +975,7 @@ private:
978 Environment& env; 975 Environment& env;
979 IR::AbstractSyntaxList& syntax_list; 976 IR::AbstractSyntaxList& syntax_list;
980 bool uses_demote_to_helper{}; 977 bool uses_demote_to_helper{};
981
982// TODO: C++20 Remove this when all compilers support constexpr std::vector
983#if __cpp_lib_constexpr_vector >= 201907
984 static constexpr Flow::Block dummy_flow_block;
985#else
986 const Flow::Block dummy_flow_block; 978 const Flow::Block dummy_flow_block;
987#endif
988}; 979};
989} // Anonymous namespace 980} // Anonymous namespace
990 981
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.h b/src/shader_recompiler/frontend/maxwell/structured_control_flow.h
index e38158da3..15c1185ed 100644
--- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.h
+++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp
index d9f999e05..a6be7c97e 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp
index 8b974621e..5ce911247 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp
index fb3f00d3f..f6ff160c9 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp
@@ -1,10 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/frontend/maxwell/opcodes.h"
8#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 6#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
9 7
10namespace Shader::Maxwell { 8namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp
index 86e433e41..fb5368c7b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/barrier_operations.cpp
@@ -1,11 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/frontend/ir/modifiers.h"
8#include "shader_recompiler/frontend/maxwell/opcodes.h"
9#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 6#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
10 7
11namespace Shader::Maxwell { 8namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp
index 9d5a87e52..8d8a90c9b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_extract.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_insert.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_insert.cpp
index 1e1ec2119..e03ccc1ad 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_insert.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/bitfield_insert.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/branch_indirect.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/branch_indirect.cpp
index 371c0e0f7..50aa16049 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/branch_indirect.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/branch_indirect.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h b/src/shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h
index fd73f656c..b43bb01b8 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.cpp
index 20458d2ad..3fd2c616d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h"
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h b/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h
index 214d0af3c..25b7e12e6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h
@@ -1,10 +1,8 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include "common/common_types.h"
8#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 6#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
9 7
10namespace Shader::Maxwell { 8namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/condition_code_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/condition_code_set.cpp
index 420f2fb94..4bf151499 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/condition_code_set.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/condition_code_set.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp
index 5a1b3a8fc..b24ac80e0 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_compare_and_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_compare_and_set.cpp
index 1173192e4..6f040c45c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_compare_and_set.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_compare_and_set.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp
index f66097014..b43a3a2e6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_min_max.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_min_max.cpp
index 6b551847c..59a138eef 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_min_max.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_min_max.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp
index c0159fb65..a3dcdb6d7 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_set_predicate.cpp
index b8e74ee44..24859f5b8 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_set_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp
index c2443c886..c1179d9aa 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp
@@ -1,9 +1,7 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h"
7#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 5#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
8 6
9namespace Shader::Maxwell { 7namespace Shader::Maxwell {
@@ -12,9 +10,13 @@ void ExitFragment(TranslatorVisitor& v) {
12 const ProgramHeader sph{v.env.SPH()}; 10 const ProgramHeader sph{v.env.SPH()};
13 IR::Reg src_reg{IR::Reg::R0}; 11 IR::Reg src_reg{IR::Reg::R0};
14 for (u32 render_target = 0; render_target < 8; ++render_target) { 12 for (u32 render_target = 0; render_target < 8; ++render_target) {
13 if (!sph.ps.HasOutputComponents(render_target)) {
14 continue;
15 }
15 const std::array<bool, 4> mask{sph.ps.EnabledOutputComponents(render_target)}; 16 const std::array<bool, 4> mask{sph.ps.EnabledOutputComponents(render_target)};
16 for (u32 component = 0; component < 4; ++component) { 17 for (u32 component = 0; component < 4; ++component) {
17 if (!mask[component]) { 18 if (!mask[component]) {
19 ++src_reg;
18 continue; 20 continue;
19 } 21 }
20 v.ir.SetFragColor(render_target, component, v.F(src_reg)); 22 v.ir.SetFragColor(render_target, component, v.F(src_reg));
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/find_leading_one.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/find_leading_one.cpp
index f0cb25d61..a920bfcb2 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/find_leading_one.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/find_leading_one.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp
index b8c89810c..7350b6a82 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp
index 7127ebf54..b26a68766 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp
index eece4f28f..8f253ff6e 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
index 02ab023c1..7f3dccc52 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h"
6#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
index 92b1ce015..4942878b9 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <limits> 4#include <limits>
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
index fa2a7807b..fb9f40b82 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp
index c0d6ee5af..125ade769 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multi_function.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multi_function.cpp
index 2f8605619..64b213ebf 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multi_function.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multi_function.cpp
@@ -1,11 +1,9 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/exception.h" 6#include "shader_recompiler/exception.h"
8#include "shader_recompiler/frontend/maxwell/opcodes.h"
9#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 7#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
10 8
11namespace Shader::Maxwell { 9namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp
index 06226b7ce..fc8c7174b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_range_reduction.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
index f91b93fad..96e3e68e0 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp
index 5f93a1513..cbdaafc7b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
index 7550a8d4c..ef4ffa54b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp
index f2738a93b..3e810b67f 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
index fd7986701..a75a2d84b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.cpp
index 0dbeb7f56..014217ece 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h
index 59da56a7e..3283b85bd 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h
@@ -1,13 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
7#include "common/common_types.h" 6#include "common/common_types.h"
8#include "shader_recompiler/exception.h" 7#include "shader_recompiler/exception.h"
9#include "shader_recompiler/frontend/maxwell/translate/impl/common_encoding.h"
10#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h"
11#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 8#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
12 9
13namespace Shader::Maxwell { 10namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp
index 3f548ce76..c83b5649a 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 4#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp
index cca5b831f..c3080da25 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp
@@ -1,7 +1,7 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
4#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h"
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 6
7namespace Shader::Maxwell { 7namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp
index b3931dae3..a08979e8d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp
@@ -1,7 +1,7 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
4#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h"
5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h" 5#include "shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_helper.h"
6 6
7namespace Shader::Maxwell { 7namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
index b446aae0e..b0ebc75f7 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "shader_recompiler/frontend/ir/ir_emitter.h" 5#include "shader_recompiler/frontend/ir/ir_emitter.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h
index 335e4f24f..adf7cad06 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp
index 8ffd84867..49f70451a 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
index 040cfc10f..3d9877359 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare.cpp
index ba6e01926..ac1b405c5 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp
index 8ce1aee04..a708f8b91 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_compare_and_set.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp
index 0b8119ddd..a2dc0f4a6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_funnel_shift.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_funnel_shift.cpp
index 5feefc0ce..442365a26 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_funnel_shift.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_funnel_shift.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_minimum_maximum.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
index 1badbacc4..c3f6b0b7d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_popcount.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_popcount.cpp
index 5ece7678d..2a535f387 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_popcount.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_popcount.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_scaled_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_scaled_add.cpp
index 044671943..4a3f0772f 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_scaled_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_scaled_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_set_predicate.cpp
index bee10e5b9..c5d5221a0 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_set_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_left.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_left.cpp
index 20af68852..5779cfbdd 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_left.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_left.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_right.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_right.cpp
index be00bb605..2dccd2ca6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_right.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_shift_right.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_short_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
index 2932cdc42..a96f8707e 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp
index 53e8d8923..7484621d0 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
index 9b85f8059..7025f14a2 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp
index 2300088e3..7e12c089b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
@@ -11,10 +10,20 @@ namespace Shader::Maxwell {
11using namespace LDC; 10using namespace LDC;
12namespace { 11namespace {
13std::pair<IR::U32, IR::U32> Slot(IR::IREmitter& ir, Mode mode, const IR::U32& imm_index, 12std::pair<IR::U32, IR::U32> Slot(IR::IREmitter& ir, Mode mode, const IR::U32& imm_index,
14 const IR::U32& reg, const IR::U32& imm) { 13 const IR::U32& reg, const IR::U32& imm_offset) {
15 switch (mode) { 14 switch (mode) {
16 case Mode::Default: 15 case Mode::Default:
17 return {imm_index, ir.IAdd(reg, imm)}; 16 return {imm_index, ir.IAdd(reg, imm_offset)};
17 case Mode::IS: {
18 // Segmented addressing mode
19 // Ra+imm_offset points into a flat mapping of const buffer
20 // address space
21 const IR::U32 address{ir.IAdd(reg, imm_offset)};
22 const IR::U32 index{ir.BitFieldExtract(address, ir.Imm32(16), ir.Imm32(16))};
23 const IR::U32 offset{ir.BitFieldExtract(address, ir.Imm32(0), ir.Imm32(16))};
24
25 return {ir.IAdd(index, imm_index), offset};
26 }
18 default: 27 default:
19 break; 28 break;
20 } 29 }
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.h b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.h
index 3074ea0e3..0df13b7c8 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_effective_address.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_effective_address.cpp
index 4a0f04e47..8361c8ab1 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_effective_address.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_effective_address.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp
index 924fb7a40..e3745ce08 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp
@@ -1,12 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/exception.h" 6#include "shader_recompiler/exception.h"
8#include "shader_recompiler/frontend/ir/ir_emitter.h" 7#include "shader_recompiler/frontend/ir/ir_emitter.h"
9#include "shader_recompiler/frontend/maxwell/opcodes.h"
10#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 8#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
11 9
12namespace Shader::Maxwell { 10namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp
index d2a1dbf61..a198b2b76 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp
index 36c5cff2f..8f2cf897d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp
@@ -1,11 +1,9 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/exception.h" 6#include "shader_recompiler/exception.h"
8#include "shader_recompiler/frontend/maxwell/opcodes.h"
9#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 7#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
10 8
11namespace Shader::Maxwell { 9namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation.cpp
index 92cd27ed4..4e0ff897c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input.cpp
index e0fe47912..a4ec25844 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
@@ -13,59 +12,535 @@ namespace {
13// Emulate GPU's LOP3.LUT (three-input logic op with 8-bit truth table) 12// Emulate GPU's LOP3.LUT (three-input logic op with 8-bit truth table)
14IR::U32 ApplyLUT(IR::IREmitter& ir, const IR::U32& a, const IR::U32& b, const IR::U32& c, 13IR::U32 ApplyLUT(IR::IREmitter& ir, const IR::U32& a, const IR::U32& b, const IR::U32& c,
15 u64 ttbl) { 14 u64 ttbl) {
16 IR::U32 r{ir.Imm32(0)}; 15 switch (ttbl) {
17 const IR::U32 not_a{ir.BitwiseNot(a)}; 16 // generated code, do not edit manually
18 const IR::U32 not_b{ir.BitwiseNot(b)}; 17 case 0:
19 const IR::U32 not_c{ir.BitwiseNot(c)}; 18 return ir.Imm32(0);
20 if (ttbl & 0x01) { 19 case 1:
21 // r |= ~a & ~b & ~c; 20 return ir.BitwiseNot(ir.BitwiseOr(a, ir.BitwiseOr(b, c)));
22 const auto lhs{ir.BitwiseAnd(not_a, not_b)}; 21 case 2:
23 const auto rhs{ir.BitwiseAnd(lhs, not_c)}; 22 return ir.BitwiseAnd(c, ir.BitwiseNot(ir.BitwiseOr(a, b)));
24 r = ir.BitwiseOr(r, rhs); 23 case 3:
24 return ir.BitwiseNot(ir.BitwiseOr(a, b));
25 case 4:
26 return ir.BitwiseAnd(b, ir.BitwiseNot(ir.BitwiseOr(a, c)));
27 case 5:
28 return ir.BitwiseNot(ir.BitwiseOr(a, c));
29 case 6:
30 return ir.BitwiseAnd(ir.BitwiseNot(a), ir.BitwiseXor(b, c));
31 case 7:
32 return ir.BitwiseNot(ir.BitwiseOr(a, ir.BitwiseAnd(b, c)));
33 case 8:
34 return ir.BitwiseAnd(ir.BitwiseAnd(b, c), ir.BitwiseNot(a));
35 case 9:
36 return ir.BitwiseNot(ir.BitwiseOr(a, ir.BitwiseXor(b, c)));
37 case 10:
38 return ir.BitwiseAnd(c, ir.BitwiseNot(a));
39 case 11:
40 return ir.BitwiseAnd(ir.BitwiseNot(a), ir.BitwiseOr(c, ir.BitwiseNot(b)));
41 case 12:
42 return ir.BitwiseAnd(b, ir.BitwiseNot(a));
43 case 13:
44 return ir.BitwiseAnd(ir.BitwiseNot(a), ir.BitwiseOr(b, ir.BitwiseNot(c)));
45 case 14:
46 return ir.BitwiseAnd(ir.BitwiseNot(a), ir.BitwiseOr(b, c));
47 case 15:
48 return ir.BitwiseNot(a);
49 case 16:
50 return ir.BitwiseAnd(a, ir.BitwiseNot(ir.BitwiseOr(b, c)));
51 case 17:
52 return ir.BitwiseNot(ir.BitwiseOr(b, c));
53 case 18:
54 return ir.BitwiseAnd(ir.BitwiseNot(b), ir.BitwiseXor(a, c));
55 case 19:
56 return ir.BitwiseNot(ir.BitwiseOr(b, ir.BitwiseAnd(a, c)));
57 case 20:
58 return ir.BitwiseAnd(ir.BitwiseNot(c), ir.BitwiseXor(a, b));
59 case 21:
60 return ir.BitwiseNot(ir.BitwiseOr(c, ir.BitwiseAnd(a, b)));
61 case 22:
62 return ir.BitwiseXor(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseAnd(a, b)));
63 case 23:
64 return ir.BitwiseXor(ir.BitwiseAnd(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c)),
65 ir.BitwiseNot(a));
66 case 24:
67 return ir.BitwiseAnd(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c));
68 case 25:
69 return ir.BitwiseNot(ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(b, c)));
70 case 26:
71 return ir.BitwiseAnd(ir.BitwiseOr(c, ir.BitwiseNot(b)), ir.BitwiseXor(a, c));
72 case 27:
73 return ir.BitwiseXor(ir.BitwiseOr(a, ir.BitwiseNot(c)), ir.BitwiseOr(b, c));
74 case 28:
75 return ir.BitwiseAnd(ir.BitwiseOr(b, ir.BitwiseNot(c)), ir.BitwiseXor(a, b));
76 case 29:
77 return ir.BitwiseXor(ir.BitwiseOr(a, ir.BitwiseNot(b)), ir.BitwiseOr(b, c));
78 case 30:
79 return ir.BitwiseXor(a, ir.BitwiseOr(b, c));
80 case 31:
81 return ir.BitwiseNot(ir.BitwiseAnd(a, ir.BitwiseOr(b, c)));
82 case 32:
83 return ir.BitwiseAnd(ir.BitwiseAnd(a, c), ir.BitwiseNot(b));
84 case 33:
85 return ir.BitwiseNot(ir.BitwiseOr(b, ir.BitwiseXor(a, c)));
86 case 34:
87 return ir.BitwiseAnd(c, ir.BitwiseNot(b));
88 case 35:
89 return ir.BitwiseAnd(ir.BitwiseNot(b), ir.BitwiseOr(c, ir.BitwiseNot(a)));
90 case 36:
91 return ir.BitwiseAnd(ir.BitwiseXor(a, b), ir.BitwiseXor(b, c));
92 case 37:
93 return ir.BitwiseNot(ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(a, c)));
94 case 38:
95 return ir.BitwiseAnd(ir.BitwiseOr(c, ir.BitwiseNot(a)), ir.BitwiseXor(b, c));
96 case 39:
97 return ir.BitwiseXor(ir.BitwiseOr(a, c), ir.BitwiseOr(b, ir.BitwiseNot(c)));
98 case 40:
99 return ir.BitwiseAnd(c, ir.BitwiseXor(a, b));
100 case 41:
101 return ir.BitwiseXor(ir.BitwiseOr(a, b),
102 ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseNot(c)));
103 case 42:
104 return ir.BitwiseAnd(c, ir.BitwiseNot(ir.BitwiseAnd(a, b)));
105 case 43:
106 return ir.BitwiseXor(ir.BitwiseOr(a, ir.BitwiseNot(c)),
107 ir.BitwiseOr(b, ir.BitwiseXor(a, c)));
108 case 44:
109 return ir.BitwiseAnd(ir.BitwiseOr(b, c), ir.BitwiseXor(a, b));
110 case 45:
111 return ir.BitwiseXor(a, ir.BitwiseOr(b, ir.BitwiseNot(c)));
112 case 46:
113 return ir.BitwiseXor(ir.BitwiseAnd(a, b), ir.BitwiseOr(b, c));
114 case 47:
115 return ir.BitwiseOr(ir.BitwiseAnd(c, ir.BitwiseNot(b)), ir.BitwiseNot(a));
116 case 48:
117 return ir.BitwiseAnd(a, ir.BitwiseNot(b));
118 case 49:
119 return ir.BitwiseAnd(ir.BitwiseNot(b), ir.BitwiseOr(a, ir.BitwiseNot(c)));
120 case 50:
121 return ir.BitwiseAnd(ir.BitwiseNot(b), ir.BitwiseOr(a, c));
122 case 51:
123 return ir.BitwiseNot(b);
124 case 52:
125 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(c)), ir.BitwiseXor(a, b));
126 case 53:
127 return ir.BitwiseXor(ir.BitwiseOr(a, c), ir.BitwiseOr(b, ir.BitwiseNot(a)));
128 case 54:
129 return ir.BitwiseXor(b, ir.BitwiseOr(a, c));
130 case 55:
131 return ir.BitwiseNot(ir.BitwiseAnd(b, ir.BitwiseOr(a, c)));
132 case 56:
133 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(a, b));
134 case 57:
135 return ir.BitwiseXor(b, ir.BitwiseOr(a, ir.BitwiseNot(c)));
136 case 58:
137 return ir.BitwiseXor(ir.BitwiseAnd(a, b), ir.BitwiseOr(a, c));
138 case 59:
139 return ir.BitwiseOr(ir.BitwiseAnd(c, ir.BitwiseNot(a)), ir.BitwiseNot(b));
140 case 60:
141 return ir.BitwiseXor(a, b);
142 case 61:
143 return ir.BitwiseOr(ir.BitwiseNot(ir.BitwiseOr(a, c)), ir.BitwiseXor(a, b));
144 case 62:
145 return ir.BitwiseOr(ir.BitwiseAnd(c, ir.BitwiseNot(a)), ir.BitwiseXor(a, b));
146 case 63:
147 return ir.BitwiseNot(ir.BitwiseAnd(a, b));
148 case 64:
149 return ir.BitwiseAnd(ir.BitwiseAnd(a, b), ir.BitwiseNot(c));
150 case 65:
151 return ir.BitwiseNot(ir.BitwiseOr(c, ir.BitwiseXor(a, b)));
152 case 66:
153 return ir.BitwiseAnd(ir.BitwiseXor(a, c), ir.BitwiseXor(b, c));
154 case 67:
155 return ir.BitwiseNot(ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseXor(a, b)));
156 case 68:
157 return ir.BitwiseAnd(b, ir.BitwiseNot(c));
158 case 69:
159 return ir.BitwiseAnd(ir.BitwiseNot(c), ir.BitwiseOr(b, ir.BitwiseNot(a)));
160 case 70:
161 return ir.BitwiseAnd(ir.BitwiseOr(b, ir.BitwiseNot(a)), ir.BitwiseXor(b, c));
162 case 71:
163 return ir.BitwiseXor(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseNot(b)));
164 case 72:
165 return ir.BitwiseAnd(b, ir.BitwiseXor(a, c));
166 case 73:
167 return ir.BitwiseXor(ir.BitwiseOr(a, c),
168 ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseNot(b)));
169 case 74:
170 return ir.BitwiseAnd(ir.BitwiseOr(b, c), ir.BitwiseXor(a, c));
171 case 75:
172 return ir.BitwiseXor(a, ir.BitwiseOr(c, ir.BitwiseNot(b)));
173 case 76:
174 return ir.BitwiseAnd(b, ir.BitwiseNot(ir.BitwiseAnd(a, c)));
175 case 77:
176 return ir.BitwiseXor(ir.BitwiseOr(a, ir.BitwiseNot(b)),
177 ir.BitwiseOr(c, ir.BitwiseXor(a, b)));
178 case 78:
179 return ir.BitwiseXor(ir.BitwiseAnd(a, c), ir.BitwiseOr(b, c));
180 case 79:
181 return ir.BitwiseOr(ir.BitwiseAnd(b, ir.BitwiseNot(c)), ir.BitwiseNot(a));
182 case 80:
183 return ir.BitwiseAnd(a, ir.BitwiseNot(c));
184 case 81:
185 return ir.BitwiseAnd(ir.BitwiseNot(c), ir.BitwiseOr(a, ir.BitwiseNot(b)));
186 case 82:
187 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(b)), ir.BitwiseXor(a, c));
188 case 83:
189 return ir.BitwiseXor(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseNot(a)));
190 case 84:
191 return ir.BitwiseAnd(ir.BitwiseNot(c), ir.BitwiseOr(a, b));
192 case 85:
193 return ir.BitwiseNot(c);
194 case 86:
195 return ir.BitwiseXor(c, ir.BitwiseOr(a, b));
196 case 87:
197 return ir.BitwiseNot(ir.BitwiseAnd(c, ir.BitwiseOr(a, b)));
198 case 88:
199 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(a, c));
200 case 89:
201 return ir.BitwiseXor(c, ir.BitwiseOr(a, ir.BitwiseNot(b)));
202 case 90:
203 return ir.BitwiseXor(a, c);
204 case 91:
205 return ir.BitwiseOr(ir.BitwiseNot(ir.BitwiseOr(a, b)), ir.BitwiseXor(a, c));
206 case 92:
207 return ir.BitwiseXor(ir.BitwiseAnd(a, c), ir.BitwiseOr(a, b));
208 case 93:
209 return ir.BitwiseOr(ir.BitwiseAnd(b, ir.BitwiseNot(a)), ir.BitwiseNot(c));
210 case 94:
211 return ir.BitwiseOr(ir.BitwiseAnd(b, ir.BitwiseNot(a)), ir.BitwiseXor(a, c));
212 case 95:
213 return ir.BitwiseNot(ir.BitwiseAnd(a, c));
214 case 96:
215 return ir.BitwiseAnd(a, ir.BitwiseXor(b, c));
216 case 97:
217 return ir.BitwiseXor(ir.BitwiseOr(b, c),
218 ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseNot(a)));
219 case 98:
220 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(b, c));
221 case 99:
222 return ir.BitwiseXor(b, ir.BitwiseOr(c, ir.BitwiseNot(a)));
223 case 100:
224 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(b, c));
225 case 101:
226 return ir.BitwiseXor(c, ir.BitwiseOr(b, ir.BitwiseNot(a)));
227 case 102:
228 return ir.BitwiseXor(b, c);
229 case 103:
230 return ir.BitwiseOr(ir.BitwiseNot(ir.BitwiseOr(a, b)), ir.BitwiseXor(b, c));
231 case 104:
232 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(c, ir.BitwiseAnd(a, b)));
233 case 105:
234 return ir.BitwiseXor(ir.BitwiseNot(a), ir.BitwiseXor(b, c));
235 case 106:
236 return ir.BitwiseXor(c, ir.BitwiseAnd(a, b));
237 case 107:
238 return ir.BitwiseXor(ir.BitwiseAnd(c, ir.BitwiseOr(a, b)),
239 ir.BitwiseXor(a, ir.BitwiseNot(b)));
240 case 108:
241 return ir.BitwiseXor(b, ir.BitwiseAnd(a, c));
242 case 109:
243 return ir.BitwiseXor(ir.BitwiseAnd(b, ir.BitwiseOr(a, c)),
244 ir.BitwiseXor(a, ir.BitwiseNot(c)));
245 case 110:
246 return ir.BitwiseOr(ir.BitwiseAnd(b, ir.BitwiseNot(a)), ir.BitwiseXor(b, c));
247 case 111:
248 return ir.BitwiseOr(ir.BitwiseNot(a), ir.BitwiseXor(b, c));
249 case 112:
250 return ir.BitwiseAnd(a, ir.BitwiseNot(ir.BitwiseAnd(b, c)));
251 case 113:
252 return ir.BitwiseXor(ir.BitwiseOr(b, ir.BitwiseNot(a)),
253 ir.BitwiseOr(c, ir.BitwiseXor(a, b)));
254 case 114:
255 return ir.BitwiseXor(ir.BitwiseAnd(b, c), ir.BitwiseOr(a, c));
256 case 115:
257 return ir.BitwiseOr(ir.BitwiseAnd(a, ir.BitwiseNot(c)), ir.BitwiseNot(b));
258 case 116:
259 return ir.BitwiseXor(ir.BitwiseAnd(b, c), ir.BitwiseOr(a, b));
260 case 117:
261 return ir.BitwiseOr(ir.BitwiseAnd(a, ir.BitwiseNot(b)), ir.BitwiseNot(c));
262 case 118:
263 return ir.BitwiseOr(ir.BitwiseAnd(a, ir.BitwiseNot(b)), ir.BitwiseXor(b, c));
264 case 119:
265 return ir.BitwiseNot(ir.BitwiseAnd(b, c));
266 case 120:
267 return ir.BitwiseXor(a, ir.BitwiseAnd(b, c));
268 case 121:
269 return ir.BitwiseXor(ir.BitwiseAnd(a, ir.BitwiseOr(b, c)),
270 ir.BitwiseXor(b, ir.BitwiseNot(c)));
271 case 122:
272 return ir.BitwiseOr(ir.BitwiseAnd(a, ir.BitwiseNot(b)), ir.BitwiseXor(a, c));
273 case 123:
274 return ir.BitwiseOr(ir.BitwiseNot(b), ir.BitwiseXor(a, c));
275 case 124:
276 return ir.BitwiseOr(ir.BitwiseAnd(a, ir.BitwiseNot(c)), ir.BitwiseXor(a, b));
277 case 125:
278 return ir.BitwiseOr(ir.BitwiseNot(c), ir.BitwiseXor(a, b));
279 case 126:
280 return ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c));
281 case 127:
282 return ir.BitwiseNot(ir.BitwiseAnd(a, ir.BitwiseAnd(b, c)));
283 case 128:
284 return ir.BitwiseAnd(a, ir.BitwiseAnd(b, c));
285 case 129:
286 return ir.BitwiseNot(ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c)));
287 case 130:
288 return ir.BitwiseAnd(c, ir.BitwiseXor(a, ir.BitwiseNot(b)));
289 case 131:
290 return ir.BitwiseAnd(ir.BitwiseOr(c, ir.BitwiseNot(a)), ir.BitwiseXor(a, ir.BitwiseNot(b)));
291 case 132:
292 return ir.BitwiseAnd(b, ir.BitwiseXor(a, ir.BitwiseNot(c)));
293 case 133:
294 return ir.BitwiseAnd(ir.BitwiseOr(b, ir.BitwiseNot(a)), ir.BitwiseXor(a, ir.BitwiseNot(c)));
295 case 134:
296 return ir.BitwiseAnd(ir.BitwiseOr(b, c), ir.BitwiseXor(a, ir.BitwiseXor(b, c)));
297 case 135:
298 return ir.BitwiseXor(ir.BitwiseAnd(b, c), ir.BitwiseNot(a));
299 case 136:
300 return ir.BitwiseAnd(b, c);
301 case 137:
302 return ir.BitwiseAnd(ir.BitwiseOr(b, ir.BitwiseNot(a)), ir.BitwiseXor(b, ir.BitwiseNot(c)));
303 case 138:
304 return ir.BitwiseAnd(c, ir.BitwiseOr(b, ir.BitwiseNot(a)));
305 case 139:
306 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseNot(ir.BitwiseOr(a, b)));
307 case 140:
308 return ir.BitwiseAnd(b, ir.BitwiseOr(c, ir.BitwiseNot(a)));
309 case 141:
310 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseNot(ir.BitwiseOr(a, c)));
311 case 142:
312 return ir.BitwiseXor(a, ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c)));
313 case 143:
314 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseNot(a));
315 case 144:
316 return ir.BitwiseAnd(a, ir.BitwiseXor(b, ir.BitwiseNot(c)));
317 case 145:
318 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(b)), ir.BitwiseXor(b, ir.BitwiseNot(c)));
319 case 146:
320 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(a, ir.BitwiseXor(b, c)));
321 case 147:
322 return ir.BitwiseXor(ir.BitwiseAnd(a, c), ir.BitwiseNot(b));
323 case 148:
324 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(a, ir.BitwiseXor(b, c)));
325 case 149:
326 return ir.BitwiseXor(ir.BitwiseAnd(a, b), ir.BitwiseNot(c));
327 case 150:
328 return ir.BitwiseXor(a, ir.BitwiseXor(b, c));
329 case 151:
330 return ir.BitwiseOr(ir.BitwiseNot(ir.BitwiseOr(a, b)),
331 ir.BitwiseXor(a, ir.BitwiseXor(b, c)));
332 case 152:
333 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(b, ir.BitwiseNot(c)));
334 case 153:
335 return ir.BitwiseXor(b, ir.BitwiseNot(c));
336 case 154:
337 return ir.BitwiseXor(c, ir.BitwiseAnd(a, ir.BitwiseNot(b)));
338 case 155:
339 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(b, c)));
340 case 156:
341 return ir.BitwiseXor(b, ir.BitwiseAnd(a, ir.BitwiseNot(c)));
342 case 157:
343 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(b, c)));
344 case 158:
345 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseXor(a, ir.BitwiseOr(b, c)));
346 case 159:
347 return ir.BitwiseNot(ir.BitwiseAnd(a, ir.BitwiseXor(b, c)));
348 case 160:
349 return ir.BitwiseAnd(a, c);
350 case 161:
351 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(b)), ir.BitwiseXor(a, ir.BitwiseNot(c)));
352 case 162:
353 return ir.BitwiseAnd(c, ir.BitwiseOr(a, ir.BitwiseNot(b)));
354 case 163:
355 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseNot(ir.BitwiseOr(a, b)));
356 case 164:
357 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(a, ir.BitwiseNot(c)));
358 case 165:
359 return ir.BitwiseXor(a, ir.BitwiseNot(c));
360 case 166:
361 return ir.BitwiseXor(c, ir.BitwiseAnd(b, ir.BitwiseNot(a)));
362 case 167:
363 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseXor(a, c)));
364 case 168:
365 return ir.BitwiseAnd(c, ir.BitwiseOr(a, b));
366 case 169:
367 return ir.BitwiseXor(ir.BitwiseNot(c), ir.BitwiseOr(a, b));
368 case 170:
369 return c;
370 case 171:
371 return ir.BitwiseOr(c, ir.BitwiseNot(ir.BitwiseOr(a, b)));
372 case 172:
373 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseNot(a)));
374 case 173:
375 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseXor(a, ir.BitwiseNot(c)));
376 case 174:
377 return ir.BitwiseOr(c, ir.BitwiseAnd(b, ir.BitwiseNot(a)));
378 case 175:
379 return ir.BitwiseOr(c, ir.BitwiseNot(a));
380 case 176:
381 return ir.BitwiseAnd(a, ir.BitwiseOr(c, ir.BitwiseNot(b)));
382 case 177:
383 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseNot(ir.BitwiseOr(b, c)));
384 case 178:
385 return ir.BitwiseXor(b, ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c)));
386 case 179:
387 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseNot(b));
388 case 180:
389 return ir.BitwiseXor(a, ir.BitwiseAnd(b, ir.BitwiseNot(c)));
390 case 181:
391 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(b, c), ir.BitwiseXor(a, c)));
392 case 182:
393 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseXor(b, ir.BitwiseOr(a, c)));
394 case 183:
395 return ir.BitwiseNot(ir.BitwiseAnd(b, ir.BitwiseXor(a, c)));
396 case 184:
397 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseNot(b)));
398 case 185:
399 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseXor(b, ir.BitwiseNot(c)));
400 case 186:
401 return ir.BitwiseOr(c, ir.BitwiseAnd(a, ir.BitwiseNot(b)));
402 case 187:
403 return ir.BitwiseOr(c, ir.BitwiseNot(b));
404 case 188:
405 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseXor(a, b));
406 case 189:
407 return ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, ir.BitwiseNot(c)));
408 case 190:
409 return ir.BitwiseOr(c, ir.BitwiseXor(a, b));
410 case 191:
411 return ir.BitwiseOr(c, ir.BitwiseNot(ir.BitwiseAnd(a, b)));
412 case 192:
413 return ir.BitwiseAnd(a, b);
414 case 193:
415 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(c)), ir.BitwiseXor(a, ir.BitwiseNot(b)));
416 case 194:
417 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(a, ir.BitwiseNot(b)));
418 case 195:
419 return ir.BitwiseXor(a, ir.BitwiseNot(b));
420 case 196:
421 return ir.BitwiseAnd(b, ir.BitwiseOr(a, ir.BitwiseNot(c)));
422 case 197:
423 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseNot(ir.BitwiseOr(a, c)));
424 case 198:
425 return ir.BitwiseXor(b, ir.BitwiseAnd(c, ir.BitwiseNot(a)));
426 case 199:
427 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseXor(a, b)));
428 case 200:
429 return ir.BitwiseAnd(b, ir.BitwiseOr(a, c));
430 case 201:
431 return ir.BitwiseXor(ir.BitwiseNot(b), ir.BitwiseOr(a, c));
432 case 202:
433 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseOr(b, ir.BitwiseNot(a)));
434 case 203:
435 return ir.BitwiseOr(ir.BitwiseAnd(b, c), ir.BitwiseXor(a, ir.BitwiseNot(b)));
436 case 204:
437 return b;
438 case 205:
439 return ir.BitwiseOr(b, ir.BitwiseNot(ir.BitwiseOr(a, c)));
440 case 206:
441 return ir.BitwiseOr(b, ir.BitwiseAnd(c, ir.BitwiseNot(a)));
442 case 207:
443 return ir.BitwiseOr(b, ir.BitwiseNot(a));
444 case 208:
445 return ir.BitwiseAnd(a, ir.BitwiseOr(b, ir.BitwiseNot(c)));
446 case 209:
447 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseNot(ir.BitwiseOr(b, c)));
448 case 210:
449 return ir.BitwiseXor(a, ir.BitwiseAnd(c, ir.BitwiseNot(b)));
450 case 211:
451 return ir.BitwiseNot(ir.BitwiseAnd(ir.BitwiseOr(b, c), ir.BitwiseXor(a, b)));
452 case 212:
453 return ir.BitwiseXor(c, ir.BitwiseOr(ir.BitwiseXor(a, b), ir.BitwiseXor(a, c)));
454 case 213:
455 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseNot(c));
456 case 214:
457 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(c, ir.BitwiseOr(a, b)));
458 case 215:
459 return ir.BitwiseNot(ir.BitwiseAnd(c, ir.BitwiseXor(a, b)));
460 case 216:
461 return ir.BitwiseAnd(ir.BitwiseOr(a, c), ir.BitwiseOr(b, ir.BitwiseNot(c)));
462 case 217:
463 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(b, ir.BitwiseNot(c)));
464 case 218:
465 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(a, c));
466 case 219:
467 return ir.BitwiseOr(ir.BitwiseXor(a, c), ir.BitwiseXor(a, ir.BitwiseNot(b)));
468 case 220:
469 return ir.BitwiseOr(b, ir.BitwiseAnd(a, ir.BitwiseNot(c)));
470 case 221:
471 return ir.BitwiseOr(b, ir.BitwiseNot(c));
472 case 222:
473 return ir.BitwiseOr(b, ir.BitwiseXor(a, c));
474 case 223:
475 return ir.BitwiseOr(b, ir.BitwiseNot(ir.BitwiseAnd(a, c)));
476 case 224:
477 return ir.BitwiseAnd(a, ir.BitwiseOr(b, c));
478 case 225:
479 return ir.BitwiseXor(ir.BitwiseNot(a), ir.BitwiseOr(b, c));
480 case 226:
481 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(b)), ir.BitwiseOr(b, c));
482 case 227:
483 return ir.BitwiseOr(ir.BitwiseAnd(a, c), ir.BitwiseXor(a, ir.BitwiseNot(b)));
484 case 228:
485 return ir.BitwiseAnd(ir.BitwiseOr(a, ir.BitwiseNot(c)), ir.BitwiseOr(b, c));
486 case 229:
487 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(a, ir.BitwiseNot(c)));
488 case 230:
489 return ir.BitwiseOr(ir.BitwiseAnd(a, b), ir.BitwiseXor(b, c));
490 case 231:
491 return ir.BitwiseOr(ir.BitwiseXor(a, ir.BitwiseNot(b)), ir.BitwiseXor(b, c));
492 case 232:
493 return ir.BitwiseAnd(ir.BitwiseOr(a, b), ir.BitwiseOr(c, ir.BitwiseAnd(a, b)));
494 case 233:
495 return ir.BitwiseOr(ir.BitwiseAnd(a, b),
496 ir.BitwiseXor(ir.BitwiseNot(c), ir.BitwiseOr(a, b)));
497 case 234:
498 return ir.BitwiseOr(c, ir.BitwiseAnd(a, b));
499 case 235:
500 return ir.BitwiseOr(c, ir.BitwiseXor(a, ir.BitwiseNot(b)));
501 case 236:
502 return ir.BitwiseOr(b, ir.BitwiseAnd(a, c));
503 case 237:
504 return ir.BitwiseOr(b, ir.BitwiseXor(a, ir.BitwiseNot(c)));
505 case 238:
506 return ir.BitwiseOr(b, c);
507 case 239:
508 return ir.BitwiseOr(ir.BitwiseNot(a), ir.BitwiseOr(b, c));
509 case 240:
510 return a;
511 case 241:
512 return ir.BitwiseOr(a, ir.BitwiseNot(ir.BitwiseOr(b, c)));
513 case 242:
514 return ir.BitwiseOr(a, ir.BitwiseAnd(c, ir.BitwiseNot(b)));
515 case 243:
516 return ir.BitwiseOr(a, ir.BitwiseNot(b));
517 case 244:
518 return ir.BitwiseOr(a, ir.BitwiseAnd(b, ir.BitwiseNot(c)));
519 case 245:
520 return ir.BitwiseOr(a, ir.BitwiseNot(c));
521 case 246:
522 return ir.BitwiseOr(a, ir.BitwiseXor(b, c));
523 case 247:
524 return ir.BitwiseOr(a, ir.BitwiseNot(ir.BitwiseAnd(b, c)));
525 case 248:
526 return ir.BitwiseOr(a, ir.BitwiseAnd(b, c));
527 case 249:
528 return ir.BitwiseOr(a, ir.BitwiseXor(b, ir.BitwiseNot(c)));
529 case 250:
530 return ir.BitwiseOr(a, c);
531 case 251:
532 return ir.BitwiseOr(ir.BitwiseNot(b), ir.BitwiseOr(a, c));
533 case 252:
534 return ir.BitwiseOr(a, b);
535 case 253:
536 return ir.BitwiseOr(ir.BitwiseNot(c), ir.BitwiseOr(a, b));
537 case 254:
538 return ir.BitwiseOr(a, ir.BitwiseOr(b, c));
539 case 255:
540 return ir.Imm32(0xFFFFFFFF);
541 // end of generated code
25 } 542 }
26 if (ttbl & 0x02) { 543 throw NotImplementedException("LOP3 with out of range ttbl");
27 // r |= ~a & ~b & c;
28 const auto lhs{ir.BitwiseAnd(not_a, not_b)};
29 const auto rhs{ir.BitwiseAnd(lhs, c)};
30 r = ir.BitwiseOr(r, rhs);
31 }
32 if (ttbl & 0x04) {
33 // r |= ~a & b & ~c;
34 const auto lhs{ir.BitwiseAnd(not_a, b)};
35 const auto rhs{ir.BitwiseAnd(lhs, not_c)};
36 r = ir.BitwiseOr(r, rhs);
37 }
38 if (ttbl & 0x08) {
39 // r |= ~a & b & c;
40 const auto lhs{ir.BitwiseAnd(not_a, b)};
41 const auto rhs{ir.BitwiseAnd(lhs, c)};
42 r = ir.BitwiseOr(r, rhs);
43 }
44 if (ttbl & 0x10) {
45 // r |= a & ~b & ~c;
46 const auto lhs{ir.BitwiseAnd(a, not_b)};
47 const auto rhs{ir.BitwiseAnd(lhs, not_c)};
48 r = ir.BitwiseOr(r, rhs);
49 }
50 if (ttbl & 0x20) {
51 // r |= a & ~b & c;
52 const auto lhs{ir.BitwiseAnd(a, not_b)};
53 const auto rhs{ir.BitwiseAnd(lhs, c)};
54 r = ir.BitwiseOr(r, rhs);
55 }
56 if (ttbl & 0x40) {
57 // r |= a & b & ~c;
58 const auto lhs{ir.BitwiseAnd(a, b)};
59 const auto rhs{ir.BitwiseAnd(lhs, not_c)};
60 r = ir.BitwiseOr(r, rhs);
61 }
62 if (ttbl & 0x80) {
63 // r |= a & b & c;
64 const auto lhs{ir.BitwiseAnd(a, b)};
65 const auto rhs{ir.BitwiseAnd(lhs, c)};
66 r = ir.BitwiseOr(r, rhs);
67 }
68 return r;
69} 544}
70 545
71IR::U32 LOP3(TranslatorVisitor& v, u64 insn, const IR::U32& op_b, const IR::U32& op_c, u64 lut) { 546IR::U32 LOP3(TranslatorVisitor& v, u64 insn, const IR::U32& op_b, const IR::U32& op_c, u64 lut) {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py
new file mode 100644
index 000000000..e66d50d61
--- /dev/null
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/logic_operation_three_input_lut3.py
@@ -0,0 +1,90 @@
1# SPDX-FileCopyrightText: 2022 degasus <markus@selfnet.de>
2# SPDX-License-Identifier: WTFPL
3
4from itertools import product
5
6# The primitive instructions
7OPS = {
8 'ir.BitwiseAnd({}, {})' : (2, 1, lambda a,b: a&b),
9 'ir.BitwiseOr({}, {})' : (2, 1, lambda a,b: a|b),
10 'ir.BitwiseXor({}, {})' : (2, 1, lambda a,b: a^b),
11 'ir.BitwiseNot({})' : (1, 0.1, lambda a: (~a) & 255), # Only tiny cost, as this can often inlined in other instructions
12}
13
14# Our database of combination of instructions
15optimized_calls = {}
16def cmp(lhs, rhs):
17 if lhs is None: # new entry
18 return True
19 if lhs[3] > rhs[3]: # costs
20 return True
21 if lhs[3] < rhs[3]: # costs
22 return False
23 if len(lhs[0]) > len(rhs[0]): # string len
24 return True
25 if len(lhs[0]) < len(rhs[0]): # string len
26 return False
27 if lhs[0] > rhs[0]: # string sorting
28 return True
29 if lhs[0] < rhs[0]: # string sorting
30 return False
31 assert lhs == rhs, "redundant instruction, bug in brute force"
32 return False
33def register(imm, instruction, count, latency):
34 # Use the sum of instruction count and latency as costs to evaluate which combination is best
35 costs = count + latency
36
37 old = optimized_calls.get(imm, None)
38 new = (instruction, count, latency, costs)
39
40 # Update if new or better
41 if cmp(old, new):
42 optimized_calls[imm] = new
43 return True
44
45 return False
46
47# Constants: 0, 1 (for free)
48register(0, 'ir.Imm32(0)', 0, 0)
49register(255, 'ir.Imm32(0xFFFFFFFF)', 0, 0)
50
51# Inputs: a, b, c (for free)
52ta = 0xF0
53tb = 0xCC
54tc = 0xAA
55inputs = {
56 ta : 'a',
57 tb : 'b',
58 tc : 'c',
59}
60for imm, instruction in inputs.items():
61 register(imm, instruction, 0, 0)
62 register((~imm) & 255, 'ir.BitwiseNot({})'.format(instruction), 0.099, 0.099) # slightly cheaper NEG on inputs
63
64# Try to combine two values from the db with an instruction.
65# If it is better than the old method, update it.
66while True:
67 registered = 0
68 calls_copy = optimized_calls.copy()
69 for OP, (argc, cost, f) in OPS.items():
70 for args in product(calls_copy.items(), repeat=argc):
71 # unpack(transponse) the arrays
72 imm = [arg[0] for arg in args]
73 value = [arg[1][0] for arg in args]
74 count = [arg[1][1] for arg in args]
75 latency = [arg[1][2] for arg in args]
76
77 registered += register(
78 f(*imm),
79 OP.format(*value),
80 sum(count) + cost,
81 max(latency) + cost)
82 if registered == 0:
83 # No update at all? So terminate
84 break
85
86# Hacky output. Please improve me to output valid C++ instead.
87s = """ case {imm}:
88 return {op};"""
89for imm in range(256):
90 print(s.format(imm=imm, op=optimized_calls[imm][0]))
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_predicate_to_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_predicate_to_register.cpp
index 4324fd443..37586a65d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_predicate_to_register.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_predicate_to_register.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp
index 6bb08db8a..82aec3b73 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp
@@ -1,11 +1,9 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
7#include "shader_recompiler/exception.h" 6#include "shader_recompiler/exception.h"
8#include "shader_recompiler/frontend/maxwell/opcodes.h"
9#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 7#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
10 8
11namespace Shader::Maxwell { 9namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register_to_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register_to_predicate.cpp
index eda5f177b..2369e4cf6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register_to_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register_to_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
index 20cb2674e..52be12f9c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp
index 7e26ab359..2f930f1ea 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/output_geometry.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/output_geometry.cpp
index 01cfad88d..b4b7925c9 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/output_geometry.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/output_geometry.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/pixel_load.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/pixel_load.cpp
index b4767afb5..f8607c3d7 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/pixel_load.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/pixel_load.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_predicate.cpp
index 75d1fa8c1..3b7d53953 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp
index b02789874..cd1179c7d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/select_source_with_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/select_source_with_predicate.cpp
index 93baa75a9..992d6d1af 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/select_source_with_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/select_source_with_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp
index 63b588ad4..8ec90f52e 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp
@@ -1,9 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <array>
6#include <bit>
7 3
8#include "common/bit_field.h" 4#include "common/bit_field.h"
9#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp
index 681220a8d..c01ab361b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6#include <bit> 5#include <bit>
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp
index 0046b5edd..2459fc30d 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <optional> 4#include <optional>
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp
index 154e7f1a1..50e618c2f 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <utility>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather.cpp
index 218cbc1a8..3263b3c7c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <optional>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp
index 34efa2d50..e4c658145 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <utility>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gradient.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gradient.cpp
index c3fe3ffda..dd34507bc 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gradient.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gradient.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <optional>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp
index 983058303..0a7821e18 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <optional>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
@@ -134,7 +131,7 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) {
134 multisample = v.X(meta_reg++); 131 multisample = v.X(meta_reg++);
135 } 132 }
136 if (tld.clamp != 0) { 133 if (tld.clamp != 0) {
137 throw NotImplementedException("TLD.CL - CLAMP is not implmented"); 134 throw NotImplementedException("TLD.CL - CLAMP is not implemented");
138 } 135 }
139 IR::TextureInstInfo info{}; 136 IR::TextureInstInfo info{};
140 info.type.Assign(GetType(tld.type)); 137 info.type.Assign(GetType(tld.type));
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp
index 5dd7e31b2..0362f076a 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <array> 4#include <array>
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp
index aea3c0e62..639da1e9c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <optional>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
@@ -83,7 +80,7 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) {
83 } const tmml{insn}; 80 } const tmml{insn};
84 81
85 if ((tmml.mask & 0b1100) != 0) { 82 if ((tmml.mask & 0b1100) != 0) {
86 throw NotImplementedException("TMML BA results are not implmented"); 83 throw NotImplementedException("TMML BA results are not implemented");
87 } 84 }
88 const IR::Value coords{MakeCoords(v, tmml.coord_reg, tmml.type)}; 85 const IR::Value coords{MakeCoords(v, tmml.coord_reg, tmml.type)};
89 86
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
index 0459e5473..f8cfd4ab6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
@@ -1,12 +1,10 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <optional> 4#include <optional>
6 5
7#include "common/bit_field.h" 6#include "common/bit_field.h"
8#include "common/common_types.h" 7#include "common/common_types.h"
9#include "shader_recompiler/frontend/ir/modifiers.h"
10#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h" 8#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
11 9
12namespace Shader::Maxwell { 10namespace Shader::Maxwell {
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.cpp
index e1f4174cf..7d7444aff 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/exception.h" 4#include "shader_recompiler/exception.h"
6#include "shader_recompiler/frontend/maxwell/translate/impl/video_helper.h" 5#include "shader_recompiler/frontend/maxwell/translate/impl/video_helper.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.h b/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.h
index 40c0b907c..cbf253b6f 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_helper.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
index 4851b0b8d..5ac25beee 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_minimum_maximum.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_multiply_add.cpp
index cc2e6d6e6..9272a6d03 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_multiply_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_multiply_add.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp
index 1b66abc33..73db35304 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/common_types.h" 4#include "common/common_types.h"
6#include "shader_recompiler/exception.h" 5#include "shader_recompiler/exception.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp
index 7ce370f09..70e490e80 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/vote.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "common/bit_field.h" 4#include "common/bit_field.h"
6#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp
index 550fed55c..f0436994b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/warp_shuffle.cpp
@@ -1,8 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4
5#include <optional>
6 3
7#include "common/bit_field.h" 4#include "common/bit_field.h"
8#include "common/common_types.h" 5#include "common/common_types.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
index 8e3c4c5d5..6d6844826 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include "shader_recompiler/environment.h" 4#include "shader_recompiler/environment.h"
6#include "shader_recompiler/frontend/ir/basic_block.h" 5#include "shader_recompiler/frontend/ir/basic_block.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/translate.h b/src/shader_recompiler/frontend/maxwell/translate/translate.h
index a3edd2e46..2f98f0ec1 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/translate.h
+++ b/src/shader_recompiler/frontend/maxwell/translate/translate.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
index 248ad3ced..77efb4f57 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#include <algorithm> 4#include <algorithm>
6#include <memory> 5#include <memory>
@@ -212,11 +211,11 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
212 } 211 }
213 Optimization::SsaRewritePass(program); 212 Optimization::SsaRewritePass(program);
214 213
214 Optimization::ConstantPropagationPass(program);
215
215 Optimization::GlobalMemoryToStorageBufferPass(program); 216 Optimization::GlobalMemoryToStorageBufferPass(program);
216 Optimization::TexturePass(env, program); 217 Optimization::TexturePass(env, program);
217 218
218 Optimization::ConstantPropagationPass(program);
219
220 if (Settings::values.resolution_info.active) { 219 if (Settings::values.resolution_info.active) {
221 Optimization::RescalingPass(program); 220 Optimization::RescalingPass(program);
222 } 221 }
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.h b/src/shader_recompiler/frontend/maxwell/translate_program.h
index eac83da9d..02ede8c9c 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.h
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.h
@@ -1,6 +1,5 @@
1// Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// SPDX-License-Identifier: GPL-2.0-or-later
3// Refer to the license.txt file included.
4 3
5#pragma once 4#pragma once
6 5
@@ -8,10 +7,13 @@
8#include "shader_recompiler/frontend/ir/basic_block.h" 7#include "shader_recompiler/frontend/ir/basic_block.h"
9#include "shader_recompiler/frontend/ir/program.h" 8#include "shader_recompiler/frontend/ir/program.h"
10#include "shader_recompiler/frontend/maxwell/control_flow.h" 9#include "shader_recompiler/frontend/maxwell/control_flow.h"
11#include "shader_recompiler/host_translate_info.h"
12#include "shader_recompiler/object_pool.h" 10#include "shader_recompiler/object_pool.h"
13#include "shader_recompiler/runtime_info.h" 11#include "shader_recompiler/runtime_info.h"
14 12
13namespace Shader {
14struct HostTranslateInfo;
15}
16
15namespace Shader::Maxwell { 17namespace Shader::Maxwell {
16 18
17[[nodiscard]] IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, 19[[nodiscard]] IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool,