aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mips/mpegaudiodsp_mips_float.c
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2015-03-05 17:40:15 +0000
committerMichael Niedermayer <michaelni@gmx.at>2015-03-06 14:37:44 +0100
commit157d6f0d5b95261bf053566d8a1c2652387da30c (patch)
treeca481834165a1f3c103eea9dc50fd5e877bbcbde /libavcodec/mips/mpegaudiodsp_mips_float.c
parenteae13eae9d6499e81cd77bcd9e13f7bcb31b5577 (diff)
downloadffmpeg-157d6f0d5b95261bf053566d8a1c2652387da30c.tar.gz
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>
Diffstat (limited to 'libavcodec/mips/mpegaudiodsp_mips_float.c')
-rw-r--r--libavcodec/mips/mpegaudiodsp_mips_float.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libavcodec/mips/mpegaudiodsp_mips_float.c b/libavcodec/mips/mpegaudiodsp_mips_float.c
index beb8e782f2..bd36894d31 100644
--- a/libavcodec/mips/mpegaudiodsp_mips_float.c
+++ b/libavcodec/mips/mpegaudiodsp_mips_float.c
@@ -55,6 +55,7 @@
#include <string.h>
+#include "libavutil/mips/asmdefs.h"
#include "libavcodec/mpegaudiodsp.h"
static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
@@ -89,7 +90,7 @@ static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
"sw $zero, 0(%[dither_state]) \t\n"
"lwc1 %[in3], 64*4(%[window]) \t\n"
"lwc1 %[in4], 80*4(%[synth_buf]) \t\n"
- "addu %[samples2], %[samples], %[t_sample] \t\n"
+ PTR_ADDU "%[samples2],%[samples], %[t_sample] \t\n"
"madd.s %[sum], %[sum], %[in1], %[in2] \t\n"
"lwc1 %[in5], 128*4(%[window]) \t\n"
"lwc1 %[in6], 144*4(%[synth_buf]) \t\n"
@@ -131,15 +132,15 @@ static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
"lwc1 %[in7], 480*4(%[window]) \t\n"
"lwc1 %[in8], 496*4(%[synth_buf]) \t\n"
"nmsub.s %[sum], %[sum], %[in1], %[in2] \t\n"
- "addu %[w], %[window], 4 \t\n"
+ PTR_ADDU "%[w], %[window], 4 \t\n"
"nmsub.s %[sum], %[sum], %[in3], %[in4] \t\n"
- "addu %[w2], %[window], 124 \t\n"
- "addiu %[p], %[synth_buf], 68 \t\n"
- "addiu %[p2], %[synth_buf], 188 \t\n"
+ PTR_ADDU "%[w2], %[window], 124 \t\n"
+ PTR_ADDIU "%[p], %[synth_buf], 68 \t\n"
+ PTR_ADDIU "%[p2], %[synth_buf], 188 \t\n"
"nmsub.s %[sum], %[sum], %[in5], %[in6] \t\n"
"nmsub.s %[sum], %[sum], %[in7], %[in8] \t\n"
"swc1 %[sum], 0(%[samples]) \t\n"
- "addu %[samples], %[samples], %[incr1] \t\n"
+ PTR_ADDU "%[samples], %[samples], %[incr1] \t\n"
/* calculate two samples at the same time to avoid one memory
access per two sample */
@@ -223,17 +224,17 @@ static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
"nmsub.s %[sum], %[sum], %[in1], %[in2] \t\n"
"lwc1 %[in6], 480*4(%[w2]) \t\n"
"nmsub.s %[sum2], %[sum2], %[in2], %[in3] \t\n"
- "addiu %[w], %[w], 4 \t\n"
+ PTR_ADDIU "%[w], %[w], 4 \t\n"
"nmsub.s %[sum], %[sum], %[in4], %[in5] \t\n"
- "addiu %[w2], %[w2], -4 \t\n"
+ PTR_ADDIU "%[w2], %[w2], -4 \t\n"
"nmsub.s %[sum2], %[sum2], %[in5], %[in6] \t\n"
"addu %[j], %[j], 4 \t\n"
- "addiu %[p], 4 \t\n"
+ PTR_ADDIU "%[p], 4 \t\n"
"swc1 %[sum], 0(%[samples]) \t\n"
- "addiu %[p2], -4 \t\n"
+ PTR_ADDIU "%[p2], -4 \t\n"
"swc1 %[sum2], 0(%[samples2]) \t\n"
- "addu %[samples], %[samples], %[incr1] \t\n"
- "subu %[samples2], %[samples2], %[incr1] \t\n"
+ PTR_ADDU "%[samples], %[samples], %[incr1] \t\n"
+ PTR_SUBU "%[samples2],%[samples2], %[incr1] \t\n"
"bne %[j], 64, ff_mpadsp_apply_window_loop%= \t\n"
"lwc1 %[in1], 48*4(%[window]) \t\n"