gnu: gnucash: Disable the stress-options-test using a phase.
[jackhill/guix/guix.git] / gnu / packages / patches / freeimage-fix-build-with-gcc-5.patch
1 The original patch was downloaded from here:
2 https://chromium-review.googlesource.com/c/297211
3
4 The paths, file names, and line endings have been adapted.
5
6 From eebaf97f5a1cb713d81d311308d8a48c124e5aef Mon Sep 17 00:00:00 2001
7 From: James Zern <jzern@google.com>
8 Date: Wed, 02 Sep 2015 23:21:13 -0700
9 Subject: [PATCH] dsp/mips: add whitespace around stringizing operator
10
11 fixes compile with gcc 5.1
12 BUG=259
13
14 Change-Id: Ideb39c6290ab8569b1b6cc835bea11c822d0286c
15 ---
16
17 diff --git a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
18 index 6590f43..40e4d82 100644
19 --- a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
20 +++ b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
21 @@ -548,10 +548,10 @@
22 // TEMP3 = SRC[D + D1 * BPS]
23 #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \
24 A, A1, B, B1, C, C1, D, D1, SRC) \
25 - "lbu %["#TEMP0"], "#A"+"#A1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
26 - "lbu %["#TEMP1"], "#B"+"#B1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
27 - "lbu %["#TEMP2"], "#C"+"#C1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
28 - "lbu %["#TEMP3"], "#D"+"#D1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
29 + "lbu %[" #TEMP0 "], " #A "+" #A1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
30 + "lbu %[" #TEMP1 "], " #B "+" #B1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
31 + "lbu %[" #TEMP2 "], " #C "+" #C1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
32 + "lbu %[" #TEMP3 "], " #D "+" #D1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
33
34 static void SimpleHFilter16(uint8_t* p, int stride, int thresh) {
35 int i;
36 @@ -623,8 +623,8 @@
37 // DST[A * BPS] = TEMP0
38 // DST[B + C * BPS] = TEMP1
39 #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \
40 - "usw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#DST"]) \n\t" \
41 - "usw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#DST"]) \n\t"
42 + "usw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #DST "]) \n\t" \
43 + "usw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #DST "]) \n\t"
44
45 static void VE4(uint8_t* dst) { // vertical
46 const uint8_t* top = dst - BPS;
47 @@ -725,8 +725,8 @@
48 // TEMP0 = SRC[A * BPS]
49 // TEMP1 = SRC[B + C * BPS]
50 #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \
51 - "ulw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
52 - "ulw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#SRC"]) \n\t"
53 + "ulw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
54 + "ulw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #SRC "]) \n\t"
55
56 static void LD4(uint8_t* dst) { // Down-Left
57 int temp0, temp1, temp2, temp3, temp4;
58 @@ -873,24 +873,24 @@
59 #define CLIPPING(SIZE) \
60 "preceu.ph.qbl %[temp2], %[temp0] \n\t" \
61 "preceu.ph.qbr %[temp0], %[temp0] \n\t" \
62 -".if "#SIZE" == 8 \n\t" \
63 +".if " #SIZE " == 8 \n\t" \
64 "preceu.ph.qbl %[temp3], %[temp1] \n\t" \
65 "preceu.ph.qbr %[temp1], %[temp1] \n\t" \
66 ".endif \n\t" \
67 "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \
68 "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \
69 -".if "#SIZE" == 8 \n\t" \
70 +".if " #SIZE " == 8 \n\t" \
71 "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \
72 "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \
73 ".endif \n\t" \
74 "shll_s.ph %[temp2], %[temp2], 7 \n\t" \
75 "shll_s.ph %[temp0], %[temp0], 7 \n\t" \
76 -".if "#SIZE" == 8 \n\t" \
77 +".if " #SIZE " == 8 \n\t" \
78 "shll_s.ph %[temp3], %[temp3], 7 \n\t" \
79 "shll_s.ph %[temp1], %[temp1], 7 \n\t" \
80 ".endif \n\t" \
81 "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \
82 -".if "#SIZE" == 8 \n\t" \
83 +".if " #SIZE " == 8 \n\t" \
84 "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \
85 ".endif \n\t"
86
87 @@ -899,7 +899,7 @@
88 int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \
89 int temp0, temp1, temp2, temp3; \
90 __asm__ volatile ( \
91 - ".if "#SIZE" < 8 \n\t" \
92 + ".if " #SIZE " < 8 \n\t" \
93 "ulw %[temp0], 0(%[top]) \n\t" \
94 "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \
95 CLIPPING(4) \
96 @@ -911,7 +911,7 @@
97 CLIPPING(8) \
98 "usw %[temp0], 0(%[dst]) \n\t" \
99 "usw %[temp1], 4(%[dst]) \n\t" \
100 - ".if "#SIZE" == 16 \n\t" \
101 + ".if " #SIZE " == 16 \n\t" \
102 "ulw %[temp0], 8(%[top]) \n\t" \
103 "ulw %[temp1], 12(%[top]) \n\t" \
104 CLIPPING(8) \
105 diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips32.c b/Source/LibWebP/src/dsp/dsp.enc_mips32.c
106 index c5837f1..b50e08b 100644
107 --- a/Source/LibWebP/src/dsp/dsp.enc_mips32.c
108 +++ b/Source/LibWebP/src/dsp/dsp.enc_mips32.c
109 @@ -31,26 +31,26 @@
110 // TEMP0..TEMP3 - registers for corresponding tmp elements
111 // TEMP4..TEMP5 - temporary registers
112 #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \
113 - "lh %[temp16], "#A"(%[temp20]) \n\t" \
114 - "lh %[temp18], "#B"(%[temp20]) \n\t" \
115 - "lh %[temp17], "#C"(%[temp20]) \n\t" \
116 - "lh %[temp19], "#D"(%[temp20]) \n\t" \
117 - "addu %["#TEMP4"], %[temp16], %[temp18] \n\t" \
118 - "subu %[temp16], %[temp16], %[temp18] \n\t" \
119 - "mul %["#TEMP0"], %[temp17], %[kC2] \n\t" \
120 - "mul %[temp18], %[temp19], %[kC1] \n\t" \
121 - "mul %[temp17], %[temp17], %[kC1] \n\t" \
122 - "mul %[temp19], %[temp19], %[kC2] \n\t" \
123 - "sra %["#TEMP0"], %["#TEMP0"], 16 \n\n" \
124 - "sra %[temp18], %[temp18], 16 \n\n" \
125 - "sra %[temp17], %[temp17], 16 \n\n" \
126 - "sra %[temp19], %[temp19], 16 \n\n" \
127 - "subu %["#TEMP2"], %["#TEMP0"], %[temp18] \n\t" \
128 - "addu %["#TEMP3"], %[temp17], %[temp19] \n\t" \
129 - "addu %["#TEMP0"], %["#TEMP4"], %["#TEMP3"] \n\t" \
130 - "addu %["#TEMP1"], %[temp16], %["#TEMP2"] \n\t" \
131 - "subu %["#TEMP2"], %[temp16], %["#TEMP2"] \n\t" \
132 - "subu %["#TEMP3"], %["#TEMP4"], %["#TEMP3"] \n\t"
133 + "lh %[temp16], " #A "(%[temp20]) \n\t" \
134 + "lh %[temp18], " #B "(%[temp20]) \n\t" \
135 + "lh %[temp17], " #C "(%[temp20]) \n\t" \
136 + "lh %[temp19], " #D "(%[temp20]) \n\t" \
137 + "addu %[" #TEMP4 "], %[temp16], %[temp18] \n\t" \
138 + "subu %[temp16], %[temp16], %[temp18] \n\t" \
139 + "mul %[" #TEMP0 "], %[temp17], %[kC2] \n\t" \
140 + "mul %[temp18], %[temp19], %[kC1] \n\t" \
141 + "mul %[temp17], %[temp17], %[kC1] \n\t" \
142 + "mul %[temp19], %[temp19], %[kC2] \n\t" \
143 + "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\n" \
144 + "sra %[temp18], %[temp18], 16 \n\n" \
145 + "sra %[temp17], %[temp17], 16 \n\n" \
146 + "sra %[temp19], %[temp19], 16 \n\n" \
147 + "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp18] \n\t" \
148 + "addu %[" #TEMP3 "], %[temp17], %[temp19] \n\t" \
149 + "addu %[" #TEMP0 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" \
150 + "addu %[" #TEMP1 "], %[temp16], %[" #TEMP2 "] \n\t" \
151 + "subu %[" #TEMP2 "], %[temp16], %[" #TEMP2 "] \n\t" \
152 + "subu %[" #TEMP3 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t"
153
154 // macro for one horizontal pass in ITransformOne
155 // MUL and STORE macros inlined
156 @@ -58,59 +58,59 @@
157 // temp0..temp15 holds tmp[0]..tmp[15]
158 // A - offset in bytes to load from ref and store to dst buffer
159 // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
160 -#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \
161 - "addiu %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
162 - "addu %[temp16], %["#TEMP0"], %["#TEMP8"] \n\t" \
163 - "subu %[temp17], %["#TEMP0"], %["#TEMP8"] \n\t" \
164 - "mul %["#TEMP0"], %["#TEMP4"], %[kC2] \n\t" \
165 - "mul %["#TEMP8"], %["#TEMP12"], %[kC1] \n\t" \
166 - "mul %["#TEMP4"], %["#TEMP4"], %[kC1] \n\t" \
167 - "mul %["#TEMP12"], %["#TEMP12"], %[kC2] \n\t" \
168 - "sra %["#TEMP0"], %["#TEMP0"], 16 \n\t" \
169 - "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
170 - "sra %["#TEMP4"], %["#TEMP4"], 16 \n\t" \
171 - "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
172 - "subu %[temp18], %["#TEMP0"], %["#TEMP8"] \n\t" \
173 - "addu %[temp19], %["#TEMP4"], %["#TEMP12"] \n\t" \
174 - "addu %["#TEMP0"], %[temp16], %[temp19] \n\t" \
175 - "addu %["#TEMP4"], %[temp17], %[temp18] \n\t" \
176 - "subu %["#TEMP8"], %[temp17], %[temp18] \n\t" \
177 - "subu %["#TEMP12"], %[temp16], %[temp19] \n\t" \
178 - "lw %[temp20], 0(%[args]) \n\t" \
179 - "sra %["#TEMP0"], %["#TEMP0"], 3 \n\t" \
180 - "sra %["#TEMP4"], %["#TEMP4"], 3 \n\t" \
181 - "sra %["#TEMP8"], %["#TEMP8"], 3 \n\t" \
182 - "sra %["#TEMP12"], %["#TEMP12"], 3 \n\t" \
183 - "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
184 - "lbu %[temp17], 1+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
185 - "lbu %[temp18], 2+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
186 - "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
187 - "addu %["#TEMP0"], %[temp16], %["#TEMP0"] \n\t" \
188 - "addu %["#TEMP4"], %[temp17], %["#TEMP4"] \n\t" \
189 - "addu %["#TEMP8"], %[temp18], %["#TEMP8"] \n\t" \
190 - "addu %["#TEMP12"], %[temp19], %["#TEMP12"] \n\t" \
191 - "slt %[temp16], %["#TEMP0"], $zero \n\t" \
192 - "slt %[temp17], %["#TEMP4"], $zero \n\t" \
193 - "slt %[temp18], %["#TEMP8"], $zero \n\t" \
194 - "slt %[temp19], %["#TEMP12"], $zero \n\t" \
195 - "movn %["#TEMP0"], $zero, %[temp16] \n\t" \
196 - "movn %["#TEMP4"], $zero, %[temp17] \n\t" \
197 - "movn %["#TEMP8"], $zero, %[temp18] \n\t" \
198 - "movn %["#TEMP12"], $zero, %[temp19] \n\t" \
199 - "addiu %[temp20], $zero, 255 \n\t" \
200 - "slt %[temp16], %["#TEMP0"], %[temp20] \n\t" \
201 - "slt %[temp17], %["#TEMP4"], %[temp20] \n\t" \
202 - "slt %[temp18], %["#TEMP8"], %[temp20] \n\t" \
203 - "slt %[temp19], %["#TEMP12"], %[temp20] \n\t" \
204 - "movz %["#TEMP0"], %[temp20], %[temp16] \n\t" \
205 - "movz %["#TEMP4"], %[temp20], %[temp17] \n\t" \
206 - "lw %[temp16], 8(%[args]) \n\t" \
207 - "movz %["#TEMP8"], %[temp20], %[temp18] \n\t" \
208 - "movz %["#TEMP12"], %[temp20], %[temp19] \n\t" \
209 - "sb %["#TEMP0"], 0+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
210 - "sb %["#TEMP4"], 1+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
211 - "sb %["#TEMP8"], 2+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
212 - "sb %["#TEMP12"], 3+"XSTR(BPS)"*"#A"(%[temp16]) \n\t"
213 +#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \
214 + "addiu %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
215 + "addu %[temp16], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
216 + "subu %[temp17], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
217 + "mul %[" #TEMP0 "], %[" #TEMP4 "], %[kC2] \n\t" \
218 + "mul %[" #TEMP8 "], %[" #TEMP12 "], %[kC1] \n\t" \
219 + "mul %[" #TEMP4 "], %[" #TEMP4 "], %[kC1] \n\t" \
220 + "mul %[" #TEMP12 "], %[" #TEMP12 "], %[kC2] \n\t" \
221 + "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \
222 + "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
223 + "sra %[" #TEMP4 "], %[" #TEMP4 "], 16 \n\t" \
224 + "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
225 + "subu %[temp18], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
226 + "addu %[temp19], %[" #TEMP4 "], %[" #TEMP12 "] \n\t" \
227 + "addu %[" #TEMP0 "], %[temp16], %[temp19] \n\t" \
228 + "addu %[" #TEMP4 "], %[temp17], %[temp18] \n\t" \
229 + "subu %[" #TEMP8 "], %[temp17], %[temp18] \n\t" \
230 + "subu %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
231 + "lw %[temp20], 0(%[args]) \n\t" \
232 + "sra %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \
233 + "sra %[" #TEMP4 "], %[" #TEMP4 "], 3 \n\t" \
234 + "sra %[" #TEMP8 "], %[" #TEMP8 "], 3 \n\t" \
235 + "sra %[" #TEMP12 "], %[" #TEMP12 "], 3 \n\t" \
236 + "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
237 + "lbu %[temp17], 1+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
238 + "lbu %[temp18], 2+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
239 + "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
240 + "addu %[" #TEMP0 "], %[temp16], %[" #TEMP0 "] \n\t" \
241 + "addu %[" #TEMP4 "], %[temp17], %[" #TEMP4 "] \n\t" \
242 + "addu %[" #TEMP8 "], %[temp18], %[" #TEMP8 "] \n\t" \
243 + "addu %[" #TEMP12 "], %[temp19], %[" #TEMP12 "] \n\t" \
244 + "slt %[temp16], %[" #TEMP0 "], $zero \n\t" \
245 + "slt %[temp17], %[" #TEMP4 "], $zero \n\t" \
246 + "slt %[temp18], %[" #TEMP8 "], $zero \n\t" \
247 + "slt %[temp19], %[" #TEMP12 "], $zero \n\t" \
248 + "movn %[" #TEMP0 "], $zero, %[temp16] \n\t" \
249 + "movn %[" #TEMP4 "], $zero, %[temp17] \n\t" \
250 + "movn %[" #TEMP8 "], $zero, %[temp18] \n\t" \
251 + "movn %[" #TEMP12 "], $zero, %[temp19] \n\t" \
252 + "addiu %[temp20], $zero, 255 \n\t" \
253 + "slt %[temp16], %[" #TEMP0 "], %[temp20] \n\t" \
254 + "slt %[temp17], %[" #TEMP4 "], %[temp20] \n\t" \
255 + "slt %[temp18], %[" #TEMP8 "], %[temp20] \n\t" \
256 + "slt %[temp19], %[" #TEMP12 "], %[temp20] \n\t" \
257 + "movz %[" #TEMP0 "], %[temp20], %[temp16] \n\t" \
258 + "movz %[" #TEMP4 "], %[temp20], %[temp17] \n\t" \
259 + "lw %[temp16], 8(%[args]) \n\t" \
260 + "movz %[" #TEMP8 "], %[temp20], %[temp18] \n\t" \
261 + "movz %[" #TEMP12 "], %[temp20], %[temp19] \n\t" \
262 + "sb %[" #TEMP0 "], 0+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
263 + "sb %[" #TEMP4 "], 1+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
264 + "sb %[" #TEMP8 "], 2+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
265 + "sb %[" #TEMP12 "], 3+"XSTR(BPS)"*" #A "(%[temp16]) \n\t"
266
267 // Does one or two inverse transforms.
268 static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in,
269 @@ -161,9 +161,9 @@
270 // K - offset in bytes (kZigzag[n] * 4)
271 // N - offset in bytes (n * 2)
272 #define QUANTIZE_ONE(J, K, N) \
273 - "lh %[temp0], "#J"(%[ppin]) \n\t" \
274 - "lhu %[temp1], "#J"(%[ppsharpen]) \n\t" \
275 - "lw %[temp2], "#K"(%[ppzthresh]) \n\t" \
276 + "lh %[temp0], " #J "(%[ppin]) \n\t" \
277 + "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \
278 + "lw %[temp2], " #K "(%[ppzthresh]) \n\t" \
279 "sra %[sign], %[temp0], 15 \n\t" \
280 "xor %[coeff], %[temp0], %[sign] \n\t" \
281 "subu %[coeff], %[coeff], %[sign] \n\t" \
282 @@ -172,9 +172,9 @@
283 "addiu %[temp5], $zero, 0 \n\t" \
284 "addiu %[level], $zero, 0 \n\t" \
285 "beqz %[temp4], 2f \n\t" \
286 - "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
287 - "lw %[temp2], "#K"(%[ppbias]) \n\t" \
288 - "lhu %[temp3], "#J"(%[ppq]) \n\t" \
289 + "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
290 + "lw %[temp2], " #K "(%[ppbias]) \n\t" \
291 + "lhu %[temp3], " #J "(%[ppq]) \n\t" \
292 "mul %[level], %[coeff], %[temp1] \n\t" \
293 "addu %[level], %[level], %[temp2] \n\t" \
294 "sra %[level], %[level], 17 \n\t" \
295 @@ -184,8 +184,8 @@
296 "subu %[level], %[level], %[sign] \n\t" \
297 "mul %[temp5], %[level], %[temp3] \n\t" \
298 "2: \n\t" \
299 - "sh %[temp5], "#J"(%[ppin]) \n\t" \
300 - "sh %[level], "#N"(%[pout]) \n\t"
301 + "sh %[temp5], " #J "(%[ppin]) \n\t" \
302 + "sh %[level], " #N "(%[pout]) \n\t"
303
304 static int QuantizeBlock(int16_t in[16], int16_t out[16],
305 const VP8Matrix* const mtx) {
306 @@ -253,39 +253,39 @@
307 // A - offset in bytes to load from a and b buffers
308 // E..H - offsets in bytes to store first results to tmp buffer
309 // E1..H1 - offsets in bytes to store second results to tmp buffer
310 -#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \
311 - "lbu %[temp0], 0+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
312 - "lbu %[temp1], 1+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
313 - "lbu %[temp2], 2+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
314 - "lbu %[temp3], 3+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
315 - "lbu %[temp4], 0+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
316 - "lbu %[temp5], 1+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
317 - "lbu %[temp6], 2+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
318 - "lbu %[temp7], 3+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
319 - "addu %[temp8], %[temp0], %[temp2] \n\t" \
320 - "subu %[temp0], %[temp0], %[temp2] \n\t" \
321 - "addu %[temp2], %[temp1], %[temp3] \n\t" \
322 - "subu %[temp1], %[temp1], %[temp3] \n\t" \
323 - "addu %[temp3], %[temp4], %[temp6] \n\t" \
324 - "subu %[temp4], %[temp4], %[temp6] \n\t" \
325 - "addu %[temp6], %[temp5], %[temp7] \n\t" \
326 - "subu %[temp5], %[temp5], %[temp7] \n\t" \
327 - "addu %[temp7], %[temp8], %[temp2] \n\t" \
328 - "subu %[temp2], %[temp8], %[temp2] \n\t" \
329 - "addu %[temp8], %[temp0], %[temp1] \n\t" \
330 - "subu %[temp0], %[temp0], %[temp1] \n\t" \
331 - "addu %[temp1], %[temp3], %[temp6] \n\t" \
332 - "subu %[temp3], %[temp3], %[temp6] \n\t" \
333 - "addu %[temp6], %[temp4], %[temp5] \n\t" \
334 - "subu %[temp4], %[temp4], %[temp5] \n\t" \
335 - "sw %[temp7], "#E"(%[tmp]) \n\t" \
336 - "sw %[temp2], "#H"(%[tmp]) \n\t" \
337 - "sw %[temp8], "#F"(%[tmp]) \n\t" \
338 - "sw %[temp0], "#G"(%[tmp]) \n\t" \
339 - "sw %[temp1], "#E1"(%[tmp]) \n\t" \
340 - "sw %[temp3], "#H1"(%[tmp]) \n\t" \
341 - "sw %[temp6], "#F1"(%[tmp]) \n\t" \
342 - "sw %[temp4], "#G1"(%[tmp]) \n\t"
343 +#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \
344 + "lbu %[temp0], 0+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
345 + "lbu %[temp1], 1+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
346 + "lbu %[temp2], 2+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
347 + "lbu %[temp3], 3+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
348 + "lbu %[temp4], 0+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
349 + "lbu %[temp5], 1+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
350 + "lbu %[temp6], 2+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
351 + "lbu %[temp7], 3+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
352 + "addu %[temp8], %[temp0], %[temp2] \n\t" \
353 + "subu %[temp0], %[temp0], %[temp2] \n\t" \
354 + "addu %[temp2], %[temp1], %[temp3] \n\t" \
355 + "subu %[temp1], %[temp1], %[temp3] \n\t" \
356 + "addu %[temp3], %[temp4], %[temp6] \n\t" \
357 + "subu %[temp4], %[temp4], %[temp6] \n\t" \
358 + "addu %[temp6], %[temp5], %[temp7] \n\t" \
359 + "subu %[temp5], %[temp5], %[temp7] \n\t" \
360 + "addu %[temp7], %[temp8], %[temp2] \n\t" \
361 + "subu %[temp2], %[temp8], %[temp2] \n\t" \
362 + "addu %[temp8], %[temp0], %[temp1] \n\t" \
363 + "subu %[temp0], %[temp0], %[temp1] \n\t" \
364 + "addu %[temp1], %[temp3], %[temp6] \n\t" \
365 + "subu %[temp3], %[temp3], %[temp6] \n\t" \
366 + "addu %[temp6], %[temp4], %[temp5] \n\t" \
367 + "subu %[temp4], %[temp4], %[temp5] \n\t" \
368 + "sw %[temp7], " #E "(%[tmp]) \n\t" \
369 + "sw %[temp2], " #H "(%[tmp]) \n\t" \
370 + "sw %[temp8], " #F "(%[tmp]) \n\t" \
371 + "sw %[temp0], " #G "(%[tmp]) \n\t" \
372 + "sw %[temp1], " #E1 "(%[tmp]) \n\t" \
373 + "sw %[temp3], " #H1 "(%[tmp]) \n\t" \
374 + "sw %[temp6], " #F1 "(%[tmp]) \n\t" \
375 + "sw %[temp4], " #G1 "(%[tmp]) \n\t"
376
377 // macro for one vertical pass in Disto4x4 (TTransform)
378 // two calls of function TTransform are merged into single one
379 @@ -300,10 +300,10 @@
380 // A1..D1 - offsets in bytes to load second results from tmp buffer
381 // E..H - offsets in bytes to load from w buffer
382 #define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H) \
383 - "lw %[temp0], "#A1"(%[tmp]) \n\t" \
384 - "lw %[temp1], "#C1"(%[tmp]) \n\t" \
385 - "lw %[temp2], "#B1"(%[tmp]) \n\t" \
386 - "lw %[temp3], "#D1"(%[tmp]) \n\t" \
387 + "lw %[temp0], " #A1 "(%[tmp]) \n\t" \
388 + "lw %[temp1], " #C1 "(%[tmp]) \n\t" \
389 + "lw %[temp2], " #B1 "(%[tmp]) \n\t" \
390 + "lw %[temp3], " #D1 "(%[tmp]) \n\t" \
391 "addu %[temp8], %[temp0], %[temp1] \n\t" \
392 "subu %[temp0], %[temp0], %[temp1] \n\t" \
393 "addu %[temp1], %[temp2], %[temp3] \n\t" \
394 @@ -324,18 +324,18 @@
395 "subu %[temp1], %[temp1], %[temp5] \n\t" \
396 "subu %[temp0], %[temp0], %[temp6] \n\t" \
397 "subu %[temp8], %[temp8], %[temp7] \n\t" \
398 - "lhu %[temp4], "#E"(%[w]) \n\t" \
399 - "lhu %[temp5], "#F"(%[w]) \n\t" \
400 - "lhu %[temp6], "#G"(%[w]) \n\t" \
401 - "lhu %[temp7], "#H"(%[w]) \n\t" \
402 + "lhu %[temp4], " #E "(%[w]) \n\t" \
403 + "lhu %[temp5], " #F "(%[w]) \n\t" \
404 + "lhu %[temp6], " #G "(%[w]) \n\t" \
405 + "lhu %[temp7], " #H "(%[w]) \n\t" \
406 "madd %[temp4], %[temp3] \n\t" \
407 "madd %[temp5], %[temp1] \n\t" \
408 "madd %[temp6], %[temp0] \n\t" \
409 "madd %[temp7], %[temp8] \n\t" \
410 - "lw %[temp0], "#A"(%[tmp]) \n\t" \
411 - "lw %[temp1], "#C"(%[tmp]) \n\t" \
412 - "lw %[temp2], "#B"(%[tmp]) \n\t" \
413 - "lw %[temp3], "#D"(%[tmp]) \n\t" \
414 + "lw %[temp0], " #A "(%[tmp]) \n\t" \
415 + "lw %[temp1], " #C "(%[tmp]) \n\t" \
416 + "lw %[temp2], " #B "(%[tmp]) \n\t" \
417 + "lw %[temp3], " #D "(%[tmp]) \n\t" \
418 "addu %[temp8], %[temp0], %[temp1] \n\t" \
419 "subu %[temp0], %[temp0], %[temp1] \n\t" \
420 "addu %[temp1], %[temp2], %[temp3] \n\t" \
421 @@ -412,71 +412,71 @@
422 // temp0..temp15 holds tmp[0]..tmp[15]
423 // A - offset in bytes to load from src and ref buffers
424 // TEMP0..TEMP3 - registers for corresponding tmp elements
425 -#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
426 - "lw %["#TEMP1"], 0(%[args]) \n\t" \
427 - "lw %["#TEMP2"], 4(%[args]) \n\t" \
428 - "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
429 - "lbu %[temp17], 0+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
430 - "lbu %[temp18], 1+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
431 - "lbu %[temp19], 1+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
432 - "subu %[temp20], %[temp16], %[temp17] \n\t" \
433 - "lbu %[temp16], 2+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
434 - "lbu %[temp17], 2+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
435 - "subu %["#TEMP0"], %[temp18], %[temp19] \n\t" \
436 - "lbu %[temp18], 3+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
437 - "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
438 - "subu %["#TEMP1"], %[temp16], %[temp17] \n\t" \
439 - "subu %["#TEMP2"], %[temp18], %[temp19] \n\t" \
440 - "addu %["#TEMP3"], %[temp20], %["#TEMP2"] \n\t" \
441 - "subu %["#TEMP2"], %[temp20], %["#TEMP2"] \n\t" \
442 - "addu %[temp20], %["#TEMP0"], %["#TEMP1"] \n\t" \
443 - "subu %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \
444 - "mul %[temp16], %["#TEMP2"], %[c5352] \n\t" \
445 - "mul %[temp17], %["#TEMP2"], %[c2217] \n\t" \
446 - "mul %[temp18], %["#TEMP0"], %[c5352] \n\t" \
447 - "mul %[temp19], %["#TEMP0"], %[c2217] \n\t" \
448 - "addu %["#TEMP1"], %["#TEMP3"], %[temp20] \n\t" \
449 - "subu %[temp20], %["#TEMP3"], %[temp20] \n\t" \
450 - "sll %["#TEMP0"], %["#TEMP1"], 3 \n\t" \
451 - "sll %["#TEMP2"], %[temp20], 3 \n\t" \
452 - "addiu %[temp16], %[temp16], 1812 \n\t" \
453 - "addiu %[temp17], %[temp17], 937 \n\t" \
454 - "addu %[temp16], %[temp16], %[temp19] \n\t" \
455 - "subu %[temp17], %[temp17], %[temp18] \n\t" \
456 - "sra %["#TEMP1"], %[temp16], 9 \n\t" \
457 - "sra %["#TEMP3"], %[temp17], 9 \n\t"
458 +#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
459 + "lw %[" #TEMP1 "], 0(%[args]) \n\t" \
460 + "lw %[" #TEMP2 "], 4(%[args]) \n\t" \
461 + "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
462 + "lbu %[temp17], 0+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
463 + "lbu %[temp18], 1+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
464 + "lbu %[temp19], 1+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
465 + "subu %[temp20], %[temp16], %[temp17] \n\t" \
466 + "lbu %[temp16], 2+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
467 + "lbu %[temp17], 2+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
468 + "subu %[" #TEMP0 "], %[temp18], %[temp19] \n\t" \
469 + "lbu %[temp18], 3+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
470 + "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
471 + "subu %[" #TEMP1 "], %[temp16], %[temp17] \n\t" \
472 + "subu %[" #TEMP2 "], %[temp18], %[temp19] \n\t" \
473 + "addu %[" #TEMP3 "], %[temp20], %[" #TEMP2 "] \n\t" \
474 + "subu %[" #TEMP2 "], %[temp20], %[" #TEMP2 "] \n\t" \
475 + "addu %[temp20], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
476 + "subu %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
477 + "mul %[temp16], %[" #TEMP2 "], %[c5352] \n\t" \
478 + "mul %[temp17], %[" #TEMP2 "], %[c2217] \n\t" \
479 + "mul %[temp18], %[" #TEMP0 "], %[c5352] \n\t" \
480 + "mul %[temp19], %[" #TEMP0 "], %[c2217] \n\t" \
481 + "addu %[" #TEMP1 "], %[" #TEMP3 "], %[temp20] \n\t" \
482 + "subu %[temp20], %[" #TEMP3 "], %[temp20] \n\t" \
483 + "sll %[" #TEMP0 "], %[" #TEMP1 "], 3 \n\t" \
484 + "sll %[" #TEMP2 "], %[temp20], 3 \n\t" \
485 + "addiu %[temp16], %[temp16], 1812 \n\t" \
486 + "addiu %[temp17], %[temp17], 937 \n\t" \
487 + "addu %[temp16], %[temp16], %[temp19] \n\t" \
488 + "subu %[temp17], %[temp17], %[temp18] \n\t" \
489 + "sra %[" #TEMP1 "], %[temp16], 9 \n\t" \
490 + "sra %[" #TEMP3 "], %[temp17], 9 \n\t"
491
492 // macro for one vertical pass in FTransform
493 // temp0..temp15 holds tmp[0]..tmp[15]
494 // A..D - offsets in bytes to store to out buffer
495 // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
496 -#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
497 - "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \
498 - "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \
499 - "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \
500 - "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \
501 - "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \
502 - "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \
503 - "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \
504 - "mul %[temp18], %[temp18], %[c5352] \n\t" \
505 - "addiu %[temp16], %[temp16], 7 \n\t" \
506 - "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \
507 - "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
508 - "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \
509 - "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \
510 - "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \
511 - "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \
512 - "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \
513 - "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \
514 - "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \
515 - "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
516 - "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
517 - "addiu %[temp16], %["#TEMP12"], 1 \n\t" \
518 - "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \
519 - "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \
520 - "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \
521 - "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \
522 - "sh %["#TEMP12"], "#B"(%[temp20]) \n\t"
523 +#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
524 + "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
525 + "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
526 + "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
527 + "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
528 + "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \
529 + "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \
530 + "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \
531 + "mul %[temp18], %[temp18], %[c5352] \n\t" \
532 + "addiu %[temp16], %[temp16], 7 \n\t" \
533 + "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \
534 + "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
535 + "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \
536 + "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \
537 + "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \
538 + "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \
539 + "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \
540 + "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \
541 + "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \
542 + "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
543 + "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
544 + "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \
545 + "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
546 + "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \
547 + "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \
548 + "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \
549 + "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t"
550
551 static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {
552 int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
553 @@ -516,14 +516,14 @@
554 #if !defined(WORK_AROUND_GCC)
555
556 #define GET_SSE_INNER(A, B, C, D) \
557 - "lbu %[temp0], "#A"(%[a]) \n\t" \
558 - "lbu %[temp1], "#A"(%[b]) \n\t" \
559 - "lbu %[temp2], "#B"(%[a]) \n\t" \
560 - "lbu %[temp3], "#B"(%[b]) \n\t" \
561 - "lbu %[temp4], "#C"(%[a]) \n\t" \
562 - "lbu %[temp5], "#C"(%[b]) \n\t" \
563 - "lbu %[temp6], "#D"(%[a]) \n\t" \
564 - "lbu %[temp7], "#D"(%[b]) \n\t" \
565 + "lbu %[temp0], " #A "(%[a]) \n\t" \
566 + "lbu %[temp1], " #A "(%[b]) \n\t" \
567 + "lbu %[temp2], " #B "(%[a]) \n\t" \
568 + "lbu %[temp3], " #B "(%[b]) \n\t" \
569 + "lbu %[temp4], " #C "(%[a]) \n\t" \
570 + "lbu %[temp5], " #C "(%[b]) \n\t" \
571 + "lbu %[temp6], " #D "(%[a]) \n\t" \
572 + "lbu %[temp7], " #D "(%[b]) \n\t" \
573 "subu %[temp0], %[temp0], %[temp1] \n\t" \
574 "subu %[temp2], %[temp2], %[temp3] \n\t" \
575 "subu %[temp4], %[temp4], %[temp5] \n\t" \
576 diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
577 index 56db07c..44f6fd2 100644
578 --- a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
579 +++ b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
580 @@ -27,25 +27,25 @@
581 // I - input (macro doesn't change it)
582 #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \
583 I0, I1, I2, I3, I4, I5, I6, I7) \
584 - "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \
585 - "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" \
586 - "addq.ph %["#O2"], %["#I2"], %["#I3"] \n\t" \
587 - "subq.ph %["#O3"], %["#I2"], %["#I3"] \n\t" \
588 - "addq.ph %["#O4"], %["#I4"], %["#I5"] \n\t" \
589 - "subq.ph %["#O5"], %["#I4"], %["#I5"] \n\t" \
590 - "addq.ph %["#O6"], %["#I6"], %["#I7"] \n\t" \
591 - "subq.ph %["#O7"], %["#I6"], %["#I7"] \n\t"
592 + "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \
593 + "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" \
594 + "addq.ph %[" #O2 "], %[" #I2 "], %[" #I3 "] \n\t" \
595 + "subq.ph %[" #O3 "], %[" #I2 "], %[" #I3 "] \n\t" \
596 + "addq.ph %[" #O4 "], %[" #I4 "], %[" #I5 "] \n\t" \
597 + "subq.ph %[" #O5 "], %[" #I4 "], %[" #I5 "] \n\t" \
598 + "addq.ph %[" #O6 "], %[" #I6 "], %[" #I7 "] \n\t" \
599 + "subq.ph %[" #O7 "], %[" #I6 "], %[" #I7 "] \n\t"
600
601 // IO - input/output
602 #define ABS_X8(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7) \
603 - "absq_s.ph %["#IO0"], %["#IO0"] \n\t" \
604 - "absq_s.ph %["#IO1"], %["#IO1"] \n\t" \
605 - "absq_s.ph %["#IO2"], %["#IO2"] \n\t" \
606 - "absq_s.ph %["#IO3"], %["#IO3"] \n\t" \
607 - "absq_s.ph %["#IO4"], %["#IO4"] \n\t" \
608 - "absq_s.ph %["#IO5"], %["#IO5"] \n\t" \
609 - "absq_s.ph %["#IO6"], %["#IO6"] \n\t" \
610 - "absq_s.ph %["#IO7"], %["#IO7"] \n\t"
611 + "absq_s.ph %[" #IO0 "], %[" #IO0 "] \n\t" \
612 + "absq_s.ph %[" #IO1 "], %[" #IO1 "] \n\t" \
613 + "absq_s.ph %[" #IO2 "], %[" #IO2 "] \n\t" \
614 + "absq_s.ph %[" #IO3 "], %[" #IO3 "] \n\t" \
615 + "absq_s.ph %[" #IO4 "], %[" #IO4 "] \n\t" \
616 + "absq_s.ph %[" #IO5 "], %[" #IO5 "] \n\t" \
617 + "absq_s.ph %[" #IO6 "], %[" #IO6 "] \n\t" \
618 + "absq_s.ph %[" #IO7 "], %[" #IO7 "] \n\t"
619
620 // dpa.w.ph $ac0 temp0 ,temp1
621 // $ac += temp0[31..16] * temp1[31..16] + temp0[15..0] * temp1[15..0]
622 @@ -56,15 +56,15 @@
623 #define MUL_HALF(O0, I0, I1, I2, I3, I4, I5, I6, I7, \
624 I8, I9, I10, I11, I12, I13, I14, I15) \
625 "mult $ac0, $zero, $zero \n\t" \
626 - "dpa.w.ph $ac0, %["#I2"], %["#I0"] \n\t" \
627 - "dpax.w.ph $ac0, %["#I5"], %["#I6"] \n\t" \
628 - "dpa.w.ph $ac0, %["#I8"], %["#I9"] \n\t" \
629 - "dpax.w.ph $ac0, %["#I11"], %["#I4"] \n\t" \
630 - "dpa.w.ph $ac0, %["#I12"], %["#I7"] \n\t" \
631 - "dpax.w.ph $ac0, %["#I13"], %["#I1"] \n\t" \
632 - "dpa.w.ph $ac0, %["#I14"], %["#I3"] \n\t" \
633 - "dpax.w.ph $ac0, %["#I15"], %["#I10"] \n\t" \
634 - "mflo %["#O0"], $ac0 \n\t"
635 + "dpa.w.ph $ac0, %[" #I2 "], %[" #I0 "] \n\t" \
636 + "dpax.w.ph $ac0, %[" #I5 "], %[" #I6 "] \n\t" \
637 + "dpa.w.ph $ac0, %[" #I8 "], %[" #I9 "] \n\t" \
638 + "dpax.w.ph $ac0, %[" #I11 "], %[" #I4 "] \n\t" \
639 + "dpa.w.ph $ac0, %[" #I12 "], %[" #I7 "] \n\t" \
640 + "dpax.w.ph $ac0, %[" #I13 "], %[" #I1 "] \n\t" \
641 + "dpa.w.ph $ac0, %[" #I14 "], %[" #I3 "] \n\t" \
642 + "dpax.w.ph $ac0, %[" #I15 "], %[" #I10 "] \n\t" \
643 + "mflo %[" #O0 "], $ac0 \n\t"
644
645 #define OUTPUT_EARLY_CLOBBER_REGS_17() \
646 OUTPUT_EARLY_CLOBBER_REGS_10(), \
647 @@ -77,69 +77,69 @@
648 // A - offset in bytes to load from src and ref buffers
649 // TEMP0..TEMP3 - registers for corresponding tmp elements
650 #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
651 - "lw %["#TEMP0"], 0(%[args]) \n\t" \
652 - "lw %["#TEMP1"], 4(%[args]) \n\t" \
653 - "lw %["#TEMP2"], "XSTR(BPS)"*"#A"(%["#TEMP0"]) \n\t" \
654 - "lw %["#TEMP3"], "XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
655 - "preceu.ph.qbl %["#TEMP0"], %["#TEMP2"] \n\t" \
656 - "preceu.ph.qbl %["#TEMP1"], %["#TEMP3"] \n\t" \
657 - "preceu.ph.qbr %["#TEMP2"], %["#TEMP2"] \n\t" \
658 - "preceu.ph.qbr %["#TEMP3"], %["#TEMP3"] \n\t" \
659 - "subq.ph %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \
660 - "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP3"] \n\t" \
661 - "rotr %["#TEMP0"], %["#TEMP0"], 16 \n\t" \
662 - "addq.ph %["#TEMP1"], %["#TEMP2"], %["#TEMP0"] \n\t" \
663 - "subq.ph %["#TEMP3"], %["#TEMP2"], %["#TEMP0"] \n\t" \
664 - "seh %["#TEMP0"], %["#TEMP1"] \n\t" \
665 - "sra %[temp16], %["#TEMP1"], 16 \n\t" \
666 - "seh %[temp19], %["#TEMP3"] \n\t" \
667 - "sra %["#TEMP3"], %["#TEMP3"], 16 \n\t" \
668 - "subu %["#TEMP2"], %["#TEMP0"], %[temp16] \n\t" \
669 - "addu %["#TEMP0"], %["#TEMP0"], %[temp16] \n\t" \
670 - "mul %[temp17], %[temp19], %[c2217] \n\t" \
671 - "mul %[temp18], %["#TEMP3"], %[c5352] \n\t" \
672 - "mul %["#TEMP1"], %[temp19], %[c5352] \n\t" \
673 - "mul %[temp16], %["#TEMP3"], %[c2217] \n\t" \
674 - "sll %["#TEMP2"], %["#TEMP2"], 3 \n\t" \
675 - "sll %["#TEMP0"], %["#TEMP0"], 3 \n\t" \
676 - "subu %["#TEMP3"], %[temp17], %[temp18] \n\t" \
677 - "addu %["#TEMP1"], %[temp16], %["#TEMP1"] \n\t" \
678 - "addiu %["#TEMP3"], %["#TEMP3"], 937 \n\t" \
679 - "addiu %["#TEMP1"], %["#TEMP1"], 1812 \n\t" \
680 - "sra %["#TEMP3"], %["#TEMP3"], 9 \n\t" \
681 - "sra %["#TEMP1"], %["#TEMP1"], 9 \n\t"
682 + "lw %[" #TEMP0 "], 0(%[args]) \n\t" \
683 + "lw %[" #TEMP1 "], 4(%[args]) \n\t" \
684 + "lw %[" #TEMP2 "], "XSTR(BPS)"*" #A "(%[" #TEMP0 "]) \n\t" \
685 + "lw %[" #TEMP3 "], "XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
686 + "preceu.ph.qbl %[" #TEMP0 "], %[" #TEMP2 "] \n\t" \
687 + "preceu.ph.qbl %[" #TEMP1 "], %[" #TEMP3 "] \n\t" \
688 + "preceu.ph.qbr %[" #TEMP2 "], %[" #TEMP2 "] \n\t" \
689 + "preceu.ph.qbr %[" #TEMP3 "], %[" #TEMP3 "] \n\t" \
690 + "subq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
691 + "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP3 "] \n\t" \
692 + "rotr %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \
693 + "addq.ph %[" #TEMP1 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \
694 + "subq.ph %[" #TEMP3 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \
695 + "seh %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
696 + "sra %[temp16], %[" #TEMP1 "], 16 \n\t" \
697 + "seh %[temp19], %[" #TEMP3 "] \n\t" \
698 + "sra %[" #TEMP3 "], %[" #TEMP3 "], 16 \n\t" \
699 + "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp16] \n\t" \
700 + "addu %[" #TEMP0 "], %[" #TEMP0 "], %[temp16] \n\t" \
701 + "mul %[temp17], %[temp19], %[c2217] \n\t" \
702 + "mul %[temp18], %[" #TEMP3 "], %[c5352] \n\t" \
703 + "mul %[" #TEMP1 "], %[temp19], %[c5352] \n\t" \
704 + "mul %[temp16], %[" #TEMP3 "], %[c2217] \n\t" \
705 + "sll %[" #TEMP2 "], %[" #TEMP2 "], 3 \n\t" \
706 + "sll %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \
707 + "subu %[" #TEMP3 "], %[temp17], %[temp18] \n\t" \
708 + "addu %[" #TEMP1 "], %[temp16], %[" #TEMP1 "] \n\t" \
709 + "addiu %[" #TEMP3 "], %[" #TEMP3 "], 937 \n\t" \
710 + "addiu %[" #TEMP1 "], %[" #TEMP1 "], 1812 \n\t" \
711 + "sra %[" #TEMP3 "], %[" #TEMP3 "], 9 \n\t" \
712 + "sra %[" #TEMP1 "], %[" #TEMP1 "], 9 \n\t"
713
714 // macro for one vertical pass in FTransform
715 // temp0..temp15 holds tmp[0]..tmp[15]
716 // A..D - offsets in bytes to store to out buffer
717 // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
718 #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
719 - "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \
720 - "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \
721 - "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \
722 - "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \
723 - "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \
724 - "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \
725 - "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \
726 - "mul %[temp18], %[temp18], %[c5352] \n\t" \
727 - "addiu %[temp16], %[temp16], 7 \n\t" \
728 - "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \
729 - "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
730 - "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \
731 - "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \
732 - "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \
733 - "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \
734 - "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \
735 - "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \
736 - "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \
737 - "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
738 - "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
739 - "addiu %[temp16], %["#TEMP12"], 1 \n\t" \
740 - "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \
741 - "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \
742 - "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \
743 - "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \
744 - "sh %["#TEMP12"], "#B"(%[temp20]) \n\t"
745 + "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
746 + "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
747 + "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
748 + "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
749 + "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \
750 + "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \
751 + "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \
752 + "mul %[temp18], %[temp18], %[c5352] \n\t" \
753 + "addiu %[temp16], %[temp16], 7 \n\t" \
754 + "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \
755 + "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
756 + "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \
757 + "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \
758 + "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \
759 + "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \
760 + "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \
761 + "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \
762 + "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \
763 + "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
764 + "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
765 + "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \
766 + "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
767 + "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \
768 + "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \
769 + "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \
770 + "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t"
771
772 static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {
773 const int c2217 = 2217;
774 @@ -329,11 +329,11 @@
775 // Intra predictions
776
777 #define FILL_PART(J, SIZE) \
778 - "usw %[value], 0+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
779 - "usw %[value], 4+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
780 - ".if "#SIZE" == 16 \n\t" \
781 - "usw %[value], 8+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
782 - "usw %[value], 12+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
783 + "usw %[value], 0+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
784 + "usw %[value], 4+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
785 + ".if " #SIZE " == 16 \n\t" \
786 + "usw %[value], 8+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
787 + "usw %[value], 12+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
788 ".endif \n\t"
789
790 #define FILL_8_OR_16(DST, VALUE, SIZE) do { \
791 @@ -348,7 +348,7 @@
792 FILL_PART( 5, SIZE) \
793 FILL_PART( 6, SIZE) \
794 FILL_PART( 7, SIZE) \
795 - ".if "#SIZE" == 16 \n\t" \
796 + ".if " #SIZE " == 16 \n\t" \
797 FILL_PART( 8, 16) \
798 FILL_PART( 9, 16) \
799 FILL_PART(10, 16) \
800 @@ -425,7 +425,7 @@
801 CLIPPING() \
802 "usw %[temp0], 0(%[dst]) \n\t" \
803 "usw %[temp1], 4(%[dst]) \n\t" \
804 - ".if "#SIZE" == 16 \n\t" \
805 + ".if " #SIZE " == 16 \n\t" \
806 "ulw %[temp0], 8(%[top]) \n\t" \
807 "ulw %[temp1], 12(%[top]) \n\t" \
808 CLIPPING() \
809 @@ -1060,8 +1060,8 @@
810 #if !defined(WORK_AROUND_GCC)
811
812 #define GET_SSE_INNER(A) \
813 - "lw %[temp0], "#A"(%[a]) \n\t" \
814 - "lw %[temp1], "#A"(%[b]) \n\t" \
815 + "lw %[temp0], " #A "(%[a]) \n\t" \
816 + "lw %[temp1], " #A "(%[b]) \n\t" \
817 "preceu.ph.qbr %[temp2], %[temp0] \n\t" \
818 "preceu.ph.qbl %[temp0], %[temp0] \n\t" \
819 "preceu.ph.qbr %[temp3], %[temp1] \n\t" \
820 @@ -1185,28 +1185,28 @@
821 // N - offset in bytes (n * 2)
822 // N1 - offset in bytes ((n + 1) * 2)
823 #define QUANTIZE_ONE(J, K, N, N1) \
824 - "ulw %[temp1], "#J"(%[ppin]) \n\t" \
825 - "ulw %[temp2], "#J"(%[ppsharpen]) \n\t" \
826 - "lhu %[temp3], "#K"(%[ppzthresh]) \n\t" \
827 - "lhu %[temp6], "#K"+4(%[ppzthresh]) \n\t" \
828 + "ulw %[temp1], " #J "(%[ppin]) \n\t" \
829 + "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \
830 + "lhu %[temp3], " #K "(%[ppzthresh]) \n\t" \
831 + "lhu %[temp6], " #K "+4(%[ppzthresh]) \n\t" \
832 "absq_s.ph %[temp4], %[temp1] \n\t" \
833 "ins %[temp3], %[temp6], 16, 16 \n\t" \
834 "addu.ph %[coeff], %[temp4], %[temp2] \n\t" \
835 "shra.ph %[sign], %[temp1], 15 \n\t" \
836 "li %[level], 0x10001 \n\t" \
837 "cmp.lt.ph %[temp3], %[coeff] \n\t" \
838 - "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
839 + "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
840 "pick.ph %[temp5], %[level], $0 \n\t" \
841 - "lw %[temp2], "#K"(%[ppbias]) \n\t" \
842 + "lw %[temp2], " #K "(%[ppbias]) \n\t" \
843 "beqz %[temp5], 0f \n\t" \
844 - "lhu %[temp3], "#J"(%[ppq]) \n\t" \
845 + "lhu %[temp3], " #J "(%[ppq]) \n\t" \
846 "beq %[temp5], %[level], 1f \n\t" \
847 "andi %[temp5], %[temp5], 0x1 \n\t" \
848 "andi %[temp4], %[coeff], 0xffff \n\t" \
849 "beqz %[temp5], 2f \n\t" \
850 "mul %[level], %[temp4], %[temp1] \n\t" \
851 - "sh $0, "#J"+2(%[ppin]) \n\t" \
852 - "sh $0, "#N1"(%[pout]) \n\t" \
853 + "sh $0, " #J "+2(%[ppin]) \n\t" \
854 + "sh $0, " #N1 "(%[pout]) \n\t" \
855 "addu %[level], %[level], %[temp2] \n\t" \
856 "sra %[level], %[level], 17 \n\t" \
857 "slt %[temp4], %[max_level], %[level] \n\t" \
858 @@ -1216,15 +1216,15 @@
859 "subu %[level], %[level], %[temp6] \n\t" \
860 "mul %[temp5], %[level], %[temp3] \n\t" \
861 "or %[ret], %[ret], %[level] \n\t" \
862 - "sh %[level], "#N"(%[pout]) \n\t" \
863 - "sh %[temp5], "#J"(%[ppin]) \n\t" \
864 + "sh %[level], " #N "(%[pout]) \n\t" \
865 + "sh %[temp5], " #J "(%[ppin]) \n\t" \
866 "j 3f \n\t" \
867 "2: \n\t" \
868 - "lhu %[temp1], "#J"+2(%[ppiq]) \n\t" \
869 + "lhu %[temp1], " #J "+2(%[ppiq]) \n\t" \
870 "srl %[temp5], %[coeff], 16 \n\t" \
871 "mul %[level], %[temp5], %[temp1] \n\t" \
872 - "lw %[temp2], "#K"+4(%[ppbias]) \n\t" \
873 - "lhu %[temp3], "#J"+2(%[ppq]) \n\t" \
874 + "lw %[temp2], " #K "+4(%[ppbias]) \n\t" \
875 + "lhu %[temp3], " #J "+2(%[ppq]) \n\t" \
876 "addu %[level], %[level], %[temp2] \n\t" \
877 "sra %[level], %[level], 17 \n\t" \
878 "srl %[temp6], %[sign], 16 \n\t" \
879 @@ -1233,20 +1233,20 @@
880 "xor %[level], %[level], %[temp6] \n\t" \
881 "subu %[level], %[level], %[temp6] \n\t" \
882 "mul %[temp5], %[level], %[temp3] \n\t" \
883 - "sh $0, "#J"(%[ppin]) \n\t" \
884 - "sh $0, "#N"(%[pout]) \n\t" \
885 + "sh $0, " #J "(%[ppin]) \n\t" \
886 + "sh $0, " #N "(%[pout]) \n\t" \
887 "or %[ret], %[ret], %[level] \n\t" \
888 - "sh %[temp5], "#J"+2(%[ppin]) \n\t" \
889 - "sh %[level], "#N1"(%[pout]) \n\t" \
890 + "sh %[temp5], " #J "+2(%[ppin]) \n\t" \
891 + "sh %[level], " #N1 "(%[pout]) \n\t" \
892 "j 3f \n\t" \
893 "1: \n\t" \
894 - "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
895 - "lw %[temp2], "#K"(%[ppbias]) \n\t" \
896 - "ulw %[temp3], "#J"(%[ppq]) \n\t" \
897 + "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
898 + "lw %[temp2], " #K "(%[ppbias]) \n\t" \
899 + "ulw %[temp3], " #J "(%[ppq]) \n\t" \
900 "andi %[temp5], %[coeff], 0xffff \n\t" \
901 "srl %[temp0], %[coeff], 16 \n\t" \
902 - "lhu %[temp6], "#J"+2(%[ppiq]) \n\t" \
903 - "lw %[coeff], "#K"+4(%[ppbias]) \n\t" \
904 + "lhu %[temp6], " #J "+2(%[ppiq]) \n\t" \
905 + "lw %[coeff], " #K "+4(%[ppbias]) \n\t" \
906 "mul %[level], %[temp5], %[temp1] \n\t" \
907 "mul %[temp4], %[temp0], %[temp6] \n\t" \
908 "addu %[level], %[level], %[temp2] \n\t" \
909 @@ -1259,15 +1259,15 @@
910 "subu.ph %[level], %[level], %[sign] \n\t" \
911 "mul.ph %[temp3], %[level], %[temp3] \n\t" \
912 "or %[ret], %[ret], %[level] \n\t" \
913 - "sh %[level], "#N"(%[pout]) \n\t" \
914 + "sh %[level], " #N "(%[pout]) \n\t" \
915 "srl %[level], %[level], 16 \n\t" \
916 - "sh %[level], "#N1"(%[pout]) \n\t" \
917 - "usw %[temp3], "#J"(%[ppin]) \n\t" \
918 + "sh %[level], " #N1 "(%[pout]) \n\t" \
919 + "usw %[temp3], " #J "(%[ppin]) \n\t" \
920 "j 3f \n\t" \
921 "0: \n\t" \
922 - "sh $0, "#N"(%[pout]) \n\t" \
923 - "sh $0, "#N1"(%[pout]) \n\t" \
924 - "usw $0, "#J"(%[ppin]) \n\t" \
925 + "sh $0, " #N "(%[pout]) \n\t" \
926 + "sh $0, " #N1 "(%[pout]) \n\t" \
927 + "usw $0, " #J "(%[ppin]) \n\t" \
928 "3: \n\t"
929
930 static int QuantizeBlock(int16_t in[16], int16_t out[16],
931 @@ -1326,37 +1326,37 @@
932 // A, B, C, D - offset in bytes to load from in buffer
933 // TEMP0, TEMP1 - registers for corresponding tmp elements
934 #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \
935 - "lh %["#TEMP0"], "#A"(%[in]) \n\t" \
936 - "lh %["#TEMP1"], "#B"(%[in]) \n\t" \
937 - "lh %[temp8], "#C"(%[in]) \n\t" \
938 - "lh %[temp9], "#D"(%[in]) \n\t" \
939 - "ins %["#TEMP1"], %["#TEMP0"], 16, 16 \n\t" \
940 + "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \
941 + "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \
942 + "lh %[temp8], " #C "(%[in]) \n\t" \
943 + "lh %[temp9], " #D "(%[in]) \n\t" \
944 + "ins %[" #TEMP1 "], %[" #TEMP0 "], 16, 16 \n\t" \
945 "ins %[temp9], %[temp8], 16, 16 \n\t" \
946 - "subq.ph %[temp8], %["#TEMP1"], %[temp9] \n\t" \
947 - "addq.ph %[temp9], %["#TEMP1"], %[temp9] \n\t" \
948 - "precrq.ph.w %["#TEMP0"], %[temp8], %[temp9] \n\t" \
949 + "subq.ph %[temp8], %[" #TEMP1 "], %[temp9] \n\t" \
950 + "addq.ph %[temp9], %[" #TEMP1 "], %[temp9] \n\t" \
951 + "precrq.ph.w %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \
952 "append %[temp8], %[temp9], 16 \n\t" \
953 - "subq.ph %["#TEMP1"], %["#TEMP0"], %[temp8] \n\t" \
954 - "addq.ph %["#TEMP0"], %["#TEMP0"], %[temp8] \n\t" \
955 - "rotr %["#TEMP1"], %["#TEMP1"], 16 \n\t"
956 + "subq.ph %[" #TEMP1 "], %[" #TEMP0 "], %[temp8] \n\t" \
957 + "addq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[temp8] \n\t" \
958 + "rotr %[" #TEMP1 "], %[" #TEMP1 "], 16 \n\t"
959
960 // macro for one vertical pass in FTransformWHT
961 // temp0..temp7 holds tmp[0]..tmp[15]
962 // A, B, C, D - offsets in bytes to store to out buffer
963 // TEMP0, TEMP2, TEMP4 and TEMP6 - registers for corresponding tmp elements
964 #define VERTICAL_PASS_WHT(A, B, C, D, TEMP0, TEMP2, TEMP4, TEMP6) \
965 - "addq.ph %[temp8], %["#TEMP0"], %["#TEMP4"] \n\t" \
966 - "addq.ph %[temp9], %["#TEMP2"], %["#TEMP6"] \n\t" \
967 - "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \
968 - "subq.ph %["#TEMP6"], %["#TEMP0"], %["#TEMP4"] \n\t" \
969 - "addqh.ph %["#TEMP0"], %[temp8], %[temp9] \n\t" \
970 - "subqh.ph %["#TEMP4"], %["#TEMP6"], %["#TEMP2"] \n\t" \
971 - "addqh.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \
972 - "subqh.ph %["#TEMP6"], %[temp8], %[temp9] \n\t" \
973 - "usw %["#TEMP0"], "#A"(%[out]) \n\t" \
974 - "usw %["#TEMP2"], "#B"(%[out]) \n\t" \
975 - "usw %["#TEMP4"], "#C"(%[out]) \n\t" \
976 - "usw %["#TEMP6"], "#D"(%[out]) \n\t"
977 + "addq.ph %[temp8], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \
978 + "addq.ph %[temp9], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
979 + "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
980 + "subq.ph %[" #TEMP6 "], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \
981 + "addqh.ph %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \
982 + "subqh.ph %[" #TEMP4 "], %[" #TEMP6 "], %[" #TEMP2 "] \n\t" \
983 + "addqh.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
984 + "subqh.ph %[" #TEMP6 "], %[temp8], %[temp9] \n\t" \
985 + "usw %[" #TEMP0 "], " #A "(%[out]) \n\t" \
986 + "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \
987 + "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \
988 + "usw %[" #TEMP6 "], " #D "(%[out]) \n\t"
989
990 static void FTransformWHT(const int16_t* in, int16_t* out) {
991 int temp0, temp1, temp2, temp3, temp4;
992 @@ -1385,10 +1385,10 @@
993 // convert 8 coeffs at time
994 // A, B, C, D - offsets in bytes to load from out buffer
995 #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \
996 - "ulw %[temp0], "#A"(%[out]) \n\t" \
997 - "ulw %[temp1], "#B"(%[out]) \n\t" \
998 - "ulw %[temp2], "#C"(%[out]) \n\t" \
999 - "ulw %[temp3], "#D"(%[out]) \n\t" \
1000 + "ulw %[temp0], " #A "(%[out]) \n\t" \
1001 + "ulw %[temp1], " #B "(%[out]) \n\t" \
1002 + "ulw %[temp2], " #C "(%[out]) \n\t" \
1003 + "ulw %[temp3], " #D "(%[out]) \n\t" \
1004 "absq_s.ph %[temp0], %[temp0] \n\t" \
1005 "absq_s.ph %[temp1], %[temp1] \n\t" \
1006 "absq_s.ph %[temp2], %[temp2] \n\t" \
1007 diff --git a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
1008 index 66f807d..8134af5 100644
1009 --- a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
1010 +++ b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
1011 @@ -48,7 +48,7 @@
1012 "srl %[temp0], %[length], 0x2 \n\t" \
1013 "beqz %[temp0], 4f \n\t" \
1014 " andi %[temp6], %[length], 0x3 \n\t" \
1015 - ".if "#INVERSE" \n\t" \
1016 + ".if " #INVERSE " \n\t" \
1017 "lbu %[temp1], -1(%[src]) \n\t" \
1018 "1: \n\t" \
1019 "lbu %[temp2], 0(%[src]) \n\t" \
1020 @@ -84,7 +84,7 @@
1021 "lbu %[temp1], -1(%[src]) \n\t" \
1022 "lbu %[temp2], 0(%[src]) \n\t" \
1023 "addiu %[src], %[src], 1 \n\t" \
1024 - ".if "#INVERSE" \n\t" \
1025 + ".if " #INVERSE " \n\t" \
1026 "addu %[temp3], %[temp1], %[temp2] \n\t" \
1027 "sb %[temp3], -1(%[src]) \n\t" \
1028 ".else \n\t" \
1029 @@ -131,7 +131,7 @@
1030 "ulw %[temp3], 4(%[src]) \n\t" \
1031 "ulw %[temp4], 4(%[pred]) \n\t" \
1032 "addiu %[src], %[src], 8 \n\t" \
1033 - ".if "#INVERSE" \n\t" \
1034 + ".if " #INVERSE " \n\t" \
1035 "addu.qb %[temp5], %[temp1], %[temp2] \n\t" \
1036 "addu.qb %[temp6], %[temp3], %[temp4] \n\t" \
1037 ".else \n\t" \
1038 @@ -152,7 +152,7 @@
1039 "lbu %[temp2], 0(%[pred]) \n\t" \
1040 "addiu %[src], %[src], 1 \n\t" \
1041 "addiu %[pred], %[pred], 1 \n\t" \
1042 - ".if "#INVERSE" \n\t" \
1043 + ".if " #INVERSE " \n\t" \
1044 "addu %[temp3], %[temp1], %[temp2] \n\t" \
1045 ".else \n\t" \
1046 "subu %[temp3], %[temp1], %[temp2] \n\t" \
1047 @@ -177,7 +177,7 @@
1048 __asm__ volatile ( \
1049 "lbu %[temp1], 0(%[src]) \n\t" \
1050 "lbu %[temp2], 0(%[pred]) \n\t" \
1051 - ".if "#INVERSE" \n\t" \
1052 + ".if " #INVERSE " \n\t" \
1053 "addu %[temp3], %[temp1], %[temp2] \n\t" \
1054 ".else \n\t" \
1055 "subu %[temp3], %[temp1], %[temp2] \n\t" \
1056 diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
1057 index 8ae5958..cdf0e26 100644
1058 --- a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
1059 +++ b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
1060
1061 @@ -278,28 +278,28 @@
1062 // literal_ and successive histograms could be unaligned
1063 // so we must use ulw and usw
1064 #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \
1065 - "ulw %[temp0], "#A"(%["#P0"]) \n\t" \
1066 - "ulw %[temp1], "#B"(%["#P0"]) \n\t" \
1067 - "ulw %[temp2], "#C"(%["#P0"]) \n\t" \
1068 - "ulw %[temp3], "#D"(%["#P0"]) \n\t" \
1069 - "ulw %[temp4], "#A"(%["#P1"]) \n\t" \
1070 - "ulw %[temp5], "#B"(%["#P1"]) \n\t" \
1071 - "ulw %[temp6], "#C"(%["#P1"]) \n\t" \
1072 - "ulw %[temp7], "#D"(%["#P1"]) \n\t" \
1073 + "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \
1074 + "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \
1075 + "ulw %[temp2], " #C "(%[" #P0 "]) \n\t" \
1076 + "ulw %[temp3], " #D "(%[" #P0 "]) \n\t" \
1077 + "ulw %[temp4], " #A "(%[" #P1 "]) \n\t" \
1078 + "ulw %[temp5], " #B "(%[" #P1 "]) \n\t" \
1079 + "ulw %[temp6], " #C "(%[" #P1 "]) \n\t" \
1080 + "ulw %[temp7], " #D "(%[" #P1 "]) \n\t" \
1081 "addu %[temp4], %[temp4], %[temp0] \n\t" \
1082 "addu %[temp5], %[temp5], %[temp1] \n\t" \
1083 "addu %[temp6], %[temp6], %[temp2] \n\t" \
1084 "addu %[temp7], %[temp7], %[temp3] \n\t" \
1085 - "addiu %["#P0"], %["#P0"], 16 \n\t" \
1086 - ".if "#E" == 1 \n\t" \
1087 - "addiu %["#P1"], %["#P1"], 16 \n\t" \
1088 + "addiu %[" #P0 "], %[" #P0 "], 16 \n\t" \
1089 + ".if " #E " == 1 \n\t" \
1090 + "addiu %[" #P1 "], %[" #P1 "], 16 \n\t" \
1091 ".endif \n\t" \
1092 - "usw %[temp4], "#A"(%["#P2"]) \n\t" \
1093 - "usw %[temp5], "#B"(%["#P2"]) \n\t" \
1094 - "usw %[temp6], "#C"(%["#P2"]) \n\t" \
1095 - "usw %[temp7], "#D"(%["#P2"]) \n\t" \
1096 - "addiu %["#P2"], %["#P2"], 16 \n\t" \
1097 - "bne %["#P0"], %[LoopEnd], 1b \n\t" \
1098 + "usw %[temp4], " #A "(%[" #P2 "]) \n\t" \
1099 + "usw %[temp5], " #B "(%[" #P2 "]) \n\t" \
1100 + "usw %[temp6], " #C "(%[" #P2 "]) \n\t" \
1101 + "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \
1102 + "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \
1103 + "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \
1104 ".set pop \n\t" \
1105
1106 #define ASM_END_COMMON_0 \
1107 diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
1108 index ad55f2c..90aed7f 100644
1109 --- a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
1110 +++ b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
1111 @@ -29,14 +29,14 @@
1112 for (x = 0; x < (width >> 2); ++x) { \
1113 int tmp1, tmp2, tmp3, tmp4; \
1114 __asm__ volatile ( \
1115 - ".ifc "#TYPE", uint8_t \n\t" \
1116 + ".ifc " #TYPE ", uint8_t \n\t" \
1117 "lbu %[tmp1], 0(%[src]) \n\t" \
1118 "lbu %[tmp2], 1(%[src]) \n\t" \
1119 "lbu %[tmp3], 2(%[src]) \n\t" \
1120 "lbu %[tmp4], 3(%[src]) \n\t" \
1121 "addiu %[src], %[src], 4 \n\t" \
1122 ".endif \n\t" \
1123 - ".ifc "#TYPE", uint32_t \n\t" \
1124 + ".ifc " #TYPE ", uint32_t \n\t" \
1125 "lw %[tmp1], 0(%[src]) \n\t" \
1126 "lw %[tmp2], 4(%[src]) \n\t" \
1127 "lw %[tmp3], 8(%[src]) \n\t" \
1128 @@ -55,7 +55,7 @@
1129 "lwx %[tmp2], %[tmp2](%[color_map]) \n\t" \
1130 "lwx %[tmp3], %[tmp3](%[color_map]) \n\t" \
1131 "lwx %[tmp4], %[tmp4](%[color_map]) \n\t" \
1132 - ".ifc "#TYPE", uint8_t \n\t" \
1133 + ".ifc " #TYPE ", uint8_t \n\t" \
1134 "ext %[tmp1], %[tmp1], 8, 8 \n\t" \
1135 "ext %[tmp2], %[tmp2], 8, 8 \n\t" \
1136 "ext %[tmp3], %[tmp3], 8, 8 \n\t" \
1137 @@ -66,7 +66,7 @@
1138 "sb %[tmp4], 3(%[dst]) \n\t" \
1139 "addiu %[dst], %[dst], 4 \n\t" \
1140 ".endif \n\t" \
1141 - ".ifc "#TYPE", uint32_t \n\t" \
1142 + ".ifc " #TYPE ", uint32_t \n\t" \
1143 "sw %[tmp1], 0(%[dst]) \n\t" \
1144 "sw %[tmp2], 4(%[dst]) \n\t" \
1145 "sw %[tmp3], 8(%[dst]) \n\t" \
1146 diff --git a/Source/LibWebP/src/dsp/mips_macro.h b/Source/LibWebP/src/dsp/mips_macro.h
1147 index 4cfb23c..e09d2c4 100644
1148 --- a/Source/LibWebP/src/dsp/mips_macro.h
1149 +++ b/Source/LibWebP/src/dsp/mips_macro.h
1150 @@ -25,25 +25,25 @@
1151 // I - input (macro doesn't change it)
1152 #define ADD_SUB_HALVES(O0, O1, \
1153 I0, I1) \
1154 - "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \
1155 - "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t"
1156 + "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \
1157 + "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t"
1158
1159 // O - output
1160 // I - input (macro doesn't change it)
1161 // I[0/1] - offset in bytes
1162 #define LOAD_IN_X2(O0, O1, \
1163 I0, I1) \
1164 - "lh %["#O0"], "#I0"(%[in]) \n\t" \
1165 - "lh %["#O1"], "#I1"(%[in]) \n\t"
1166 + "lh %[" #O0 "], " #I0 "(%[in]) \n\t" \
1167 + "lh %[" #O1 "], " #I1 "(%[in]) \n\t"
1168
1169 // I0 - location
1170 // I1..I9 - offsets in bytes
1171 #define LOAD_WITH_OFFSET_X4(O0, O1, O2, O3, \
1172 I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) \
1173 - "ulw %["#O0"], "#I1"+"XSTR(I9)"*"#I5"(%["#I0"]) \n\t" \
1174 - "ulw %["#O1"], "#I2"+"XSTR(I9)"*"#I6"(%["#I0"]) \n\t" \
1175 - "ulw %["#O2"], "#I3"+"XSTR(I9)"*"#I7"(%["#I0"]) \n\t" \
1176 - "ulw %["#O3"], "#I4"+"XSTR(I9)"*"#I8"(%["#I0"]) \n\t"
1177 + "ulw %[" #O0 "], " #I1 "+"XSTR(I9)"*" #I5 "(%[" #I0 "]) \n\t" \
1178 + "ulw %[" #O1 "], " #I2 "+"XSTR(I9)"*" #I6 "(%[" #I0 "]) \n\t" \
1179 + "ulw %[" #O2 "], " #I3 "+"XSTR(I9)"*" #I7 "(%[" #I0 "]) \n\t" \
1180 + "ulw %[" #O3 "], " #I4 "+"XSTR(I9)"*" #I8 "(%[" #I0 "]) \n\t"
1181
1182 // O - output
1183 // IO - input/output
1184 @@ -51,42 +51,42 @@
1185 #define MUL_SHIFT_SUM(O0, O1, O2, O3, O4, O5, O6, O7, \
1186 IO0, IO1, IO2, IO3, \
1187 I0, I1, I2, I3, I4, I5, I6, I7) \
1188 - "mul %["#O0"], %["#I0"], %[kC2] \n\t" \
1189 - "mul %["#O1"], %["#I0"], %[kC1] \n\t" \
1190 - "mul %["#O2"], %["#I1"], %[kC2] \n\t" \
1191 - "mul %["#O3"], %["#I1"], %[kC1] \n\t" \
1192 - "mul %["#O4"], %["#I2"], %[kC2] \n\t" \
1193 - "mul %["#O5"], %["#I2"], %[kC1] \n\t" \
1194 - "mul %["#O6"], %["#I3"], %[kC2] \n\t" \
1195 - "mul %["#O7"], %["#I3"], %[kC1] \n\t" \
1196 - "sra %["#O0"], %["#O0"], 16 \n\t" \
1197 - "sra %["#O1"], %["#O1"], 16 \n\t" \
1198 - "sra %["#O2"], %["#O2"], 16 \n\t" \
1199 - "sra %["#O3"], %["#O3"], 16 \n\t" \
1200 - "sra %["#O4"], %["#O4"], 16 \n\t" \
1201 - "sra %["#O5"], %["#O5"], 16 \n\t" \
1202 - "sra %["#O6"], %["#O6"], 16 \n\t" \
1203 - "sra %["#O7"], %["#O7"], 16 \n\t" \
1204 - "addu %["#IO0"], %["#IO0"], %["#I4"] \n\t" \
1205 - "addu %["#IO1"], %["#IO1"], %["#I5"] \n\t" \
1206 - "subu %["#IO2"], %["#IO2"], %["#I6"] \n\t" \
1207 - "subu %["#IO3"], %["#IO3"], %["#I7"] \n\t"
1208 + "mul %[" #O0 "], %[" #I0 "], %[kC2] \n\t" \
1209 + "mul %[" #O1 "], %[" #I0 "], %[kC1] \n\t" \
1210 + "mul %[" #O2 "], %[" #I1 "], %[kC2] \n\t" \
1211 + "mul %[" #O3 "], %[" #I1 "], %[kC1] \n\t" \
1212 + "mul %[" #O4 "], %[" #I2 "], %[kC2] \n\t" \
1213 + "mul %[" #O5 "], %[" #I2 "], %[kC1] \n\t" \
1214 + "mul %[" #O6 "], %[" #I3 "], %[kC2] \n\t" \
1215 + "mul %[" #O7 "], %[" #I3 "], %[kC1] \n\t" \
1216 + "sra %[" #O0 "], %[" #O0 "], 16 \n\t" \
1217 + "sra %[" #O1 "], %[" #O1 "], 16 \n\t" \
1218 + "sra %[" #O2 "], %[" #O2 "], 16 \n\t" \
1219 + "sra %[" #O3 "], %[" #O3 "], 16 \n\t" \
1220 + "sra %[" #O4 "], %[" #O4 "], 16 \n\t" \
1221 + "sra %[" #O5 "], %[" #O5 "], 16 \n\t" \
1222 + "sra %[" #O6 "], %[" #O6 "], 16 \n\t" \
1223 + "sra %[" #O7 "], %[" #O7 "], 16 \n\t" \
1224 + "addu %[" #IO0 "], %[" #IO0 "], %[" #I4 "] \n\t" \
1225 + "addu %[" #IO1 "], %[" #IO1 "], %[" #I5 "] \n\t" \
1226 + "subu %[" #IO2 "], %[" #IO2 "], %[" #I6 "] \n\t" \
1227 + "subu %[" #IO3 "], %[" #IO3 "], %[" #I7 "] \n\t"
1228
1229 // O - output
1230 // I - input (macro doesn't change it)
1231 #define INSERT_HALF_X2(O0, O1, \
1232 I0, I1) \
1233 - "ins %["#O0"], %["#I0"], 16, 16 \n\t" \
1234 - "ins %["#O1"], %["#I1"], 16, 16 \n\t"
1235 + "ins %[" #O0 "], %[" #I0 "], 16, 16 \n\t" \
1236 + "ins %[" #O1 "], %[" #I1 "], 16, 16 \n\t"
1237
1238 // O - output
1239 // I - input (macro doesn't change it)
1240 #define SRA_16(O0, O1, O2, O3, \
1241 I0, I1, I2, I3) \
1242 - "sra %["#O0"], %["#I0"], 16 \n\t" \
1243 - "sra %["#O1"], %["#I1"], 16 \n\t" \
1244 - "sra %["#O2"], %["#I2"], 16 \n\t" \
1245 - "sra %["#O3"], %["#I3"], 16 \n\t"
1246 + "sra %[" #O0 "], %[" #I0 "], 16 \n\t" \
1247 + "sra %[" #O1 "], %[" #I1 "], 16 \n\t" \
1248 + "sra %[" #O2 "], %[" #I2 "], 16 \n\t" \
1249 + "sra %[" #O3 "], %[" #I3 "], 16 \n\t"
1250
1251 // temp0[31..16 | 15..0] = temp8[31..16 | 15..0] + temp12[31..16 | 15..0]
1252 // temp1[31..16 | 15..0] = temp8[31..16 | 15..0] - temp12[31..16 | 15..0]
1253 @@ -96,22 +96,22 @@
1254 // I - input (macro doesn't change it)
1255 #define SHIFT_R_SUM_X2(O0, O1, O2, O3, O4, O5, O6, O7, \
1256 I0, I1, I2, I3, I4, I5, I6, I7) \
1257 - "addq.ph %["#O0"], %["#I0"], %["#I4"] \n\t" \
1258 - "subq.ph %["#O1"], %["#I0"], %["#I4"] \n\t" \
1259 - "addq.ph %["#O2"], %["#I1"], %["#I5"] \n\t" \
1260 - "subq.ph %["#O3"], %["#I1"], %["#I5"] \n\t" \
1261 - "addq.ph %["#O4"], %["#I2"], %["#I6"] \n\t" \
1262 - "subq.ph %["#O5"], %["#I2"], %["#I6"] \n\t" \
1263 - "addq.ph %["#O6"], %["#I3"], %["#I7"] \n\t" \
1264 - "subq.ph %["#O7"], %["#I3"], %["#I7"] \n\t" \
1265 - "shra.ph %["#O0"], %["#O0"], 3 \n\t" \
1266 - "shra.ph %["#O1"], %["#O1"], 3 \n\t" \
1267 - "shra.ph %["#O2"], %["#O2"], 3 \n\t" \
1268 - "shra.ph %["#O3"], %["#O3"], 3 \n\t" \
1269 - "shra.ph %["#O4"], %["#O4"], 3 \n\t" \
1270 - "shra.ph %["#O5"], %["#O5"], 3 \n\t" \
1271 - "shra.ph %["#O6"], %["#O6"], 3 \n\t" \
1272 - "shra.ph %["#O7"], %["#O7"], 3 \n\t"
1273 + "addq.ph %[" #O0 "], %[" #I0 "], %[" #I4 "] \n\t" \
1274 + "subq.ph %[" #O1 "], %[" #I0 "], %[" #I4 "] \n\t" \
1275 + "addq.ph %[" #O2 "], %[" #I1 "], %[" #I5 "] \n\t" \
1276 + "subq.ph %[" #O3 "], %[" #I1 "], %[" #I5 "] \n\t" \
1277 + "addq.ph %[" #O4 "], %[" #I2 "], %[" #I6 "] \n\t" \
1278 + "subq.ph %[" #O5 "], %[" #I2 "], %[" #I6 "] \n\t" \
1279 + "addq.ph %[" #O6 "], %[" #I3 "], %[" #I7 "] \n\t" \
1280 + "subq.ph %[" #O7 "], %[" #I3 "], %[" #I7 "] \n\t" \
1281 + "shra.ph %[" #O0 "], %[" #O0 "], 3 \n\t" \
1282 + "shra.ph %[" #O1 "], %[" #O1 "], 3 \n\t" \
1283 + "shra.ph %[" #O2 "], %[" #O2 "], 3 \n\t" \
1284 + "shra.ph %[" #O3 "], %[" #O3 "], 3 \n\t" \
1285 + "shra.ph %[" #O4 "], %[" #O4 "], 3 \n\t" \
1286 + "shra.ph %[" #O5 "], %[" #O5 "], 3 \n\t" \
1287 + "shra.ph %[" #O6 "], %[" #O6 "], 3 \n\t" \
1288 + "shra.ph %[" #O7 "], %[" #O7 "], 3 \n\t"
1289
1290 // precrq.ph.w temp0, temp8, temp2
1291 // temp0 = temp8[31..16] | temp2[31..16]
1292 @@ -123,14 +123,14 @@
1293 #define PACK_2_HALVES_TO_WORD(O0, O1, O2, O3, \
1294 IO0, IO1, IO2, IO3, \
1295 I0, I1, I2, I3) \
1296 - "precrq.ph.w %["#O0"], %["#I0"], %["#IO0"] \n\t" \
1297 - "precrq.ph.w %["#O1"], %["#I1"], %["#IO1"] \n\t" \
1298 - "ins %["#IO0"], %["#I0"], 16, 16 \n\t" \
1299 - "ins %["#IO1"], %["#I1"], 16, 16 \n\t" \
1300 - "precrq.ph.w %["#O2"], %["#I2"], %["#IO2"] \n\t" \
1301 - "precrq.ph.w %["#O3"], %["#I3"], %["#IO3"] \n\t" \
1302 - "ins %["#IO2"], %["#I2"], 16, 16 \n\t" \
1303 - "ins %["#IO3"], %["#I3"], 16, 16 \n\t"
1304 + "precrq.ph.w %[" #O0 "], %[" #I0 "], %[" #IO0 "] \n\t" \
1305 + "precrq.ph.w %[" #O1 "], %[" #I1 "], %[" #IO1 "] \n\t" \
1306 + "ins %[" #IO0 "], %[" #I0 "], 16, 16 \n\t" \
1307 + "ins %[" #IO1 "], %[" #I1 "], 16, 16 \n\t" \
1308 + "precrq.ph.w %[" #O2 "], %[" #I2 "], %[" #IO2 "] \n\t" \
1309 + "precrq.ph.w %[" #O3 "], %[" #I3 "], %[" #IO3 "] \n\t" \
1310 + "ins %[" #IO2 "], %[" #I2 "], 16, 16 \n\t" \
1311 + "ins %[" #IO3 "], %[" #I3 "], 16, 16 \n\t"
1312
1313 // preceu.ph.qbr temp0, temp8
1314 // temp0 = 0 | 0 | temp8[23..16] | temp8[7..0]
1315 @@ -140,14 +140,14 @@
1316 // I - input (macro doesn't change it)
1317 #define CONVERT_2_BYTES_TO_HALF(O0, O1, O2, O3, O4, O5, O6, O7, \
1318 I0, I1, I2, I3) \
1319 - "preceu.ph.qbr %["#O0"], %["#I0"] \n\t" \
1320 - "preceu.ph.qbl %["#O1"], %["#I0"] \n\t" \
1321 - "preceu.ph.qbr %["#O2"], %["#I1"] \n\t" \
1322 - "preceu.ph.qbl %["#O3"], %["#I1"] \n\t" \
1323 - "preceu.ph.qbr %["#O4"], %["#I2"] \n\t" \
1324 - "preceu.ph.qbl %["#O5"], %["#I2"] \n\t" \
1325 - "preceu.ph.qbr %["#O6"], %["#I3"] \n\t" \
1326 - "preceu.ph.qbl %["#O7"], %["#I3"] \n\t"
1327 + "preceu.ph.qbr %[" #O0 "], %[" #I0 "] \n\t" \
1328 + "preceu.ph.qbl %[" #O1 "], %[" #I0 "] \n\t" \
1329 + "preceu.ph.qbr %[" #O2 "], %[" #I1 "] \n\t" \
1330 + "preceu.ph.qbl %[" #O3 "], %[" #I1 "] \n\t" \
1331 + "preceu.ph.qbr %[" #O4 "], %[" #I2 "] \n\t" \
1332 + "preceu.ph.qbl %[" #O5 "], %[" #I2 "] \n\t" \
1333 + "preceu.ph.qbr %[" #O6 "], %[" #I3 "] \n\t" \
1334 + "preceu.ph.qbl %[" #O7 "], %[" #I3 "] \n\t"
1335
1336 // temp0[31..16 | 15..0] = temp0[31..16 | 15..0] + temp8[31..16 | 15..0]
1337 // temp0[31..16 | 15..0] = temp0[31..16 <<(s) 7 | 15..0 <<(s) 7]
1338 @@ -160,30 +160,30 @@
1339 #define STORE_SAT_SUM_X2(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7, \
1340 I0, I1, I2, I3, I4, I5, I6, I7, \
1341 I8, I9, I10, I11, I12, I13) \
1342 - "addq.ph %["#IO0"], %["#IO0"], %["#I0"] \n\t" \
1343 - "addq.ph %["#IO1"], %["#IO1"], %["#I1"] \n\t" \
1344 - "addq.ph %["#IO2"], %["#IO2"], %["#I2"] \n\t" \
1345 - "addq.ph %["#IO3"], %["#IO3"], %["#I3"] \n\t" \
1346 - "addq.ph %["#IO4"], %["#IO4"], %["#I4"] \n\t" \
1347 - "addq.ph %["#IO5"], %["#IO5"], %["#I5"] \n\t" \
1348 - "addq.ph %["#IO6"], %["#IO6"], %["#I6"] \n\t" \
1349 - "addq.ph %["#IO7"], %["#IO7"], %["#I7"] \n\t" \
1350 - "shll_s.ph %["#IO0"], %["#IO0"], 7 \n\t" \
1351 - "shll_s.ph %["#IO1"], %["#IO1"], 7 \n\t" \
1352 - "shll_s.ph %["#IO2"], %["#IO2"], 7 \n\t" \
1353 - "shll_s.ph %["#IO3"], %["#IO3"], 7 \n\t" \
1354 - "shll_s.ph %["#IO4"], %["#IO4"], 7 \n\t" \
1355 - "shll_s.ph %["#IO5"], %["#IO5"], 7 \n\t" \
1356 - "shll_s.ph %["#IO6"], %["#IO6"], 7 \n\t" \
1357 - "shll_s.ph %["#IO7"], %["#IO7"], 7 \n\t" \
1358 - "precrqu_s.qb.ph %["#IO0"], %["#IO1"], %["#IO0"] \n\t" \
1359 - "precrqu_s.qb.ph %["#IO2"], %["#IO3"], %["#IO2"] \n\t" \
1360 - "precrqu_s.qb.ph %["#IO4"], %["#IO5"], %["#IO4"] \n\t" \
1361 - "precrqu_s.qb.ph %["#IO6"], %["#IO7"], %["#IO6"] \n\t" \
1362 - "usw %["#IO0"], "XSTR(I13)"*"#I9"(%["#I8"]) \n\t" \
1363 - "usw %["#IO2"], "XSTR(I13)"*"#I10"(%["#I8"]) \n\t" \
1364 - "usw %["#IO4"], "XSTR(I13)"*"#I11"(%["#I8"]) \n\t" \
1365 - "usw %["#IO6"], "XSTR(I13)"*"#I12"(%["#I8"]) \n\t"
1366 + "addq.ph %[" #IO0 "], %[" #IO0 "], %[" #I0 "] \n\t" \
1367 + "addq.ph %[" #IO1 "], %[" #IO1 "], %[" #I1 "] \n\t" \
1368 + "addq.ph %[" #IO2 "], %[" #IO2 "], %[" #I2 "] \n\t" \
1369 + "addq.ph %[" #IO3 "], %[" #IO3 "], %[" #I3 "] \n\t" \
1370 + "addq.ph %[" #IO4 "], %[" #IO4 "], %[" #I4 "] \n\t" \
1371 + "addq.ph %[" #IO5 "], %[" #IO5 "], %[" #I5 "] \n\t" \
1372 + "addq.ph %[" #IO6 "], %[" #IO6 "], %[" #I6 "] \n\t" \
1373 + "addq.ph %[" #IO7 "], %[" #IO7 "], %[" #I7 "] \n\t" \
1374 + "shll_s.ph %[" #IO0 "], %[" #IO0 "], 7 \n\t" \
1375 + "shll_s.ph %[" #IO1 "], %[" #IO1 "], 7 \n\t" \
1376 + "shll_s.ph %[" #IO2 "], %[" #IO2 "], 7 \n\t" \
1377 + "shll_s.ph %[" #IO3 "], %[" #IO3 "], 7 \n\t" \
1378 + "shll_s.ph %[" #IO4 "], %[" #IO4 "], 7 \n\t" \
1379 + "shll_s.ph %[" #IO5 "], %[" #IO5 "], 7 \n\t" \
1380 + "shll_s.ph %[" #IO6 "], %[" #IO6 "], 7 \n\t" \
1381 + "shll_s.ph %[" #IO7 "], %[" #IO7 "], 7 \n\t" \
1382 + "precrqu_s.qb.ph %[" #IO0 "], %[" #IO1 "], %[" #IO0 "] \n\t" \
1383 + "precrqu_s.qb.ph %[" #IO2 "], %[" #IO3 "], %[" #IO2 "] \n\t" \
1384 + "precrqu_s.qb.ph %[" #IO4 "], %[" #IO5 "], %[" #IO4 "] \n\t" \
1385 + "precrqu_s.qb.ph %[" #IO6 "], %[" #IO7 "], %[" #IO6 "] \n\t" \
1386 + "usw %[" #IO0 "], "XSTR(I13)"*" #I9 "(%[" #I8 "]) \n\t" \
1387 + "usw %[" #IO2 "], "XSTR(I13)"*" #I10 "(%[" #I8 "]) \n\t" \
1388 + "usw %[" #IO4 "], "XSTR(I13)"*" #I11 "(%[" #I8 "]) \n\t" \
1389 + "usw %[" #IO6 "], "XSTR(I13)"*" #I12 "(%[" #I8 "]) \n\t"
1390
1391 #define OUTPUT_EARLY_CLOBBER_REGS_10() \
1392 : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), \
1393 diff --git a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
1394 index 9c9665f..46f207b 100644
1395 --- a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
1396 +++ b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
1397 @@ -34,15 +34,15 @@
1398 G = G - t2 + kGCst; \
1399 B = B + kBCst; \
1400 __asm__ volatile ( \
1401 - "shll_s.w %["#R"], %["#R"], 9 \n\t" \
1402 - "shll_s.w %["#G"], %["#G"], 9 \n\t" \
1403 - "shll_s.w %["#B"], %["#B"], 9 \n\t" \
1404 - "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \
1405 - "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \
1406 - "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \
1407 - "srl %["#R"], %["#R"], 24 \n\t" \
1408 - "srl %["#G"], %["#G"], 24 \n\t" \
1409 - "srl %["#B"], %["#B"], 24 \n\t" \
1410 + "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \
1411 + "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \
1412 + "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \
1413 + "precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \
1414 + "precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \
1415 + "precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \
1416 + "srl %[" #R "], %[" #R "], 24 \n\t" \
1417 + "srl %[" #G "], %[" #G "], 24 \n\t" \
1418 + "srl %[" #B "], %[" #B "], 24 \n\t" \
1419 : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \
1420 : \
1421 ); \
1422 diff --git a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
1423 index 43f02cc..45a2200 100644
1424 --- a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
1425 +++ b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
1426 @@ -39,12 +39,12 @@
1427 "addu %[temp5], %[temp0], %[temp1] \n\t" \
1428 "subu %[temp6], %[temp0], %[temp2] \n\t" \
1429 "addu %[temp7], %[temp0], %[temp4] \n\t" \
1430 -".if "#K" \n\t" \
1431 +".if " #K " \n\t" \
1432 "lbu %[temp0], 1(%[y]) \n\t" \
1433 ".endif \n\t" \
1434 "shll_s.w %[temp5], %[temp5], 9 \n\t" \
1435 "shll_s.w %[temp6], %[temp6], 9 \n\t" \
1436 -".if "#K" \n\t" \
1437 +".if " #K " \n\t" \
1438 "mul %[temp0], %[t_con_5], %[temp0] \n\t" \
1439 ".endif \n\t" \
1440 "shll_s.w %[temp7], %[temp7], 9 \n\t" \
1441 @@ -54,9 +54,9 @@
1442 "srl %[temp5], %[temp5], 24 \n\t" \
1443 "srl %[temp6], %[temp6], 24 \n\t" \
1444 "srl %[temp7], %[temp7], 24 \n\t" \
1445 - "sb %[temp5], "#R"(%[dst]) \n\t" \
1446 - "sb %[temp6], "#G"(%[dst]) \n\t" \
1447 - "sb %[temp7], "#B"(%[dst]) \n\t" \
1448 + "sb %[temp5], " #R "(%[dst]) \n\t" \
1449 + "sb %[temp6], " #G "(%[dst]) \n\t" \
1450 + "sb %[temp7], " #B "(%[dst]) \n\t" \
1451
1452 #define ASM_CLOBBER_LIST() \
1453 : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \