tests: Add visual test for SM5 bit instructions.

This commit is contained in:
Józef Kucia 2017-06-29 09:02:50 +02:00
parent f8b25dcea4
commit b1000b73d3

View File

@ -3951,6 +3951,33 @@ static void test_shader_instructions(void)
0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_bfrev = {ps_bfrev_code, sizeof(ps_bfrev_code)};
static const DWORD ps_bits_code[] =
{
#if 0
uint u;
int i;
uint4 main() : SV_Target
{
return uint4(countbits(u), firstbitlow(u), firstbithigh(u), firstbithigh(i));
}
#endif
0x43425844, 0x23fee911, 0x145287d1, 0xea904419, 0x8aa59a6a, 0x00000001, 0x000001b4, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000013c, 0x00000050, 0x0000004f,
0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
0x02000068, 0x00000001, 0x06000089, 0x00100012, 0x00000000, 0x0020801a, 0x00000000, 0x00000000,
0x07000020, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0xffffffff, 0x0800001e,
0x00100012, 0x00000000, 0x00004001, 0x0000001f, 0x8010000a, 0x00000041, 0x00000000, 0x09000037,
0x00102082, 0x00000000, 0x0010001a, 0x00000000, 0x00004001, 0xffffffff, 0x0010000a, 0x00000000,
0x06000087, 0x00100012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x0800001e, 0x00100012,
0x00000000, 0x00004001, 0x0000001f, 0x8010000a, 0x00000041, 0x00000000, 0x0a000037, 0x00102042,
0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0xffffffff,
0x06000086, 0x00102012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x06000088, 0x00102022,
0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_bits = {ps_bits_code, sizeof(ps_bits_code)};
static const DWORD ps_ishr_code[] =
{
#if 0
@ -4161,6 +4188,19 @@ static void test_shader_instructions(void)
{&ps_bfrev, {{0xffff0000}}, {{0x0000ffff, 0xffff0000, 0x00000000, 0xffff0000}}},
{&ps_bfrev, {{0xffffffff}}, {{0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000}}},
{&ps_bits, {{ 0, 0}}, {{ 0, ~0u, ~0u, ~0u}}},
{&ps_bits, {{ ~0u, ~0u}}, {{32, 0, 31, ~0u}}},
{&ps_bits, {{0x7fffffff, 0x7fffffff}}, {{31, 0, 30, 30}}},
{&ps_bits, {{0x80000000, 0x80000000}}, {{ 1, 31, 31, 30}}},
{&ps_bits, {{0x00000001, 0x00000001}}, {{ 1, 0, 0, 0}}},
{&ps_bits, {{0x80000001, 0x80000001}}, {{ 2, 0, 31, 30}}},
{&ps_bits, {{0x88888888, 0x88888888}}, {{ 8, 3, 31, 30}}},
{&ps_bits, {{0xcccccccc, 0xcccccccc}}, {{16, 2, 31, 29}}},
{&ps_bits, {{0x11111111, 0x11111c11}}, {{ 8, 0, 28, 28}}},
{&ps_bits, {{0x0000000f, 0x0000000f}}, {{ 4, 0, 3, 3}}},
{&ps_bits, {{0x8000000f, 0x8000000f}}, {{ 5, 0, 31, 30}}},
{&ps_bits, {{0x00080000, 0x00080000}}, {{ 1, 19, 19, 19}}},
{&ps_ishr, {{0x00000000, 0x00000000, 0x00000000, 0x00000000}, {~0x1fu, 0, 32, 64}},
{{0x00000000, 0x00000000, 0x00000000, 0x00000000}}},
{&ps_ishr, {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}, {~0x1fu, 0, 32, 64}},