SuperVector operators fixes and simd_utils low/high64 functions implementations added

This commit is contained in:
Apostolos Tapsas
2021-10-18 12:26:38 +00:00
parent f0e6b8459c
commit 3655175b6d
3 changed files with 30 additions and 27 deletions

View File

@@ -49,8 +49,8 @@
static inline void print_m128_16x8(const char *label, m128 vector) {
uint8_t ALIGN_ATTR(16) data[16];
store128(data, vector);
DEBUG_PRINTF("%s: ", label);
for(int i=0; i < 16; i++)
DEBUG_PRINTF("%12s: ", label);
for(int i=15; i >=0; i--)
printf("%02x ", data[i]);
printf("\n");
}
@@ -58,8 +58,8 @@ static inline void print_m128_16x8(const char *label, m128 vector) {
static inline void print_m128_8x16(const char *label, m128 vector) {
uint16_t ALIGN_ATTR(16) data[8];
store128(data, vector);
DEBUG_PRINTF("%s: ", label);
for(int i=0; i < 8; i++)
DEBUG_PRINTF("%12s: ", label);
for(int i=7; i >= 0; i--)
printf("%04x ", data[i]);
printf("\n");
}
@@ -67,8 +67,8 @@ static inline void print_m128_8x16(const char *label, m128 vector) {
static inline void print_m128_4x32(const char *label, m128 vector) {
uint32_t ALIGN_ATTR(16) data[4];
store128(data, vector);
DEBUG_PRINTF("%s: ", label);
for(int i=0; i < 4; i++)
DEBUG_PRINTF("%12s: ", label);
for(int i=3; i >= 0; i--)
printf("%08x ", data[i]);
printf("\n");
}
@@ -76,8 +76,8 @@ static inline void print_m128_4x32(const char *label, m128 vector) {
static inline void print_m128_2x64(const char *label, m128 vector) {
uint64_t ALIGN_ATTR(16) data[2];
store128(data, vector);
DEBUG_PRINTF("%s: ", label);
for(int i=0; i < 2; i++)
DEBUG_PRINTF("%12s: ", label);
for(int i=1; i >= 0; i--)
printf("%016lx ", data[i]);
printf("\n");
}

View File

@@ -270,7 +270,7 @@ switch (imm) {
}
}
static really_inline u64a extract64from128(const m128 in, unsigned UNUSED imm) {
static really_inline u64a extract64from128(const m128 in, unsigned imm) {
u64a ALIGN_ATTR(16) a[2];
vec_xst((uint64x2_t) in, 0, a);
switch (imm) {
@@ -285,19 +285,11 @@ switch (imm) {
}
static really_inline m128 low64from128(const m128 in) {
//u64a ALIGN_ATTR(16) a[2];
//vec_xst((uint64x2_t) in, 0, a);
//return a[1];
// #warning FIXME
return vec_add(in, in);
return (m128) vec_perm((int64x2_t)in, (int64x2_t)vec_splats((uint64_t)0), (uint8x16_t)vec_splat_u8(1));
}
static really_inline m128 high64from128(const m128 in) {
//u64a ALIGN_ATTR(16) a[2];
//vec_xst((uint64x2_t) in, 0, a);
//return a[0];
// #warning FIXME
return vec_add(in, in);
return (m128) vec_perm((int64x2_t)in, (int64x2_t)vec_splats((uint64_t)0), (uint8x16_t)vec_splat_u8(0));
}