neon: add INIT_VECTOR2

used to initialize NxMx2 vector types
replaces initialization via '{{ }}' gnu-ism.

Change-Id: I4accc305c7dd4c886b63c22e38890b629bffb139
This commit is contained in:
James Zern 2014-06-29 13:40:45 -07:00
parent 4536e7c49c
commit dc7687e51b
4 changed files with 13 additions and 4 deletions

View File

@ -1014,7 +1014,8 @@ static WEBP_INLINE void TransformPass(int16x8x2_t* const rows) {
}
static void TransformOne(const int16_t* in, uint8_t* dst) {
int16x8x2_t rows = {{ vld1q_s16(in + 0), vld1q_s16(in + 8) }};
int16x8x2_t rows;
INIT_VECTOR2(rows, vld1q_s16(in + 0), vld1q_s16(in + 8));
TransformPass(&rows);
TransformPass(&rows);
Add4x4(rows.val[0], rows.val[1], dst);

View File

@ -118,7 +118,8 @@ static WEBP_INLINE void TransformPass(int16x8x2_t* const rows) {
static void ITransformOne(const uint8_t* ref,
const int16_t* in, uint8_t* dst) {
int16x8x2_t rows = {{ vld1q_s16(in + 0), vld1q_s16(in + 8) }};
int16x8x2_t rows;
INIT_VECTOR2(rows, vld1q_s16(in + 0), vld1q_s16(in + 8));
TransformPass(&rows);
TransformPass(&rows);
Add4x4(rows.val[0], rows.val[1], ref, dst);

View File

@ -22,6 +22,11 @@
#define USE_INTRINSICS // use intrinsics when possible
#endif
#define INIT_VECTOR2(v, a, b) do { \
v.val[0] = a; \
v.val[1] = b; \
} while (0)
// if using intrinsics, this flag avoids some functions that make gcc-4.6.3
// crash ("internal compiler error: in immed_double_const, at emit-rtl.").
// (probably similar to gcc.gnu.org/bugzilla/show_bug.cgi?id=48183)

View File

@ -19,6 +19,7 @@
#include <assert.h>
#include <arm_neon.h>
#include <string.h>
#include "./neon.h"
#include "./yuv.h"
#ifdef FANCY_UPSAMPLING
@ -61,8 +62,9 @@
d = vrhadd_u8(d, diag1); \
\
{ \
const uint8x8x2_t a_b = {{ a, b }}; \
const uint8x8x2_t c_d = {{ c, d }}; \
uint8x8x2_t a_b, c_d; \
INIT_VECTOR2(a_b, a, b); \
INIT_VECTOR2(c_d, c, d); \
vst2_u8(out, a_b); \
vst2_u8(out + 32, c_d); \
} \