Index: lldb/lit/Register/Inputs/x86-ymm-write.cpp =================================================================== --- /dev/null +++ lldb/lit/Register/Inputs/x86-ymm-write.cpp @@ -0,0 +1,77 @@ +#include +#include +#include + +union alignas(32) ymm_t { + uint64_t as_uint64[4]; + uint8_t as_uint8[32]; +}; + +int main() { + constexpr ymm_t ymm_fill = { + .as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F, + 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F } + }; + + ymm_t ymm[16]; + + asm volatile( + "vmovaps %1, %%ymm0\n\t" + "vmovaps %1, %%ymm1\n\t" + "vmovaps %1, %%ymm2\n\t" + "vmovaps %1, %%ymm3\n\t" + "vmovaps %1, %%ymm4\n\t" + "vmovaps %1, %%ymm5\n\t" + "vmovaps %1, %%ymm6\n\t" + "vmovaps %1, %%ymm7\n\t" +#if defined(__x86_64__) || defined(_M_X64) + "vmovaps %1, %%ymm8\n\t" + "vmovaps %1, %%ymm9\n\t" + "vmovaps %1, %%ymm10\n\t" + "vmovaps %1, %%ymm11\n\t" + "vmovaps %1, %%ymm12\n\t" + "vmovaps %1, %%ymm13\n\t" + "vmovaps %1, %%ymm14\n\t" + "vmovaps %1, %%ymm15\n\t" +#endif + "\n\t" + "int3\n\t" + "\n\t" + "lea %0, %%rbx\n\t" + "vmovaps %%ymm0, 0x000(%%rbx)\n\t" + "vmovaps %%ymm1, 0x020(%%rbx)\n\t" + "vmovaps %%ymm2, 0x040(%%rbx)\n\t" + "vmovaps %%ymm3, 0x060(%%rbx)\n\t" + "vmovaps %%ymm4, 0x080(%%rbx)\n\t" + "vmovaps %%ymm5, 0x0A0(%%rbx)\n\t" + "vmovaps %%ymm6, 0x0C0(%%rbx)\n\t" + "vmovaps %%ymm7, 0x0E0(%%rbx)\n\t" +#if defined(__x86_64__) || defined(_M_X64) + "vmovaps %%ymm8, 0x100(%%rbx)\n\t" + "vmovaps %%ymm9, 0x120(%%rbx)\n\t" + "vmovaps %%ymm10, 0x140(%%rbx)\n\t" + "vmovaps %%ymm11, 0x160(%%rbx)\n\t" + "vmovaps %%ymm12, 0x180(%%rbx)\n\t" + "vmovaps %%ymm13, 0x1A0(%%rbx)\n\t" + "vmovaps %%ymm14, 0x1C0(%%rbx)\n\t" + "vmovaps %%ymm15, 0x1E0(%%rbx)\n\t" +#endif + : "=m"(ymm) + : "m"(ymm_fill) + : "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", +#if defined(__x86_64__) || defined(_M_X64) + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", + "%ymm15", +#endif + "%rbx" + ); + + for (int i = 0; i < 16; ++i) { + printf("ymm%d = { ", i); + for (int j = 0; j < sizeof(ymm->as_uint8); ++j) + printf("0x%02x ", ymm[i].as_uint8[j]); + printf("}\n"); + } + + return 0; +} Index: lldb/lit/Register/x86-64-ymm-write.test =================================================================== --- /dev/null +++ lldb/lit/Register/x86-64-ymm-write.test @@ -0,0 +1,44 @@ +# XFAIL: system-windows +# REQUIRES: native && target-x86_64 && native-cpu-avx +# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t +# RUN: %lldb -b -s %s %t | FileCheck %s +process launch + +register write ymm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82}" +register write ymm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92}" +register write ymm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2}" +register write ymm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2}" +register write ymm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2}" +register write ymm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2}" +register write ymm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2}" +register write ymm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}" +register write ymm8 "{0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}" +register write ymm9 "{0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13}" +register write ymm10 "{0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23}" +register write ymm11 "{0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33}" +register write ymm12 "{0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43}" +register write ymm13 "{0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53}" +register write ymm14 "{0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63}" +register write ymm15 "{0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73}" + +process continue +# CHECK: process continue + +# CHECK-DAG: ymm0 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 } +# CHECK-DAG: ymm1 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 } +# CHECK-DAG: ymm2 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 } +# CHECK-DAG: ymm3 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 } +# CHECK-DAG: ymm4 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 } +# CHECK-DAG: ymm5 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 } +# CHECK-DAG: ymm6 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 } +# CHECK-DAG: ymm7 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 } +# CHECK-DAG: ymm8 = { 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 } +# CHECK-DAG: ymm9 = { 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 } +# CHECK-DAG: ymm10 = { 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 } +# CHECK-DAG: ymm11 = { 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 } +# CHECK-DAG: ymm12 = { 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 } +# CHECK-DAG: ymm13 = { 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 } +# CHECK-DAG: ymm14 = { 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 } +# CHECK-DAG: ymm15 = { 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 } + +# CHECK: Process {{[0-9]+}} exited with status = 0 Index: lldb/lit/Register/x86-ymm-write.test =================================================================== --- /dev/null +++ lldb/lit/Register/x86-ymm-write.test @@ -0,0 +1,28 @@ +# XFAIL: system-windows +# REQUIRES: native && target-x86 && native-cpu-avx +# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t +# RUN: %lldb -b -s %s %t | FileCheck %s +process launch + +register write ymm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82}" +register write ymm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92}" +register write ymm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2}" +register write ymm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2}" +register write ymm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2}" +register write ymm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2}" +register write ymm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2}" +register write ymm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}" + +process continue +# CHECK: process continue + +# CHECK-DAG: ymm0 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 } +# CHECK-DAG: ymm1 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 } +# CHECK-DAG: ymm2 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 } +# CHECK-DAG: ymm3 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 } +# CHECK-DAG: ymm4 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 } +# CHECK-DAG: ymm5 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 } +# CHECK-DAG: ymm6 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 } +# CHECK-DAG: ymm7 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 } + +# CHECK: Process {{[0-9]+}} exited with status = 0