PPC: remove unnecessary alignment on local variables

Storing a single element from a vector where all elements have the same
value does not require an aligned destination.  Which element is stored
depends on the alignment of the destination address, but since they all
have the same value, the result is the same regardless of the alignment.

Originally committed as revision 19696 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Måns Rullgård 16 years ago
parent ce78113d5a
commit afe08a728a
  1. 18
      libavcodec/ppc/dsputil_altivec.c
  2. 2
      libavcodec/ppc/int_altivec.c

@ -32,7 +32,7 @@
int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
vector unsigned char *tv; vector unsigned char *tv;
vector unsigned char pix1v, pix2v, pix2iv, avgv, t5; vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;
@ -77,7 +77,7 @@ int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h
int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
vector unsigned char *tv; vector unsigned char *tv;
vector unsigned char pix1v, pix2v, pix3v, avgv, t5; vector unsigned char pix1v, pix2v, pix3v, avgv, t5;
@ -133,7 +133,7 @@ int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h
int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
uint8_t *pix3 = pix2 + line_size; uint8_t *pix3 = pix2 + line_size;
const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
const vector unsigned short two = (const vector unsigned short)vec_splat_u16(2); const vector unsigned short two = (const vector unsigned short)vec_splat_u16(2);
@ -228,7 +228,7 @@ int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int
int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, *pix1v, *pix2v; vector unsigned char perm1, perm2, *pix1v, *pix2v;
vector unsigned char t1, t2, t3,t4, t5; vector unsigned char t1, t2, t3,t4, t5;
@ -270,7 +270,7 @@ int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v; vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
vector unsigned char t1, t2, t3,t4, t5; vector unsigned char t1, t2, t3,t4, t5;
@ -315,7 +315,7 @@ int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
int pix_norm1_altivec(uint8_t *pix, int line_size) int pix_norm1_altivec(uint8_t *pix, int line_size)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char *tv; vector unsigned char *tv;
vector unsigned char pixv; vector unsigned char pixv;
@ -351,7 +351,7 @@ int pix_norm1_altivec(uint8_t *pix, int line_size)
int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v; vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
vector unsigned char t1, t2, t3,t4, t5; vector unsigned char t1, t2, t3,t4, t5;
@ -405,7 +405,7 @@ int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{ {
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, *pix1v, *pix2v; vector unsigned char perm1, perm2, *pix1v, *pix2v;
vector unsigned char t1, t2, t3,t4, t5; vector unsigned char t1, t2, t3,t4, t5;
@ -455,7 +455,7 @@ int pix_sum_altivec(uint8_t * pix, int line_size)
vector signed int sumdiffs; vector signed int sumdiffs;
int i; int i;
DECLARE_ALIGNED_16(int, s); int s;
sad = (vector unsigned int)vec_splat_u32(0); sad = (vector unsigned int)vec_splat_u32(0);

@ -114,7 +114,7 @@ static int32_t scalarproduct_int16_altivec(int16_t * v1, int16_t * v2, int order
register vec_s16 vec1, *pv; register vec_s16 vec1, *pv;
register vec_s32 res = vec_splat_s32(0), t; register vec_s32 res = vec_splat_s32(0), t;
register vec_u32 shifts; register vec_u32 shifts;
DECLARE_ALIGNED_16(int32_t, ires); int32_t ires;
shifts = zero_u32v; shifts = zero_u32v;
if(shift & 0x10) shifts = vec_add(shifts, vec_sl(vec_splat_u32(0x08), vec_splat_u32(0x1))); if(shift & 0x10) shifts = vec_add(shifts, vec_sl(vec_splat_u32(0x08), vec_splat_u32(0x1)));

Loading…
Cancel
Save