(PS3/Altivec) Fix some altivec_mem compiler warnings

This commit is contained in:
twinaphex 2013-09-27 18:38:20 +02:00
parent 9964856cce
commit a9d4af4f70
2 changed files with 11 additions and 35 deletions

View File

@ -213,6 +213,14 @@ void *vec_memset(void *s, int p, size_t len)
ptr = (uint8_t *)ptr_w;
}
// Handle the remaining bytes
memset_rest_bytes(ptr, P, len);
switch(len)
{
case 3:
*ptr++ = P;
case 2:
*ptr++ = P;
case 1:
*ptr++ = P;
}
return s;
}

View File

@ -225,24 +225,7 @@ static inline void memset_fwd_until_simd_aligned(word_t *ptr_w, word_t w, size_t
}
}
static inline void memset_rest_words(word_t *ptr_w, word_t w, size_t l)
{
while (l--)
*ptr_w++ = w;
}
static inline int memset_rest_bytes(uint8_t *ptr, uint8_t c, size_t len)
{
switch(len)
{
case 3:
*ptr++ = c;
case 2:
*ptr++ = c;
case 1:
*ptr++ = c;
}
}
#else
#define word_t uint32_t
@ -357,29 +340,14 @@ static inline void memset_fwd_until_simd_aligned(word_t *ptr_w, word_t w, size_t
*ptr_w++ = w;
}
}
#endif
static inline void memset_rest_words(word_t *ptr_w, word_t w, size_t l)
{
while (l--)
{
while (l--)
*ptr_w++ = w;
}
}
static inline int memset_rest_bytes(uint8_t *ptr, uint8_t c, size_t len)
{
switch(len)
{
case 3:
*ptr++ = c;
case 2:
*ptr++ = c;
case 1:
*ptr++ = c;
}
}
#endif
static inline void copy_fwd_rest_blocks_aligned(word_t *d, const uint8_t *s, size_t blocks)
{
__vector unsigned char v1, v2, v3, v4;