mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
helper functions to print a m128 vector in debug mode
This commit is contained in:
parent
1c26f044a7
commit
d76365240b
@ -44,6 +44,44 @@
|
||||
#error "You need at least a 128-bit capable SIMD engine!"
|
||||
#endif // HAVE_SIMD_128_BITS
|
||||
|
||||
#ifdef DEBUG
|
||||
static inline void print_m128_16x8(char *label, m128 vector) {
|
||||
uint8_t __attribute__((aligned(16))) data[16];
|
||||
store128(data, vector);
|
||||
DEBUG_PRINTF("%s: ", label);
|
||||
for(int i=0; i < 16; i++)
|
||||
printf("%02x ", data[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static inline void print_m128_8x16(char *label, m128 vector) {
|
||||
uint16_t __attribute__((aligned(16))) data[8];
|
||||
store128(data, vector);
|
||||
DEBUG_PRINTF("%s: ", label);
|
||||
for(int i=0; i < 8; i++)
|
||||
printf("%04x ", data[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static inline void print_m128_4x32(char *label, m128 vector) {
|
||||
uint32_t __attribute__((aligned(16))) data[4];
|
||||
store128(data, vector);
|
||||
DEBUG_PRINTF("%s: ", label);
|
||||
for(int i=0; i < 4; i++)
|
||||
printf("%08x ", data[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static inline void print_m128_2x64(char *label, m128 vector) {
|
||||
uint64_t __attribute__((aligned(16))) data[2];
|
||||
store128(data, vector);
|
||||
DEBUG_PRINTF("%s: ", label);
|
||||
for(int i=0; i < 2; i++)
|
||||
printf("%016lx ", data[i]);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/****
|
||||
**** 256-bit Primitives
|
||||
****/
|
||||
|
Loading…
x
Reference in New Issue
Block a user