From c97030cc7bc90d4197675579f31d8753f560af69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Franch?= Date: Mon, 5 Oct 2026 04:34:00 +0200 Subject: [PATCH] test(shader): execute ds_swizzle_b32 in all three offset modes Co-Authored-By: Claude --- .../tests/execution/DsSwizzle.cpp | 289 ++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 core/libs/prx/libSceAgcDriver/tests/execution/DsSwizzle.cpp diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/DsSwizzle.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/DsSwizzle.cpp new file mode 100644 index 000000000..4ef9a3949 --- /dev/null +++ b/core/libs/prx/libSceAgcDriver/tests/execution/DsSwizzle.cpp @@ -0,0 +1,289 @@ +#include "prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp" +#include "prx/libSceAgcDriver/Graphics/include/Draw.hpp" +#include "Recompiler.hpp" +#include "VulkanTestDevice.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + +using AgcDriver::Graphics::Require; +using ShaderRecompiler::ShaderStage; + +constexpr std::uint32_t MaxThreads = 64; +constexpr std::uint32_t Inputs = 4; +constexpr std::uint32_t Results = 16; +constexpr std::uint32_t Checked = 16; +alignas(256) std::array Input{}; +alignas(256) std::array Output{}; + +alignas(256) constexpr std::array Wave32Code{ + 0x34020084, 0x34060086, 0xe0381000, 0x80000401, 0xbf8c3f70, 0x7e1402ff, 0xdeaddead, 0x7e1602ff, + 0xdeaddead, 0x7e1802ff, 0xdeaddead, 0x7e1a02ff, 0xdeaddead, 0x7e1c02ff, 0xdeaddead, 0x7e1e02ff, + 0xdeaddead, 0x7e2002ff, 0xdeaddead, 0x7e2202ff, 0xdeaddead, 0x7e2402ff, 0xdeaddead, 0x7e2602ff, + 0xdeaddead, 0x7e2802ff, 0xdeaddead, 0x7e2a02ff, 0xdeaddead, 0x7e2c02ff, 0xdeaddead, 0x7e2e02ff, + 0xdeaddead, 0x7e3002ff, 0xdeaddead, 0x7e3202ff, 0xdeaddead, 0xd8d4001f, 0x0a000004, 0xd8d4201f, + 0x0b000004, 0xd8d400b8, 0x0c000004, 0xd8d47c1f, 0x0d000004, 0xd8d42493, 0x0e000004, 0xd8d4804b, + 0x0f000004, 0xd8d4bf4b, 0x10000004, 0xd8d4c020, 0x11000004, 0xd8d4c460, 0x12000004, 0xd8d4c3e0, + 0x13000004, 0xd8d4c4ac, 0x14000004, 0xd8d4d8e0, 0x15000004, 0xbefe03ff, 0x33cc0ff3, 0xd8d4201f, + 0x16000004, 0xd8d4804b, 0x17000004, 0xd8d4c460, 0x18000004, 0xd8d400b8, 0x19000004, 0xbf8cc07f, + 0xbefe03c1, 0xe0781000, 0x80010a03, 0xe0781010, 0x80010e03, 0xe0781020, 0x80011203, 0xe0781030, + 0x80011603, 0xbf810000, +}; + +alignas(256) constexpr std::array Wave64Code{ + 0x34020084, 0x34060086, 0xe0381000, 0x80000401, 0xbf8c3f70, 0x7e1402ff, 0xdeaddead, 0x7e1602ff, + 0xdeaddead, 0x7e1802ff, 0xdeaddead, 0x7e1a02ff, 0xdeaddead, 0x7e1c02ff, 0xdeaddead, 0x7e1e02ff, + 0xdeaddead, 0x7e2002ff, 0xdeaddead, 0x7e2202ff, 0xdeaddead, 0x7e2402ff, 0xdeaddead, 0x7e2602ff, + 0xdeaddead, 0x7e2802ff, 0xdeaddead, 0x7e2a02ff, 0xdeaddead, 0x7e2c02ff, 0xdeaddead, 0x7e2e02ff, + 0xdeaddead, 0x7e3002ff, 0xdeaddead, 0x7e3202ff, 0xdeaddead, 0xd8d4001f, 0x0a000004, 0xd8d4201f, + 0x0b000004, 0xd8d400b8, 0x0c000004, 0xd8d47c1f, 0x0d000004, 0xd8d42493, 0x0e000004, 0xd8d4804b, + 0x0f000004, 0xd8d4bf4b, 0x10000004, 0xd8d4c020, 0x11000004, 0xd8d4c460, 0x12000004, 0xd8d4c3e0, + 0x13000004, 0xd8d4c4ac, 0x14000004, 0xd8d4d8e0, 0x15000004, 0xbefe03ff, 0x33cc0ff3, 0xbeff03ff, + 0xc3a5960f, 0xd8d4201f, 0x16000004, 0xd8d4804b, 0x17000004, 0xd8d4c460, 0x18000004, 0xd8d400b8, + 0x19000004, 0xbf8cc07f, 0xbefe04c1, 0xe0781000, 0x80010a03, 0xe0781010, 0x80010e03, 0xe0781020, + 0x80011203, 0xe0781030, 0x80011603, 0xbf810000, +}; + +constexpr std::uint32_t Rows[64][4] = { + {0x1e7ea419u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x51c9bc70u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x80a4df5au, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xf38b2ffcu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x8306d03bu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xa5aec797u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xdc28ff90u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xf3f49249u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x1a466884u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xe255accbu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x39292d22u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xe5121482u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x99dd251du, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x9f199504u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x8e7aa6e9u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x6bad6be2u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc88b2875u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x9293de8fu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x8c3d5f16u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xd7a7a3ccu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xbb049a79u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc6cd75e9u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc4a334bfu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x7dabe929u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc0433cbdu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc5e818fau, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x96263ae6u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x70eb9a0au, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x3d6c51e3u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x00a61f93u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x9d3c7decu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x14aa4e71u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x1c593af5u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x49889310u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xd11745adu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x1919e93au, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x731c9452u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x02f0ee99u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xd0944996u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xe4163207u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xaf67d461u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x7d836e77u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xadec6f11u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x5071950eu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x35d14880u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x65b00a2du, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x406329bcu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x59001ac9u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xfadb8908u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xffb88309u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xede7bd0cu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x5b4c8012u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xce1d62e0u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x60581ccau, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xffe976abu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xbef7e268u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x837a7935u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xa341738cu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x1389b372u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xb91dddd9u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x57241955u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x16f44881u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x8eb5140fu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x89be9c1cu, 0x00000000u, 0x00000000u, 0x00000000u} +}; + +constexpr std::uint32_t Expected32[32][16] = { + {0x1e7ea419u, 0x1a466884u, 0xa5aec797u, 0x14aa4e71u, 0x9f199504u, 0xf38b2ffcu, 0xf38b2ffcu, 0x51c9bc70u, 0x00a61f93u, 0x14aa4e71u, 0xd7a7a3ccu, 0xf3f49249u, 0x1a466884u, 0x00000000u, 0x00a61f93u, 0xa5aec797u}, + {0x51c9bc70u, 0xe255accbu, 0xa5aec797u, 0x9d3c7decu, 0x99dd251du, 0x80a4df5au, 0x80a4df5au, 0x80a4df5au, 0x9d3c7decu, 0x1e7ea419u, 0xc88b2875u, 0x1a466884u, 0xe255accbu, 0x00000000u, 0x00000000u, 0xa5aec797u}, + {0x80a4df5au, 0x39292d22u, 0xa5aec797u, 0x00a61f93u, 0x6bad6be2u, 0x1e7ea419u, 0x1e7ea419u, 0xf38b2ffcu, 0x14aa4e71u, 0x51c9bc70u, 0x9293de8fu, 0xe255accbu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xf38b2ffcu, 0xe5121482u, 0xa5aec797u, 0x3d6c51e3u, 0x8e7aa6e9u, 0x51c9bc70u, 0x51c9bc70u, 0x8306d03bu, 0x1e7ea419u, 0x80a4df5au, 0x8c3d5f16u, 0x39292d22u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8306d03bu, 0x99dd251du, 0xa5aec797u, 0x70eb9a0au, 0x9f199504u, 0xf3f49249u, 0xf3f49249u, 0xa5aec797u, 0x51c9bc70u, 0xf38b2ffcu, 0x7dabe929u, 0xe5121482u, 0x00000000u, 0xf3f49249u, 0x51c9bc70u, 0xa5aec797u}, + {0xa5aec797u, 0x9f199504u, 0xa5aec797u, 0x96263ae6u, 0x99dd251du, 0xdc28ff90u, 0xdc28ff90u, 0xdc28ff90u, 0x80a4df5au, 0x8306d03bu, 0x8306d03bu, 0x99dd251du, 0x00000000u, 0xdc28ff90u, 0x00000000u, 0xa5aec797u}, + {0xdc28ff90u, 0x8e7aa6e9u, 0xa5aec797u, 0xc5e818fau, 0x6bad6be2u, 0x8306d03bu, 0x8306d03bu, 0xf3f49249u, 0xf38b2ffcu, 0xa5aec797u, 0xa5aec797u, 0x9f199504u, 0x00000000u, 0x8306d03bu, 0x00000000u, 0xa5aec797u}, + {0xf3f49249u, 0x6bad6be2u, 0xa5aec797u, 0xc0433cbdu, 0x8e7aa6e9u, 0xa5aec797u, 0xa5aec797u, 0x1a466884u, 0x8306d03bu, 0xdc28ff90u, 0xdc28ff90u, 0x8e7aa6e9u, 0x00000000u, 0xa5aec797u, 0x8306d03bu, 0xa5aec797u}, + {0x1a466884u, 0x1e7ea419u, 0x9f199504u, 0x7dabe929u, 0x9f199504u, 0xe5121482u, 0xe5121482u, 0xe255accbu, 0xa5aec797u, 0xf3f49249u, 0xe5121482u, 0x6bad6be2u, 0x1e7ea419u, 0xe5121482u, 0xa5aec797u, 0x00000000u}, + {0xe255accbu, 0x51c9bc70u, 0x9f199504u, 0xc4a334bfu, 0x99dd251du, 0x39292d22u, 0x39292d22u, 0x39292d22u, 0xdc28ff90u, 0x1a466884u, 0x1a466884u, 0xc88b2875u, 0x51c9bc70u, 0x39292d22u, 0xdc28ff90u, 0x00000000u}, + {0x39292d22u, 0x80a4df5au, 0x9f199504u, 0xc6cd75e9u, 0x6bad6be2u, 0x1a466884u, 0x1a466884u, 0xe5121482u, 0xf3f49249u, 0xe255accbu, 0xe255accbu, 0x9293de8fu, 0x00000000u, 0x1a466884u, 0xf3f49249u, 0x00000000u}, + {0xe5121482u, 0xf38b2ffcu, 0x9f199504u, 0xbb049a79u, 0x8e7aa6e9u, 0xe255accbu, 0xe255accbu, 0x99dd251du, 0x1a466884u, 0x39292d22u, 0x39292d22u, 0x8c3d5f16u, 0x00000000u, 0xe255accbu, 0x1a466884u, 0x00000000u}, + {0x99dd251du, 0x8306d03bu, 0x9f199504u, 0xd7a7a3ccu, 0x9f199504u, 0x6bad6be2u, 0x6bad6be2u, 0x9f199504u, 0xe255accbu, 0xe5121482u, 0x6bad6be2u, 0xd7a7a3ccu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x9f199504u, 0xa5aec797u, 0x9f199504u, 0x8c3d5f16u, 0x99dd251du, 0x8e7aa6e9u, 0x8e7aa6e9u, 0x8e7aa6e9u, 0x39292d22u, 0x99dd251du, 0x99dd251du, 0xbb049a79u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8e7aa6e9u, 0xdc28ff90u, 0x9f199504u, 0x9293de8fu, 0x6bad6be2u, 0x99dd251du, 0x99dd251du, 0x6bad6be2u, 0xe5121482u, 0x9f199504u, 0x9f199504u, 0xc6cd75e9u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x6bad6be2u, 0xf3f49249u, 0x9f199504u, 0xc88b2875u, 0x8e7aa6e9u, 0x9f199504u, 0x9f199504u, 0xc88b2875u, 0x99dd251du, 0x8e7aa6e9u, 0x8e7aa6e9u, 0xc4a334bfu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc88b2875u, 0xc0433cbdu, 0xc6cd75e9u, 0x6bad6be2u, 0x00a61f93u, 0xd7a7a3ccu, 0xd7a7a3ccu, 0x9293de8fu, 0x9f199504u, 0x6bad6be2u, 0xf38b2ffcu, 0x7dabe929u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x9293de8fu, 0xc5e818fau, 0xc6cd75e9u, 0x8e7aa6e9u, 0x3d6c51e3u, 0x8c3d5f16u, 0x8c3d5f16u, 0x8c3d5f16u, 0x8e7aa6e9u, 0xc88b2875u, 0x1e7ea419u, 0xc0433cbdu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8c3d5f16u, 0x96263ae6u, 0xc6cd75e9u, 0x9f199504u, 0x14aa4e71u, 0xc88b2875u, 0xc88b2875u, 0xd7a7a3ccu, 0x6bad6be2u, 0x9293de8fu, 0x51c9bc70u, 0xc5e818fau, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xd7a7a3ccu, 0x70eb9a0au, 0xc6cd75e9u, 0x99dd251du, 0x9d3c7decu, 0x9293de8fu, 0x9293de8fu, 0xbb049a79u, 0xc88b2875u, 0x8c3d5f16u, 0x80a4df5au, 0x96263ae6u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xbb049a79u, 0x3d6c51e3u, 0xc6cd75e9u, 0xe5121482u, 0x00a61f93u, 0x7dabe929u, 0x7dabe929u, 0xc6cd75e9u, 0x9293de8fu, 0xd7a7a3ccu, 0xf3f49249u, 0x70eb9a0au, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc6cd75e9u, 0x00a61f93u, 0xc6cd75e9u, 0x39292d22u, 0x3d6c51e3u, 0xc4a334bfu, 0xc4a334bfu, 0xc4a334bfu, 0x8c3d5f16u, 0xbb049a79u, 0xbb049a79u, 0x3d6c51e3u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc4a334bfu, 0x9d3c7decu, 0xc6cd75e9u, 0xe255accbu, 0x14aa4e71u, 0xbb049a79u, 0xbb049a79u, 0x7dabe929u, 0xd7a7a3ccu, 0xc6cd75e9u, 0xc6cd75e9u, 0x00a61f93u, 0x00000000u, 0x00000000u, 0xd7a7a3ccu, 0x00000000u}, + {0x7dabe929u, 0x14aa4e71u, 0xc6cd75e9u, 0x1a466884u, 0x9d3c7decu, 0xc6cd75e9u, 0xc6cd75e9u, 0xc0433cbdu, 0xbb049a79u, 0xc4a334bfu, 0xc4a334bfu, 0x9d3c7decu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc0433cbdu, 0xc88b2875u, 0x00a61f93u, 0xf3f49249u, 0x00a61f93u, 0x70eb9a0au, 0x70eb9a0au, 0xc5e818fau, 0xc6cd75e9u, 0x7dabe929u, 0x70eb9a0au, 0x14aa4e71u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00a61f93u}, + {0xc5e818fau, 0x9293de8fu, 0x00a61f93u, 0xdc28ff90u, 0x3d6c51e3u, 0x96263ae6u, 0x96263ae6u, 0x96263ae6u, 0xc4a334bfu, 0xc0433cbdu, 0xc0433cbdu, 0x1e7ea419u, 0x00000000u, 0x00000000u, 0xc4a334bfu, 0x00a61f93u}, + {0x96263ae6u, 0x8c3d5f16u, 0x00a61f93u, 0xa5aec797u, 0x14aa4e71u, 0xc0433cbdu, 0xc0433cbdu, 0x70eb9a0au, 0x7dabe929u, 0xc5e818fau, 0xc5e818fau, 0x51c9bc70u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x70eb9a0au, 0xd7a7a3ccu, 0x00a61f93u, 0x8306d03bu, 0x9d3c7decu, 0xc5e818fau, 0xc5e818fau, 0x3d6c51e3u, 0xc0433cbdu, 0x96263ae6u, 0x96263ae6u, 0x80a4df5au, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x3d6c51e3u, 0xbb049a79u, 0x00a61f93u, 0xf38b2ffcu, 0x00a61f93u, 0x14aa4e71u, 0x14aa4e71u, 0x00a61f93u, 0xc5e818fau, 0x70eb9a0au, 0x14aa4e71u, 0xf38b2ffcu, 0x00000000u, 0x00000000u, 0xc5e818fau, 0x00a61f93u}, + {0x00a61f93u, 0xc6cd75e9u, 0x00a61f93u, 0x80a4df5au, 0x3d6c51e3u, 0x9d3c7decu, 0x9d3c7decu, 0x9d3c7decu, 0x96263ae6u, 0x3d6c51e3u, 0x3d6c51e3u, 0x8306d03bu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00a61f93u}, + {0x9d3c7decu, 0xc4a334bfu, 0x00a61f93u, 0x51c9bc70u, 0x14aa4e71u, 0x3d6c51e3u, 0x3d6c51e3u, 0x14aa4e71u, 0x70eb9a0au, 0x00a61f93u, 0x00a61f93u, 0xa5aec797u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x14aa4e71u, 0x7dabe929u, 0x00a61f93u, 0x1e7ea419u, 0x9d3c7decu, 0x00a61f93u, 0x00a61f93u, 0x1e7ea419u, 0x3d6c51e3u, 0x9d3c7decu, 0x9d3c7decu, 0xdc28ff90u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu} +}; +constexpr std::uint32_t Expected64[64][16] = { + {0x1e7ea419u, 0x1a466884u, 0xa5aec797u, 0x14aa4e71u, 0x9f199504u, 0xf38b2ffcu, 0xf38b2ffcu, 0x51c9bc70u, 0x00a61f93u, 0x14aa4e71u, 0xd7a7a3ccu, 0xf3f49249u, 0x1a466884u, 0x00000000u, 0x00a61f93u, 0xa5aec797u}, + {0x51c9bc70u, 0xe255accbu, 0xa5aec797u, 0x9d3c7decu, 0x99dd251du, 0x80a4df5au, 0x80a4df5au, 0x80a4df5au, 0x9d3c7decu, 0x1e7ea419u, 0xc88b2875u, 0x1a466884u, 0xe255accbu, 0x00000000u, 0x00000000u, 0xa5aec797u}, + {0x80a4df5au, 0x39292d22u, 0xa5aec797u, 0x00a61f93u, 0x6bad6be2u, 0x1e7ea419u, 0x1e7ea419u, 0xf38b2ffcu, 0x14aa4e71u, 0x51c9bc70u, 0x9293de8fu, 0xe255accbu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xf38b2ffcu, 0xe5121482u, 0xa5aec797u, 0x3d6c51e3u, 0x8e7aa6e9u, 0x51c9bc70u, 0x51c9bc70u, 0x8306d03bu, 0x1e7ea419u, 0x80a4df5au, 0x8c3d5f16u, 0x39292d22u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8306d03bu, 0x99dd251du, 0xa5aec797u, 0x70eb9a0au, 0x9f199504u, 0xf3f49249u, 0xf3f49249u, 0xa5aec797u, 0x51c9bc70u, 0xf38b2ffcu, 0x7dabe929u, 0xe5121482u, 0x00000000u, 0xf3f49249u, 0x51c9bc70u, 0xa5aec797u}, + {0xa5aec797u, 0x9f199504u, 0xa5aec797u, 0x96263ae6u, 0x99dd251du, 0xdc28ff90u, 0xdc28ff90u, 0xdc28ff90u, 0x80a4df5au, 0x8306d03bu, 0x8306d03bu, 0x99dd251du, 0x00000000u, 0xdc28ff90u, 0x00000000u, 0xa5aec797u}, + {0xdc28ff90u, 0x8e7aa6e9u, 0xa5aec797u, 0xc5e818fau, 0x6bad6be2u, 0x8306d03bu, 0x8306d03bu, 0xf3f49249u, 0xf38b2ffcu, 0xa5aec797u, 0xa5aec797u, 0x9f199504u, 0x00000000u, 0x8306d03bu, 0x00000000u, 0xa5aec797u}, + {0xf3f49249u, 0x6bad6be2u, 0xa5aec797u, 0xc0433cbdu, 0x8e7aa6e9u, 0xa5aec797u, 0xa5aec797u, 0x1a466884u, 0x8306d03bu, 0xdc28ff90u, 0xdc28ff90u, 0x8e7aa6e9u, 0x00000000u, 0xa5aec797u, 0x8306d03bu, 0xa5aec797u}, + {0x1a466884u, 0x1e7ea419u, 0x9f199504u, 0x7dabe929u, 0x9f199504u, 0xe5121482u, 0xe5121482u, 0xe255accbu, 0xa5aec797u, 0xf3f49249u, 0xe5121482u, 0x6bad6be2u, 0x1e7ea419u, 0xe5121482u, 0xa5aec797u, 0x00000000u}, + {0xe255accbu, 0x51c9bc70u, 0x9f199504u, 0xc4a334bfu, 0x99dd251du, 0x39292d22u, 0x39292d22u, 0x39292d22u, 0xdc28ff90u, 0x1a466884u, 0x1a466884u, 0xc88b2875u, 0x51c9bc70u, 0x39292d22u, 0xdc28ff90u, 0x00000000u}, + {0x39292d22u, 0x80a4df5au, 0x9f199504u, 0xc6cd75e9u, 0x6bad6be2u, 0x1a466884u, 0x1a466884u, 0xe5121482u, 0xf3f49249u, 0xe255accbu, 0xe255accbu, 0x9293de8fu, 0x00000000u, 0x1a466884u, 0xf3f49249u, 0x00000000u}, + {0xe5121482u, 0xf38b2ffcu, 0x9f199504u, 0xbb049a79u, 0x8e7aa6e9u, 0xe255accbu, 0xe255accbu, 0x99dd251du, 0x1a466884u, 0x39292d22u, 0x39292d22u, 0x8c3d5f16u, 0x00000000u, 0xe255accbu, 0x1a466884u, 0x00000000u}, + {0x99dd251du, 0x8306d03bu, 0x9f199504u, 0xd7a7a3ccu, 0x9f199504u, 0x6bad6be2u, 0x6bad6be2u, 0x9f199504u, 0xe255accbu, 0xe5121482u, 0x6bad6be2u, 0xd7a7a3ccu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x9f199504u, 0xa5aec797u, 0x9f199504u, 0x8c3d5f16u, 0x99dd251du, 0x8e7aa6e9u, 0x8e7aa6e9u, 0x8e7aa6e9u, 0x39292d22u, 0x99dd251du, 0x99dd251du, 0xbb049a79u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8e7aa6e9u, 0xdc28ff90u, 0x9f199504u, 0x9293de8fu, 0x6bad6be2u, 0x99dd251du, 0x99dd251du, 0x6bad6be2u, 0xe5121482u, 0x9f199504u, 0x9f199504u, 0xc6cd75e9u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x6bad6be2u, 0xf3f49249u, 0x9f199504u, 0xc88b2875u, 0x8e7aa6e9u, 0x9f199504u, 0x9f199504u, 0xc88b2875u, 0x99dd251du, 0x8e7aa6e9u, 0x8e7aa6e9u, 0xc4a334bfu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc88b2875u, 0xc0433cbdu, 0xc6cd75e9u, 0x6bad6be2u, 0x00a61f93u, 0xd7a7a3ccu, 0xd7a7a3ccu, 0x9293de8fu, 0x9f199504u, 0x6bad6be2u, 0xf38b2ffcu, 0x7dabe929u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x9293de8fu, 0xc5e818fau, 0xc6cd75e9u, 0x8e7aa6e9u, 0x3d6c51e3u, 0x8c3d5f16u, 0x8c3d5f16u, 0x8c3d5f16u, 0x8e7aa6e9u, 0xc88b2875u, 0x1e7ea419u, 0xc0433cbdu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8c3d5f16u, 0x96263ae6u, 0xc6cd75e9u, 0x9f199504u, 0x14aa4e71u, 0xc88b2875u, 0xc88b2875u, 0xd7a7a3ccu, 0x6bad6be2u, 0x9293de8fu, 0x51c9bc70u, 0xc5e818fau, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xd7a7a3ccu, 0x70eb9a0au, 0xc6cd75e9u, 0x99dd251du, 0x9d3c7decu, 0x9293de8fu, 0x9293de8fu, 0xbb049a79u, 0xc88b2875u, 0x8c3d5f16u, 0x80a4df5au, 0x96263ae6u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xbb049a79u, 0x3d6c51e3u, 0xc6cd75e9u, 0xe5121482u, 0x00a61f93u, 0x7dabe929u, 0x7dabe929u, 0xc6cd75e9u, 0x9293de8fu, 0xd7a7a3ccu, 0xf3f49249u, 0x70eb9a0au, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc6cd75e9u, 0x00a61f93u, 0xc6cd75e9u, 0x39292d22u, 0x3d6c51e3u, 0xc4a334bfu, 0xc4a334bfu, 0xc4a334bfu, 0x8c3d5f16u, 0xbb049a79u, 0xbb049a79u, 0x3d6c51e3u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xc4a334bfu, 0x9d3c7decu, 0xc6cd75e9u, 0xe255accbu, 0x14aa4e71u, 0xbb049a79u, 0xbb049a79u, 0x7dabe929u, 0xd7a7a3ccu, 0xc6cd75e9u, 0xc6cd75e9u, 0x00a61f93u, 0x00000000u, 0x00000000u, 0xd7a7a3ccu, 0x00000000u}, + {0x7dabe929u, 0x14aa4e71u, 0xc6cd75e9u, 0x1a466884u, 0x9d3c7decu, 0xc6cd75e9u, 0xc6cd75e9u, 0xc0433cbdu, 0xbb049a79u, 0xc4a334bfu, 0xc4a334bfu, 0x9d3c7decu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0xc0433cbdu, 0xc88b2875u, 0x00a61f93u, 0xf3f49249u, 0x00a61f93u, 0x70eb9a0au, 0x70eb9a0au, 0xc5e818fau, 0xc6cd75e9u, 0x7dabe929u, 0x70eb9a0au, 0x14aa4e71u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00a61f93u}, + {0xc5e818fau, 0x9293de8fu, 0x00a61f93u, 0xdc28ff90u, 0x3d6c51e3u, 0x96263ae6u, 0x96263ae6u, 0x96263ae6u, 0xc4a334bfu, 0xc0433cbdu, 0xc0433cbdu, 0x1e7ea419u, 0x00000000u, 0x00000000u, 0xc4a334bfu, 0x00a61f93u}, + {0x96263ae6u, 0x8c3d5f16u, 0x00a61f93u, 0xa5aec797u, 0x14aa4e71u, 0xc0433cbdu, 0xc0433cbdu, 0x70eb9a0au, 0x7dabe929u, 0xc5e818fau, 0xc5e818fau, 0x51c9bc70u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x70eb9a0au, 0xd7a7a3ccu, 0x00a61f93u, 0x8306d03bu, 0x9d3c7decu, 0xc5e818fau, 0xc5e818fau, 0x3d6c51e3u, 0xc0433cbdu, 0x96263ae6u, 0x96263ae6u, 0x80a4df5au, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x3d6c51e3u, 0xbb049a79u, 0x00a61f93u, 0xf38b2ffcu, 0x00a61f93u, 0x14aa4e71u, 0x14aa4e71u, 0x00a61f93u, 0xc5e818fau, 0x70eb9a0au, 0x14aa4e71u, 0xf38b2ffcu, 0x00000000u, 0x00000000u, 0xc5e818fau, 0x00a61f93u}, + {0x00a61f93u, 0xc6cd75e9u, 0x00a61f93u, 0x80a4df5au, 0x3d6c51e3u, 0x9d3c7decu, 0x9d3c7decu, 0x9d3c7decu, 0x96263ae6u, 0x3d6c51e3u, 0x3d6c51e3u, 0x8306d03bu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00a61f93u}, + {0x9d3c7decu, 0xc4a334bfu, 0x00a61f93u, 0x51c9bc70u, 0x14aa4e71u, 0x3d6c51e3u, 0x3d6c51e3u, 0x14aa4e71u, 0x70eb9a0au, 0x00a61f93u, 0x00a61f93u, 0xa5aec797u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x14aa4e71u, 0x7dabe929u, 0x00a61f93u, 0x1e7ea419u, 0x9d3c7decu, 0x00a61f93u, 0x00a61f93u, 0x1e7ea419u, 0x3d6c51e3u, 0x9d3c7decu, 0x9d3c7decu, 0xdc28ff90u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x1c593af5u, 0xaf67d461u, 0x02f0ee99u, 0x89be9c1cu, 0x65b00a2du, 0x1919e93au, 0x1919e93au, 0x49889310u, 0x16f44881u, 0x89be9c1cu, 0x5b4c8012u, 0xe4163207u, 0x00000000u, 0x1919e93au, 0x00000000u, 0x00000000u}, + {0x49889310u, 0x7d836e77u, 0x02f0ee99u, 0x8eb5140fu, 0x35d14880u, 0xd11745adu, 0xd11745adu, 0xd11745adu, 0x8eb5140fu, 0x1c593af5u, 0xfadb8908u, 0xaf67d461u, 0x7d836e77u, 0xd11745adu, 0x8eb5140fu, 0x00000000u}, + {0xd11745adu, 0xadec6f11u, 0x02f0ee99u, 0x16f44881u, 0x59001ac9u, 0x1c593af5u, 0x1c593af5u, 0x1919e93au, 0x89be9c1cu, 0x49889310u, 0xffb88309u, 0x7d836e77u, 0xadec6f11u, 0x1c593af5u, 0x89be9c1cu, 0x00000000u}, + {0x1919e93au, 0x5071950eu, 0x02f0ee99u, 0x57241955u, 0x406329bcu, 0x49889310u, 0x49889310u, 0x731c9452u, 0x1c593af5u, 0xd11745adu, 0xede7bd0cu, 0xadec6f11u, 0x00000000u, 0x49889310u, 0x1c593af5u, 0x00000000u}, + {0x731c9452u, 0x35d14880u, 0x02f0ee99u, 0xb91dddd9u, 0x65b00a2du, 0xe4163207u, 0xe4163207u, 0x02f0ee99u, 0x49889310u, 0x1919e93au, 0xbef7e268u, 0x5071950eu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x02f0ee99u, 0x65b00a2du, 0x02f0ee99u, 0x1389b372u, 0x35d14880u, 0xd0944996u, 0xd0944996u, 0xd0944996u, 0xd11745adu, 0x731c9452u, 0x731c9452u, 0x35d14880u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xd0944996u, 0x406329bcu, 0x02f0ee99u, 0xa341738cu, 0x59001ac9u, 0x731c9452u, 0x731c9452u, 0xe4163207u, 0x1919e93au, 0x02f0ee99u, 0x02f0ee99u, 0x65b00a2du, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xe4163207u, 0x59001ac9u, 0x02f0ee99u, 0x837a7935u, 0x406329bcu, 0x02f0ee99u, 0x02f0ee99u, 0xaf67d461u, 0x731c9452u, 0xd0944996u, 0xd0944996u, 0x406329bcu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xaf67d461u, 0x1c593af5u, 0x65b00a2du, 0xbef7e268u, 0x65b00a2du, 0x5071950eu, 0x5071950eu, 0x7d836e77u, 0x02f0ee99u, 0xe4163207u, 0x5071950eu, 0x59001ac9u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x7d836e77u, 0x49889310u, 0x65b00a2du, 0xffe976abu, 0x35d14880u, 0xadec6f11u, 0xadec6f11u, 0xadec6f11u, 0xd0944996u, 0xaf67d461u, 0xaf67d461u, 0xfadb8908u, 0x49889310u, 0xadec6f11u, 0x00000000u, 0x00000000u}, + {0xadec6f11u, 0xd11745adu, 0x65b00a2du, 0x60581ccau, 0x59001ac9u, 0xaf67d461u, 0xaf67d461u, 0x5071950eu, 0xe4163207u, 0x7d836e77u, 0x7d836e77u, 0xffb88309u, 0xd11745adu, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x5071950eu, 0x1919e93au, 0x65b00a2du, 0xce1d62e0u, 0x406329bcu, 0x7d836e77u, 0x7d836e77u, 0x35d14880u, 0xaf67d461u, 0xadec6f11u, 0xadec6f11u, 0xede7bd0cu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x35d14880u, 0x731c9452u, 0x65b00a2du, 0x5b4c8012u, 0x65b00a2du, 0x59001ac9u, 0x59001ac9u, 0x65b00a2du, 0x7d836e77u, 0x5071950eu, 0x59001ac9u, 0x5b4c8012u, 0x00000000u, 0x59001ac9u, 0x7d836e77u, 0x00000000u}, + {0x65b00a2du, 0x02f0ee99u, 0x65b00a2du, 0xede7bd0cu, 0x35d14880u, 0x406329bcu, 0x406329bcu, 0x406329bcu, 0xadec6f11u, 0x35d14880u, 0x35d14880u, 0xce1d62e0u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x406329bcu, 0xd0944996u, 0x65b00a2du, 0xffb88309u, 0x59001ac9u, 0x35d14880u, 0x35d14880u, 0x59001ac9u, 0x5071950eu, 0x65b00a2du, 0x65b00a2du, 0x60581ccau, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x59001ac9u, 0xe4163207u, 0x65b00a2du, 0xfadb8908u, 0x406329bcu, 0x65b00a2du, 0x65b00a2du, 0xfadb8908u, 0x35d14880u, 0x406329bcu, 0x406329bcu, 0xffe976abu, 0x00000000u, 0x00000000u, 0x35d14880u, 0x00000000u}, + {0xfadb8908u, 0x837a7935u, 0x60581ccau, 0x59001ac9u, 0x16f44881u, 0x5b4c8012u, 0x5b4c8012u, 0xffb88309u, 0x65b00a2du, 0x59001ac9u, 0x1919e93au, 0xbef7e268u, 0x837a7935u, 0x00000000u, 0x00000000u, 0x60581ccau}, + {0xffb88309u, 0xa341738cu, 0x60581ccau, 0x406329bcu, 0x57241955u, 0xede7bd0cu, 0xede7bd0cu, 0xede7bd0cu, 0x406329bcu, 0xfadb8908u, 0x1c593af5u, 0x837a7935u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xede7bd0cu, 0x1389b372u, 0x60581ccau, 0x65b00a2du, 0x89be9c1cu, 0xfadb8908u, 0xfadb8908u, 0x5b4c8012u, 0x59001ac9u, 0xffb88309u, 0x49889310u, 0xa341738cu, 0x00000000u, 0xfadb8908u, 0x59001ac9u, 0x60581ccau}, + {0x5b4c8012u, 0xb91dddd9u, 0x60581ccau, 0x35d14880u, 0x8eb5140fu, 0xffb88309u, 0xffb88309u, 0xce1d62e0u, 0xfadb8908u, 0xede7bd0cu, 0xd11745adu, 0x1389b372u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xce1d62e0u, 0x57241955u, 0x60581ccau, 0x5071950eu, 0x16f44881u, 0xbef7e268u, 0xbef7e268u, 0x60581ccau, 0xffb88309u, 0x5b4c8012u, 0xe4163207u, 0xb91dddd9u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x60581ccau, 0x16f44881u, 0x60581ccau, 0xadec6f11u, 0x57241955u, 0xffe976abu, 0xffe976abu, 0xffe976abu, 0xede7bd0cu, 0xce1d62e0u, 0xce1d62e0u, 0x57241955u, 0x00000000u, 0x00000000u, 0xede7bd0cu, 0x60581ccau}, + {0xffe976abu, 0x8eb5140fu, 0x60581ccau, 0x7d836e77u, 0x89be9c1cu, 0xce1d62e0u, 0xce1d62e0u, 0xbef7e268u, 0x5b4c8012u, 0x60581ccau, 0x60581ccau, 0x16f44881u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xbef7e268u, 0x89be9c1cu, 0x60581ccau, 0xaf67d461u, 0x8eb5140fu, 0x60581ccau, 0x60581ccau, 0x837a7935u, 0xce1d62e0u, 0xffe976abu, 0xffe976abu, 0x8eb5140fu, 0x89be9c1cu, 0x60581ccau, 0x00000000u, 0x60581ccau}, + {0x837a7935u, 0xfadb8908u, 0x16f44881u, 0xe4163207u, 0x16f44881u, 0xb91dddd9u, 0xb91dddd9u, 0xa341738cu, 0x60581ccau, 0xbef7e268u, 0xb91dddd9u, 0x89be9c1cu, 0xfadb8908u, 0x00000000u, 0x60581ccau, 0x00000000u}, + {0xa341738cu, 0xffb88309u, 0x16f44881u, 0xd0944996u, 0x57241955u, 0x1389b372u, 0x1389b372u, 0x1389b372u, 0xffe976abu, 0x837a7935u, 0x837a7935u, 0x1c593af5u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x1389b372u, 0xede7bd0cu, 0x16f44881u, 0x02f0ee99u, 0x89be9c1cu, 0x837a7935u, 0x837a7935u, 0xb91dddd9u, 0xbef7e268u, 0xa341738cu, 0xa341738cu, 0x49889310u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0xb91dddd9u, 0x5b4c8012u, 0x16f44881u, 0x731c9452u, 0x8eb5140fu, 0xa341738cu, 0xa341738cu, 0x57241955u, 0x837a7935u, 0x1389b372u, 0x1389b372u, 0xd11745adu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x57241955u, 0xce1d62e0u, 0x16f44881u, 0x1919e93au, 0x16f44881u, 0x89be9c1cu, 0x89be9c1cu, 0x16f44881u, 0xa341738cu, 0xb91dddd9u, 0x89be9c1cu, 0x1919e93au, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x16f44881u, 0x60581ccau, 0x16f44881u, 0xd11745adu, 0x57241955u, 0x8eb5140fu, 0x8eb5140fu, 0x8eb5140fu, 0x1389b372u, 0x57241955u, 0x57241955u, 0x731c9452u, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu, 0xdeaddeadu}, + {0x8eb5140fu, 0xffe976abu, 0x16f44881u, 0x49889310u, 0x89be9c1cu, 0x57241955u, 0x57241955u, 0x89be9c1cu, 0xb91dddd9u, 0x16f44881u, 0x16f44881u, 0x02f0ee99u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u}, + {0x89be9c1cu, 0xbef7e268u, 0x16f44881u, 0x1c593af5u, 0x8eb5140fu, 0x16f44881u, 0x16f44881u, 0x1c593af5u, 0x57241955u, 0x8eb5140fu, 0x8eb5140fu, 0xd0944996u, 0xbef7e268u, 0x00000000u, 0x00000000u, 0x00000000u} +}; + +constexpr const char* Names[Checked] = {"bitmask_identity", "bitmask_swap8", "bitmask_broadcast", "bitmask_reverse", "bitmask_mixed", "quad_perm", "quad_perm_high_bits", "rotate_left_1", "rotate_right_3", "rotate_left_31", "rotate_masked", "rotate_high_bits", "inactive_swap8", "inactive_quad_perm", "inactive_rotate", "inactive_broadcast"}; + +std::array BufferDescriptor(const void* data, std::uint32_t bytes) { + const auto address = reinterpret_cast(data); + return {static_cast(address), static_cast((address >> 32u) & 0xffffu), bytes, 0x01016facu}; +} + +std::string Hex(std::uint32_t value) { + char text[16]; + std::snprintf(text, sizeof(text), "0x%08x", value); + return text; +} + +void Run(AgcDriver::VulkanDevice& device, std::span code, std::uint32_t waveSize, const ShaderRecompiler::SpirvTarget& target) { + for (std::uint32_t tid = 0; tid < MaxThreads; ++tid) std::copy(std::begin(Rows[tid]), std::end(Rows[tid]), &Input[tid * Inputs]); + Output.fill(0xdeadbeefu); + std::vector userData(8, 0u); + const auto input = BufferDescriptor(Input.data(), static_cast(Input.size() * 4u)); + const auto output = BufferDescriptor(Output.data(), static_cast(Output.size() * 4u)); + std::copy(input.begin(), input.end(), userData.begin()); + std::copy(output.begin(), output.end(), userData.begin() + 4); + const std::array memory{{{reinterpret_cast(code.data()), std::as_bytes(code)}}}; + const ShaderRecompiler::ShaderComputeStageInfo compute{{waveSize, 1, 1}, 0u, {false, false, false}, false, 1}; + ShaderRecompiler::RecompileRequest request{ + {ShaderStage::Compute, reinterpret_cast(code.data()), code, 0, {}}, + {waveSize, 0, userData, compute, std::nullopt, std::nullopt, memory}, + target, + {0, 0, 0, 128} + }; + request.useCache = false; + const auto result = ShaderRecompiler::Recompile(request); + device.Dispatch(result, 1, 1, 1, {}, reinterpret_cast(code.data())); + device.WaitIdle(); +} + +template +void Check(const std::uint32_t (&expected)[Lanes][Checked]) { + for (std::uint32_t tid = 0; tid < Lanes; ++tid) { + for (std::uint32_t index = 0; index < Checked; ++index) { + const auto actual = Output[tid * Results + index]; + Require(actual == expected[tid][index], "ds_swizzle wave" + std::to_string(Lanes) + ": lane " + std::to_string(tid) + " " + Names[index] + " is " + Hex(actual) + ", expected " + Hex(expected[tid][index])); + } + } +} + +} + +int main() { + try { + const auto device = OpenVulkanTestDevice(); + if (!device) return VulkanTestSkipped; + if (device->Target().subgroupSize < 32) { + std::printf("skipped, subgroup size %u cannot hold a wave32\n", device->Target().subgroupSize); + return VulkanTestSkipped; + } + Run(*device, Wave32Code, 32, device->ComputeTarget(32)); + Check(Expected32); + Run(*device, Wave64Code, 64, device->Target()); + Check(Expected64); + Run(*device, Wave64Code, 64, device->ComputeTarget(32)); + Check(Expected64); + std::puts("ds_swizzle tests passed"); + return 0; + } catch (const std::exception& error) { + std::cerr << error.what() << '\n'; + return 1; + } +}