1 | #include <cstdint> |
2 | |
3 | int main() { |
4 | #if defined(__x86_64__) |
5 | struct alignas(16) xmm_t { |
6 | uint64_t a, b; |
7 | }; |
8 | uint64_t r8 = 0x0102030405060708; |
9 | uint64_t r9 = 0x1112131415161718; |
10 | uint64_t r10 = 0x2122232425262728; |
11 | uint64_t r11 = 0x3132333435363738; |
12 | uint64_t r12 = 0x4142434445464748; |
13 | uint64_t r13 = 0x5152535455565758; |
14 | uint64_t r14 = 0x6162636465666768; |
15 | uint64_t r15 = 0x7172737475767778; |
16 | |
17 | xmm_t xmm8 = {.a: 0x020406080A0C0E01, .b: 0x030507090B0D0F00}; |
18 | xmm_t xmm9 = {.a: 0x121416181A1C1E11, .b: 0x131517191B1D1F10}; |
19 | xmm_t xmm10 = {.a: 0x222426282A2C2E21, .b: 0x232527292B2D2F20}; |
20 | xmm_t xmm11 = {.a: 0x323436383A3C3E31, .b: 0x333537393B3D3F30}; |
21 | xmm_t xmm12 = {.a: 0x424446484A4C4E41, .b: 0x434547494B4D4F40}; |
22 | xmm_t xmm13 = {.a: 0x525456585A5C5E51, .b: 0x535557595B5D5F50}; |
23 | xmm_t xmm14 = {.a: 0x626466686A6C6E61, .b: 0x636567696B6D6F60}; |
24 | xmm_t xmm15 = {.a: 0x727476787A7C7E71, .b: 0x737577797B7D7F70}; |
25 | |
26 | asm volatile("movq %0, %%r8\n\t" |
27 | "movq %1, %%r9\n\t" |
28 | "movq %2, %%r10\n\t" |
29 | "movq %3, %%r11\n\t" |
30 | "movq %4, %%r12\n\t" |
31 | "movq %5, %%r13\n\t" |
32 | "movq %6, %%r14\n\t" |
33 | "movq %7, %%r15\n\t" |
34 | "\n\t" |
35 | "movaps %8, %%xmm8\n\t" |
36 | "movaps %9, %%xmm9\n\t" |
37 | "movaps %10, %%xmm10\n\t" |
38 | "movaps %11, %%xmm11\n\t" |
39 | "movaps %12, %%xmm12\n\t" |
40 | "movaps %13, %%xmm13\n\t" |
41 | "movaps %14, %%xmm14\n\t" |
42 | "movaps %15, %%xmm15\n\t" |
43 | "\n\t" |
44 | "int3" |
45 | : |
46 | : "g" (r8), "g" (r9), "g" (r10), "g" (r11), "g" (r12), "g" (r13), |
47 | "g" (r14), "g" (r15), "m" (xmm8), "m" (xmm9), "m" (xmm10), |
48 | "m" (xmm11), "m" (xmm12), "m" (xmm13), "m" (xmm14), "m" (xmm15) |
49 | : "%r8" , "%r9" , "%r10" , "%r11" , "%r12" , "%r13" , "%r14" , "%r15" , |
50 | "%xmm8" , "%xmm9" , "%xmm10" , "%xmm11" , "%xmm12" , "%xmm13" , |
51 | "%xmm14" , "%xmm15" ); |
52 | #endif |
53 | return 0; |
54 | } |
55 | |