1 | #include <cstdint> |
2 | |
3 | struct alignas(64) zmm_t { |
4 | uint64_t a, b, c, d, e, f, g, h; |
5 | }; |
6 | |
7 | int main() { |
8 | constexpr zmm_t zmm[] = { |
9 | { .a: 0x0706050403020100, .b: 0x0F0E0D0C0B0A0908, |
10 | .c: 0x1716151413121110, .d: 0x1F1E1D1C1B1A1918, |
11 | .e: 0x2726252423222120, .f: 0x2F2E2D2C2B2A2928, |
12 | .g: 0x3736353433323130, .h: 0x3F3E3D3C3B3A3938, }, |
13 | { .a: 0x0807060504030201, .b: 0x100F0E0D0C0B0A09, |
14 | .c: 0x1817161514131211, .d: 0x201F1E1D1C1B1A19, |
15 | .e: 0x2827262524232221, .f: 0x302F2E2D2C2B2A29, |
16 | .g: 0x3837363534333231, .h: 0x403F3E3D3C3B3A39, }, |
17 | { .a: 0x0908070605040302, .b: 0x11100F0E0D0C0B0A, |
18 | .c: 0x1918171615141312, .d: 0x21201F1E1D1C1B1A, |
19 | .e: 0x2928272625242322, .f: 0x31302F2E2D2C2B2A, |
20 | .g: 0x3938373635343332, .h: 0x41403F3E3D3C3B3A, }, |
21 | { .a: 0x0A09080706050403, .b: 0x1211100F0E0D0C0B, |
22 | .c: 0x1A19181716151413, .d: 0x2221201F1E1D1C1B, |
23 | .e: 0x2A29282726252423, .f: 0x3231302F2E2D2C2B, |
24 | .g: 0x3A39383736353433, .h: 0x4241403F3E3D3C3B, }, |
25 | { .a: 0x0B0A090807060504, .b: 0x131211100F0E0D0C, |
26 | .c: 0x1B1A191817161514, .d: 0x232221201F1E1D1C, |
27 | .e: 0x2B2A292827262524, .f: 0x333231302F2E2D2C, |
28 | .g: 0x3B3A393837363534, .h: 0x434241403F3E3D3C, }, |
29 | { .a: 0x0C0B0A0908070605, .b: 0x14131211100F0E0D, |
30 | .c: 0x1C1B1A1918171615, .d: 0x24232221201F1E1D, |
31 | .e: 0x2C2B2A2928272625, .f: 0x34333231302F2E2D, |
32 | .g: 0x3C3B3A3938373635, .h: 0x44434241403F3E3D, }, |
33 | { .a: 0x0D0C0B0A09080706, .b: 0x1514131211100F0E, |
34 | .c: 0x1D1C1B1A19181716, .d: 0x2524232221201F1E, |
35 | .e: 0x2D2C2B2A29282726, .f: 0x3534333231302F2E, |
36 | .g: 0x3D3C3B3A39383736, .h: 0x4544434241403F3E, }, |
37 | { .a: 0x0E0D0C0B0A090807, .b: 0x161514131211100F, |
38 | .c: 0x1E1D1C1B1A191817, .d: 0x262524232221201F, |
39 | .e: 0x2E2D2C2B2A292827, .f: 0x363534333231302F, |
40 | .g: 0x3E3D3C3B3A393837, .h: 0x464544434241403F, }, |
41 | #if defined(__x86_64__) || defined(_M_X64) |
42 | { .a: 0x0F0E0D0C0B0A0908, .b: 0x1716151413121110, |
43 | .c: 0x1F1E1D1C1B1A1918, .d: 0x2726252423222120, |
44 | .e: 0x2F2E2D2C2B2A2928, .f: 0x3736353433323130, |
45 | .g: 0x3F3E3D3C3B3A3938, .h: 0x4746454443424140, }, |
46 | { .a: 0x100F0E0D0C0B0A09, .b: 0x1817161514131211, |
47 | .c: 0x201F1E1D1C1B1A19, .d: 0x2827262524232221, |
48 | .e: 0x302F2E2D2C2B2A29, .f: 0x3837363534333231, |
49 | .g: 0x403F3E3D3C3B3A39, .h: 0x4847464544434241, }, |
50 | { .a: 0x11100F0E0D0C0B0A, .b: 0x1918171615141312, |
51 | .c: 0x21201F1E1D1C1B1A, .d: 0x2928272625242322, |
52 | .e: 0x31302F2E2D2C2B2A, .f: 0x3938373635343332, |
53 | .g: 0x41403F3E3D3C3B3A, .h: 0x4948474645444342, }, |
54 | { .a: 0x1211100F0E0D0C0B, .b: 0x1A19181716151413, |
55 | .c: 0x2221201F1E1D1C1B, .d: 0x2A29282726252423, |
56 | .e: 0x3231302F2E2D2C2B, .f: 0x3A39383736353433, |
57 | .g: 0x4241403F3E3D3C3B, .h: 0x4A49484746454443, }, |
58 | { .a: 0x131211100F0E0D0C, .b: 0x1B1A191817161514, |
59 | .c: 0x232221201F1E1D1C, .d: 0x2B2A292827262524, |
60 | .e: 0x333231302F2E2D2C, .f: 0x3B3A393837363534, |
61 | .g: 0x434241403F3E3D3C, .h: 0x4B4A494847464544, }, |
62 | { .a: 0x14131211100F0E0D, .b: 0x1C1B1A1918171615, |
63 | .c: 0x24232221201F1E1D, .d: 0x2C2B2A2928272625, |
64 | .e: 0x34333231302F2E2D, .f: 0x3C3B3A3938373635, |
65 | .g: 0x44434241403F3E3D, .h: 0x4C4B4A4948474645, }, |
66 | { .a: 0x1514131211100F0E, .b: 0x1D1C1B1A19181716, |
67 | .c: 0x2524232221201F1E, .d: 0x2D2C2B2A29282726, |
68 | .e: 0x3534333231302F2E, .f: 0x3D3C3B3A39383736, |
69 | .g: 0x4544434241403F3E, .h: 0x4D4C4B4A49484746, }, |
70 | { .a: 0x161514131211100F, .b: 0x1E1D1C1B1A191817, |
71 | .c: 0x262524232221201F, .d: 0x2E2D2C2B2A292827, |
72 | .e: 0x363534333231302F, .f: 0x3E3D3C3B3A393837, |
73 | .g: 0x464544434241403F, .h: 0x4E4D4C4B4A494847, }, |
74 | { .a: 0x1716151413121110, .b: 0x1F1E1D1C1B1A1918, |
75 | .c: 0x2726252423222120, .d: 0x2F2E2D2C2B2A2928, |
76 | .e: 0x3736353433323130, .f: 0x3F3E3D3C3B3A3938, |
77 | .g: 0x4746454443424140, .h: 0x4F4E4D4C4B4A4948, }, |
78 | { .a: 0x1817161514131211, .b: 0x201F1E1D1C1B1A19, |
79 | .c: 0x2827262524232221, .d: 0x302F2E2D2C2B2A29, |
80 | .e: 0x3837363534333231, .f: 0x403F3E3D3C3B3A39, |
81 | .g: 0x4847464544434241, .h: 0x504F4E4D4C4B4A49, }, |
82 | { .a: 0x1918171615141312, .b: 0x21201F1E1D1C1B1A, |
83 | .c: 0x2928272625242322, .d: 0x31302F2E2D2C2B2A, |
84 | .e: 0x3938373635343332, .f: 0x41403F3E3D3C3B3A, |
85 | .g: 0x4948474645444342, .h: 0x51504F4E4D4C4B4A, }, |
86 | { .a: 0x1A19181716151413, .b: 0x2221201F1E1D1C1B, |
87 | .c: 0x2A29282726252423, .d: 0x3231302F2E2D2C2B, |
88 | .e: 0x3A39383736353433, .f: 0x4241403F3E3D3C3B, |
89 | .g: 0x4A49484746454443, .h: 0x5251504F4E4D4C4B, }, |
90 | { .a: 0x1B1A191817161514, .b: 0x232221201F1E1D1C, |
91 | .c: 0x2B2A292827262524, .d: 0x333231302F2E2D2C, |
92 | .e: 0x3B3A393837363534, .f: 0x434241403F3E3D3C, |
93 | .g: 0x4B4A494847464544, .h: 0x535251504F4E4D4C, }, |
94 | { .a: 0x1C1B1A1918171615, .b: 0x24232221201F1E1D, |
95 | .c: 0x2C2B2A2928272625, .d: 0x34333231302F2E2D, |
96 | .e: 0x3C3B3A3938373635, .f: 0x44434241403F3E3D, |
97 | .g: 0x4C4B4A4948474645, .h: 0x54535251504F4E4D, }, |
98 | { .a: 0x1D1C1B1A19181716, .b: 0x2524232221201F1E, |
99 | .c: 0x2D2C2B2A29282726, .d: 0x3534333231302F2E, |
100 | .e: 0x3D3C3B3A39383736, .f: 0x4544434241403F3E, |
101 | .g: 0x4D4C4B4A49484746, .h: 0x5554535251504F4E, }, |
102 | { .a: 0x1E1D1C1B1A191817, .b: 0x262524232221201F, |
103 | .c: 0x2E2D2C2B2A292827, .d: 0x363534333231302F, |
104 | .e: 0x3E3D3C3B3A393837, .f: 0x464544434241403F, |
105 | .g: 0x4E4D4C4B4A494847, .h: 0x565554535251504F, }, |
106 | { .a: 0x1F1E1D1C1B1A1918, .b: 0x2726252423222120, |
107 | .c: 0x2F2E2D2C2B2A2928, .d: 0x3736353433323130, |
108 | .e: 0x3F3E3D3C3B3A3938, .f: 0x4746454443424140, |
109 | .g: 0x4F4E4D4C4B4A4948, .h: 0x5756555453525150, }, |
110 | { .a: 0x201F1E1D1C1B1A19, .b: 0x2827262524232221, |
111 | .c: 0x302F2E2D2C2B2A29, .d: 0x3837363534333231, |
112 | .e: 0x403F3E3D3C3B3A39, .f: 0x4847464544434241, |
113 | .g: 0x504F4E4D4C4B4A49, .h: 0x5857565554535251, }, |
114 | { .a: 0x21201F1E1D1C1B1A, .b: 0x2928272625242322, |
115 | .c: 0x31302F2E2D2C2B2A, .d: 0x3938373635343332, |
116 | .e: 0x41403F3E3D3C3B3A, .f: 0x4948474645444342, |
117 | .g: 0x51504F4E4D4C4B4A, .h: 0x5958575655545352, }, |
118 | { .a: 0x2221201F1E1D1C1B, .b: 0x2A29282726252423, |
119 | .c: 0x3231302F2E2D2C2B, .d: 0x3A39383736353433, |
120 | .e: 0x4241403F3E3D3C3B, .f: 0x4A49484746454443, |
121 | .g: 0x5251504F4E4D4C4B, .h: 0x5A59585756555453, }, |
122 | { .a: 0x232221201F1E1D1C, .b: 0x2B2A292827262524, |
123 | .c: 0x333231302F2E2D2C, .d: 0x3B3A393837363534, |
124 | .e: 0x434241403F3E3D3C, .f: 0x4B4A494847464544, |
125 | .g: 0x535251504F4E4D4C, .h: 0x5B5A595857565554, }, |
126 | { .a: 0x24232221201F1E1D, .b: 0x2C2B2A2928272625, |
127 | .c: 0x34333231302F2E2D, .d: 0x3C3B3A3938373635, |
128 | .e: 0x44434241403F3E3D, .f: 0x4C4B4A4948474645, |
129 | .g: 0x54535251504F4E4D, .h: 0x5C5B5A5958575655, }, |
130 | { .a: 0x2524232221201F1E, .b: 0x2D2C2B2A29282726, |
131 | .c: 0x3534333231302F2E, .d: 0x3D3C3B3A39383736, |
132 | .e: 0x4544434241403F3E, .f: 0x4D4C4B4A49484746, |
133 | .g: 0x5554535251504F4E, .h: 0x5D5C5B5A59585756, }, |
134 | { .a: 0x262524232221201F, .b: 0x2E2D2C2B2A292827, |
135 | .c: 0x363534333231302F, .d: 0x3E3D3C3B3A393837, |
136 | .e: 0x464544434241403F, .f: 0x4E4D4C4B4A494847, |
137 | .g: 0x565554535251504F, .h: 0x5E5D5C5B5A595857, }, |
138 | #endif |
139 | }; |
140 | |
141 | asm volatile( |
142 | "vmovaps 0x000(%0), %%zmm0\n\t" |
143 | "vmovaps 0x040(%0), %%zmm1\n\t" |
144 | "vmovaps 0x080(%0), %%zmm2\n\t" |
145 | "vmovaps 0x0C0(%0), %%zmm3\n\t" |
146 | "vmovaps 0x100(%0), %%zmm4\n\t" |
147 | "vmovaps 0x140(%0), %%zmm5\n\t" |
148 | "vmovaps 0x180(%0), %%zmm6\n\t" |
149 | "vmovaps 0x1C0(%0), %%zmm7\n\t" |
150 | #if defined(__x86_64__) || defined(_M_X64) |
151 | "vmovaps 0x200(%0), %%zmm8\n\t" |
152 | "vmovaps 0x240(%0), %%zmm9\n\t" |
153 | "vmovaps 0x280(%0), %%zmm10\n\t" |
154 | "vmovaps 0x2C0(%0), %%zmm11\n\t" |
155 | "vmovaps 0x300(%0), %%zmm12\n\t" |
156 | "vmovaps 0x340(%0), %%zmm13\n\t" |
157 | "vmovaps 0x380(%0), %%zmm14\n\t" |
158 | "vmovaps 0x3C0(%0), %%zmm15\n\t" |
159 | "vmovaps 0x400(%0), %%zmm16\n\t" |
160 | "vmovaps 0x440(%0), %%zmm17\n\t" |
161 | "vmovaps 0x480(%0), %%zmm18\n\t" |
162 | "vmovaps 0x4C0(%0), %%zmm19\n\t" |
163 | "vmovaps 0x500(%0), %%zmm20\n\t" |
164 | "vmovaps 0x540(%0), %%zmm21\n\t" |
165 | "vmovaps 0x580(%0), %%zmm22\n\t" |
166 | "vmovaps 0x5C0(%0), %%zmm23\n\t" |
167 | "vmovaps 0x600(%0), %%zmm24\n\t" |
168 | "vmovaps 0x640(%0), %%zmm25\n\t" |
169 | "vmovaps 0x680(%0), %%zmm26\n\t" |
170 | "vmovaps 0x6C0(%0), %%zmm27\n\t" |
171 | "vmovaps 0x700(%0), %%zmm28\n\t" |
172 | "vmovaps 0x740(%0), %%zmm29\n\t" |
173 | "vmovaps 0x780(%0), %%zmm30\n\t" |
174 | "vmovaps 0x7C0(%0), %%zmm31\n\t" |
175 | #endif |
176 | "\n\t" |
177 | "int3\n\t" |
178 | : |
179 | : "b" (zmm) |
180 | : "%zmm0" , "%zmm1" , "%zmm2" , "%zmm3" , "%zmm4" , "%zmm5" , "%zmm6" , "%zmm7" |
181 | #if defined(__x86_64__) || defined(_M_X64) |
182 | , "%zmm8" , "%zmm9" , "%zmm10" , "%zmm11" , "%zmm12" , "%zmm13" , "%zmm14" , |
183 | "%zmm15" , "%zmm16" , "%zmm17" , "%zmm18" , "%zmm19" , "%zmm20" , "%zmm21" , |
184 | "%zmm22" , "%zmm23" , "%zmm24" , "%zmm25" , "%zmm26" , "%zmm27" , "%zmm28" , |
185 | "%zmm29" , "%zmm30" , "%zmm31" |
186 | #endif |
187 | ); |
188 | |
189 | return 0; |
190 | } |
191 | |