MIPS: fix functions to use generic BPS istead of hardcoded value

Change-Id: I2d68abef886eff7f8df230f155b758dccd7d04fd
This commit is contained in:
Djordje Pesut
2014-12-04 16:20:29 +01:00
parent 9475bef4d7
commit 37e395fd1c
5 changed files with 259 additions and 237 deletions

View File

@@ -12,6 +12,9 @@
#ifndef WEBP_DSP_MIPS_MACRO_H_
#define WEBP_DSP_MIPS_MACRO_H_
#define STR(s) #s
#define XSTR(s) STR(s)
// O0[31..16 | 15..0] = I0[31..16 | 15..0] + I1[31..16 | 15..0]
// O1[31..16 | 15..0] = I0[31..16 | 15..0] - I1[31..16 | 15..0]
// O - output
@@ -30,13 +33,13 @@
"lh %["#O1"], "#I1"(%[in]) \n\t"
// I0 - location
// I1..I4 - offsets in bytes
// I1..I9 - offsets in bytes
#define LOAD_WITH_OFFSET_X4(O0, O1, O2, O3, \
I0, I1, I2, I3, I4) \
"ulw %["#O0"], "#I1"(%["#I0"]) \n\t" \
"ulw %["#O1"], "#I2"(%["#I0"]) \n\t" \
"ulw %["#O2"], "#I3"(%["#I0"]) \n\t" \
"ulw %["#O3"], "#I4"(%["#I0"]) \n\t"
I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) \
"ulw %["#O0"], "#I1"+"XSTR(I9)"*"#I5"(%["#I0"]) \n\t" \
"ulw %["#O1"], "#I2"+"XSTR(I9)"*"#I6"(%["#I0"]) \n\t" \
"ulw %["#O2"], "#I3"+"XSTR(I9)"*"#I7"(%["#I0"]) \n\t" \
"ulw %["#O3"], "#I4"+"XSTR(I9)"*"#I8"(%["#I0"]) \n\t"
// O - output
// IO - input/output
@@ -152,7 +155,7 @@
// I - input (macro doesn't change it)
#define STORE_SAT_SUM_X2(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7, \
I0, I1, I2, I3, I4, I5, I6, I7, \
I8, I9, I10, I11, I12) \
I8, I9, I10, I11, I12, I13) \
"addq.ph %["#IO0"], %["#IO0"], %["#I0"] \n\t" \
"addq.ph %["#IO1"], %["#IO1"], %["#I1"] \n\t" \
"addq.ph %["#IO2"], %["#IO2"], %["#I2"] \n\t" \
@@ -173,10 +176,10 @@
"precrqu_s.qb.ph %["#IO2"], %["#IO3"], %["#IO2"] \n\t" \
"precrqu_s.qb.ph %["#IO4"], %["#IO5"], %["#IO4"] \n\t" \
"precrqu_s.qb.ph %["#IO6"], %["#IO7"], %["#IO6"] \n\t" \
"usw %["#IO0"], "#I9"(%["#I8"]) \n\t" \
"usw %["#IO2"], "#I10"(%["#I8"]) \n\t" \
"usw %["#IO4"], "#I11"(%["#I8"]) \n\t" \
"usw %["#IO6"], "#I12"(%["#I8"]) \n\t"
"usw %["#IO0"], "XSTR(I13)"*"#I9"(%["#I8"]) \n\t" \
"usw %["#IO2"], "XSTR(I13)"*"#I10"(%["#I8"]) \n\t" \
"usw %["#IO4"], "XSTR(I13)"*"#I11"(%["#I8"]) \n\t" \
"usw %["#IO6"], "XSTR(I13)"*"#I12"(%["#I8"]) \n\t"
#define OUTPUT_EARLY_CLOBBER_REGS_10() \
: [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), \