diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/LdsMixedWidthAtomics.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/LdsMixedWidthAtomics.cpp index a13bc66e2..6528e8af9 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/LdsMixedWidthAtomics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/LdsMixedWidthAtomics.cpp @@ -21,7 +21,14 @@ constexpr std::uint32_t Iterations = 16; constexpr std::uint32_t Repeats = 32; constexpr std::uint32_t LdsDwords = 4; alignas(256) std::array Output{}; -alignas(256) std::array Unused{}; +alignas(256) std::array Input = [] { + std::array rows{}; + for (std::uint32_t tid = 0; tid < Threads; ++tid) { + rows[tid * 4u] = 0xffffffffu; + rows[tid * 4u + 2u] = 1u; + } + return rows; +}(); template constexpr auto Unrolled(const std::array& head, const std::array& body, const std::array& tail) { @@ -125,6 +132,37 @@ alignas(256) constexpr auto ParityCode = Unrolled<1>( 0xbf810000, })); +alignas(256) constexpr auto LoadedParityCode = Unrolled<1>( + std::to_array({ + 0x34100083, + 0x340a0084, + 0x7e020280, + 0xe0381000, 0x80000c05, + 0x7e0c0280, + 0x7e0e0280, + 0xd9340000, 0x00000601, + 0xbf8c0070, + 0xbf8a0000, + 0xbe89037e, + }), + std::to_array({ + 0xbefe03ff, 0x55555555, + 0xd9000000, 0x00000c01, + 0xbf8cc07f, + 0xbefe03ff, 0xaaaaaaaa, + 0xd8000004, 0x00000e01, + 0xbf8cc07f, + }), + std::to_array({ + 0xbefe0309, + 0xbf8cc07f, + 0xbf8a0000, + 0xd9d80000, 0x0a000001, + 0xbf8cc07f, + 0xe0741000, 0x80010a08, + 0xbf810000, + })); + 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, 0x31016facu}; @@ -146,7 +184,7 @@ void Check(const char* name, std::uint64_t operations, std::uint32_t run) { void Run(AgcDriver::VulkanDevice& device, std::span code, const char* name, std::uint64_t operations, std::uint32_t repeats) { std::vector userData(8, 0u); - const auto input = BufferDescriptor(Unused.data(), static_cast(Unused.size() * 4u)); + 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); @@ -177,6 +215,7 @@ int main() { Run(*device, UniformCode, "uniform", static_cast(Threads) * Iterations, 1); Run(*device, DivergentCode, "divergent", static_cast(Threads) / 2u * Iterations, 1); Run(*device, ParityCode, "split lanes", Threads / 2u, Repeats); + Run(*device, LoadedParityCode, "split lanes with per-lane operands", Threads / 2u, Repeats); std::puts("lds mixed width atomics tests passed"); return 0; } catch (const std::exception& error) {