mips: port optimizations to mips n64

This mainly consists of replacing all the pointer arithmatic 'addiu'
instructions with PTR_ADDIU which will handle the differences in pointer
sizes when compiled on 64 bit mips systems.

The header asmdefs.h contains the PTR_ macros which expend to the correct mips
instructions to manipulate registers containing pointers.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
James Cowgill
2015-03-05 17:40:15 +00:00
committed by Michael Niedermayer
parent eae13eae9d
commit 157d6f0d5b
20 changed files with 247 additions and 178 deletions

View File

@@ -53,6 +53,7 @@
*/
#include "config.h"
#include "libavcodec/celp_math.h"
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
static float ff_dot_productf_mips(const float* a, const float* b,
@@ -67,8 +68,8 @@ static float ff_dot_productf_mips(const float* a, const float* b,
"ff_dot_productf_madd%=: \n\t"
"lwc1 $f2, 0(%[a]) \n\t"
"lwc1 $f1, 0(%[b]) \n\t"
"addiu %[a], %[a], 4 \n\t"
"addiu %[b], %[b], 4 \n\t"
PTR_ADDIU "%[a], %[a], 4 \n\t"
PTR_ADDIU "%[b], %[b], 4 \n\t"
"madd.s %[sum], %[sum], $f1, $f2 \n\t"
"bne %[a], %[a_end], ff_dot_productf_madd%= \n\t"
"ff_dot_productf_end%=: \n\t"