[lldb] [lit] Use LLDB-like output for XMM registers in write tests

llvm-svn: 359784
This commit is contained in:
Michal Gorny 2019-05-02 12:55:54 +00:00
parent 72d3ca957c
commit 4d738566d6
4 changed files with 40 additions and 26 deletions

View File

@ -2,12 +2,15 @@
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
struct alignas(16) xmm_t { union alignas(16) xmm_t {
uint64_t a, b; uint64_t as_uint64[2];
uint8_t as_uint8[16];
}; };
int main() { int main() {
constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }; constexpr xmm_t xmm_fill = {
.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
};
uint64_t r64[8]; uint64_t r64[8];
xmm_t xmm[8]; xmm_t xmm[8];
@ -60,8 +63,12 @@ int main() {
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)
printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]); printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]);
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i) {
printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i+8, xmm[i].b, xmm[i].a); printf("xmm%d = { ", i+8);
for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
printf("0x%02x ", xmm[i].as_uint8[j]);
printf("}\n");
}
return 0; return 0;
} }

View File

@ -2,12 +2,15 @@
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
struct alignas(16) xmm_t { union alignas(16) xmm_t {
uint64_t a, b; uint64_t as_uint64[2];
uint8_t as_uint8[16];
}; };
int main() { int main() {
constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }; constexpr xmm_t xmm_fill = {
.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
};
uint64_t mm[8]; uint64_t mm[8];
xmm_t xmm[8]; xmm_t xmm[8];
@ -60,8 +63,12 @@ int main() {
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)
printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]); printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i) {
printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a); printf("xmm%d = { ", i);
for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
printf("0x%02x ", xmm[i].as_uint8[j]);
printf("}\n");
}
return 0; return 0;
} }

View File

@ -35,13 +35,13 @@ process continue
# CHECK-DAG: r14 = 0x6162636465666768 # CHECK-DAG: r14 = 0x6162636465666768
# CHECK-DAG: r15 = 0x7172737475767778 # CHECK-DAG: r15 = 0x7172737475767778
# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01 # CHECK-DAG: xmm8 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 }
# CHECK-DAG: xmm9 = 0x131517191b1d1f10121416181a1c1e11 # CHECK-DAG: xmm9 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 }
# CHECK-DAG: xmm10 = 0x232527292b2d2f20222426282a2c2e21 # CHECK-DAG: xmm10 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 }
# CHECK-DAG: xmm11 = 0x333537393b3d3f30323436383a3c3e31 # CHECK-DAG: xmm11 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 }
# CHECK-DAG: xmm12 = 0x434547494b4d4f40424446484a4c4e41 # CHECK-DAG: xmm12 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 }
# CHECK-DAG: xmm13 = 0x535557595b5d5f50525456585a5c5e51 # CHECK-DAG: xmm13 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 }
# CHECK-DAG: xmm14 = 0x636567696b6d6f60626466686a6c6e61 # CHECK-DAG: xmm14 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 }
# CHECK-DAG: xmm15 = 0x737577797b7d7f70727476787a7c7e71 # CHECK-DAG: xmm15 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 }
# CHECK: Process {{[0-9]+}} exited with status = 0 # CHECK: Process {{[0-9]+}} exited with status = 0

View File

@ -35,13 +35,13 @@ process continue
# CHECK-DAG: mm6 = 0x6162636465666768 # CHECK-DAG: mm6 = 0x6162636465666768
# CHECK-DAG: mm7 = 0x7172737475767778 # CHECK-DAG: mm7 = 0x7172737475767778
# CHECK-DAG: xmm0 = 0x030507090b0d0f00020406080a0c0e01 # CHECK-DAG: xmm0 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 }
# CHECK-DAG: xmm1 = 0x131517191b1d1f10121416181a1c1e11 # CHECK-DAG: xmm1 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 }
# CHECK-DAG: xmm2 = 0x232527292b2d2f20222426282a2c2e21 # CHECK-DAG: xmm2 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 }
# CHECK-DAG: xmm3 = 0x333537393b3d3f30323436383a3c3e31 # CHECK-DAG: xmm3 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 }
# CHECK-DAG: xmm4 = 0x434547494b4d4f40424446484a4c4e41 # CHECK-DAG: xmm4 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 }
# CHECK-DAG: xmm5 = 0x535557595b5d5f50525456585a5c5e51 # CHECK-DAG: xmm5 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 }
# CHECK-DAG: xmm6 = 0x636567696b6d6f60626466686a6c6e61 # CHECK-DAG: xmm6 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 }
# CHECK-DAG: xmm7 = 0x737577797b7d7f70727476787a7c7e71 # CHECK-DAG: xmm7 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 }
# CHECK: Process {{[0-9]+}} exited with status = 0 # CHECK: Process {{[0-9]+}} exited with status = 0