annotate ffmpeg/libavcodec/mips/sbrdsp_mips.c @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 /*
yading@10 2 * Copyright (c) 2012
yading@10 3 * MIPS Technologies, Inc., California.
yading@10 4 *
yading@10 5 * Redistribution and use in source and binary forms, with or without
yading@10 6 * modification, are permitted provided that the following conditions
yading@10 7 * are met:
yading@10 8 * 1. Redistributions of source code must retain the above copyright
yading@10 9 * notice, this list of conditions and the following disclaimer.
yading@10 10 * 2. Redistributions in binary form must reproduce the above copyright
yading@10 11 * notice, this list of conditions and the following disclaimer in the
yading@10 12 * documentation and/or other materials provided with the distribution.
yading@10 13 * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
yading@10 14 * contributors may be used to endorse or promote products derived from
yading@10 15 * this software without specific prior written permission.
yading@10 16 *
yading@10 17 * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
yading@10 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
yading@10 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
yading@10 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
yading@10 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
yading@10 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
yading@10 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
yading@10 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
yading@10 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
yading@10 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
yading@10 27 * SUCH DAMAGE.
yading@10 28 *
yading@10 29 * Authors: Darko Laus (darko@mips.com)
yading@10 30 * Djordje Pesut (djordje@mips.com)
yading@10 31 * Mirjana Vulin (mvulin@mips.com)
yading@10 32 *
yading@10 33 * AAC Spectral Band Replication decoding functions optimized for MIPS
yading@10 34 *
yading@10 35 * This file is part of FFmpeg.
yading@10 36 *
yading@10 37 * FFmpeg is free software; you can redistribute it and/or
yading@10 38 * modify it under the terms of the GNU Lesser General Public
yading@10 39 * License as published by the Free Software Foundation; either
yading@10 40 * version 2.1 of the License, or (at your option) any later version.
yading@10 41 *
yading@10 42 * FFmpeg is distributed in the hope that it will be useful,
yading@10 43 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@10 44 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@10 45 * Lesser General Public License for more details.
yading@10 46 *
yading@10 47 * You should have received a copy of the GNU Lesser General Public
yading@10 48 * License along with FFmpeg; if not, write to the Free Software
yading@10 49 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@10 50 */
yading@10 51
yading@10 52 /**
yading@10 53 * @file
yading@10 54 * Reference: libavcodec/sbrdsp.c
yading@10 55 */
yading@10 56
yading@10 57 #include "config.h"
yading@10 58 #include "libavcodec/sbrdsp.h"
yading@10 59
yading@10 60 #if HAVE_INLINE_ASM
yading@10 61 static void sbr_neg_odd_64_mips(float *x)
yading@10 62 {
yading@10 63 int Temp1, Temp2, Temp3, Temp4, Temp5;
yading@10 64 float *x1 = &x[1];
yading@10 65 float *x_end = x1 + 64;
yading@10 66
yading@10 67 /* loop unrolled 4 times */
yading@10 68 __asm__ volatile (
yading@10 69 "lui %[Temp5], 0x8000 \n\t"
yading@10 70 "1: \n\t"
yading@10 71 "lw %[Temp1], 0(%[x1]) \n\t"
yading@10 72 "lw %[Temp2], 8(%[x1]) \n\t"
yading@10 73 "lw %[Temp3], 16(%[x1]) \n\t"
yading@10 74 "lw %[Temp4], 24(%[x1]) \n\t"
yading@10 75 "xor %[Temp1], %[Temp1], %[Temp5] \n\t"
yading@10 76 "xor %[Temp2], %[Temp2], %[Temp5] \n\t"
yading@10 77 "xor %[Temp3], %[Temp3], %[Temp5] \n\t"
yading@10 78 "xor %[Temp4], %[Temp4], %[Temp5] \n\t"
yading@10 79 "sw %[Temp1], 0(%[x1]) \n\t"
yading@10 80 "sw %[Temp2], 8(%[x1]) \n\t"
yading@10 81 "sw %[Temp3], 16(%[x1]) \n\t"
yading@10 82 "sw %[Temp4], 24(%[x1]) \n\t"
yading@10 83 "addiu %[x1], %[x1], 32 \n\t"
yading@10 84 "bne %[x1], %[x_end], 1b \n\t"
yading@10 85
yading@10 86 : [Temp1]"=&r"(Temp1), [Temp2]"=&r"(Temp2),
yading@10 87 [Temp3]"=&r"(Temp3), [Temp4]"=&r"(Temp4),
yading@10 88 [Temp5]"=&r"(Temp5), [x1]"+r"(x1)
yading@10 89 : [x_end]"r"(x_end)
yading@10 90 : "memory"
yading@10 91 );
yading@10 92 }
yading@10 93
yading@10 94 static void sbr_qmf_pre_shuffle_mips(float *z)
yading@10 95 {
yading@10 96 int Temp1, Temp2, Temp3, Temp4, Temp5, Temp6;
yading@10 97 float *z1 = &z[66];
yading@10 98 float *z2 = &z[59];
yading@10 99 float *z3 = &z[2];
yading@10 100 float *z4 = z1 + 60;
yading@10 101
yading@10 102 /* loop unrolled 5 times */
yading@10 103 __asm__ volatile (
yading@10 104 "lui %[Temp6], 0x8000 \n\t"
yading@10 105 "1: \n\t"
yading@10 106 "lw %[Temp1], 0(%[z2]) \n\t"
yading@10 107 "lw %[Temp2], 4(%[z2]) \n\t"
yading@10 108 "lw %[Temp3], 8(%[z2]) \n\t"
yading@10 109 "lw %[Temp4], 12(%[z2]) \n\t"
yading@10 110 "lw %[Temp5], 16(%[z2]) \n\t"
yading@10 111 "xor %[Temp1], %[Temp1], %[Temp6] \n\t"
yading@10 112 "xor %[Temp2], %[Temp2], %[Temp6] \n\t"
yading@10 113 "xor %[Temp3], %[Temp3], %[Temp6] \n\t"
yading@10 114 "xor %[Temp4], %[Temp4], %[Temp6] \n\t"
yading@10 115 "xor %[Temp5], %[Temp5], %[Temp6] \n\t"
yading@10 116 "addiu %[z2], %[z2], -20 \n\t"
yading@10 117 "sw %[Temp1], 32(%[z1]) \n\t"
yading@10 118 "sw %[Temp2], 24(%[z1]) \n\t"
yading@10 119 "sw %[Temp3], 16(%[z1]) \n\t"
yading@10 120 "sw %[Temp4], 8(%[z1]) \n\t"
yading@10 121 "sw %[Temp5], 0(%[z1]) \n\t"
yading@10 122 "lw %[Temp1], 0(%[z3]) \n\t"
yading@10 123 "lw %[Temp2], 4(%[z3]) \n\t"
yading@10 124 "lw %[Temp3], 8(%[z3]) \n\t"
yading@10 125 "lw %[Temp4], 12(%[z3]) \n\t"
yading@10 126 "lw %[Temp5], 16(%[z3]) \n\t"
yading@10 127 "sw %[Temp1], 4(%[z1]) \n\t"
yading@10 128 "sw %[Temp2], 12(%[z1]) \n\t"
yading@10 129 "sw %[Temp3], 20(%[z1]) \n\t"
yading@10 130 "sw %[Temp4], 28(%[z1]) \n\t"
yading@10 131 "sw %[Temp5], 36(%[z1]) \n\t"
yading@10 132 "addiu %[z3], %[z3], 20 \n\t"
yading@10 133 "addiu %[z1], %[z1], 40 \n\t"
yading@10 134 "bne %[z1], %[z4], 1b \n\t"
yading@10 135 "lw %[Temp1], 132(%[z]) \n\t"
yading@10 136 "lw %[Temp2], 128(%[z]) \n\t"
yading@10 137 "lw %[Temp3], 0(%[z]) \n\t"
yading@10 138 "lw %[Temp4], 4(%[z]) \n\t"
yading@10 139 "xor %[Temp1], %[Temp1], %[Temp6] \n\t"
yading@10 140 "sw %[Temp1], 504(%[z]) \n\t"
yading@10 141 "sw %[Temp2], 508(%[z]) \n\t"
yading@10 142 "sw %[Temp3], 256(%[z]) \n\t"
yading@10 143 "sw %[Temp4], 260(%[z]) \n\t"
yading@10 144
yading@10 145 : [Temp1]"=&r"(Temp1), [Temp2]"=&r"(Temp2),
yading@10 146 [Temp3]"=&r"(Temp3), [Temp4]"=&r"(Temp4),
yading@10 147 [Temp5]"=&r"(Temp5), [Temp6]"=&r"(Temp6),
yading@10 148 [z1]"+r"(z1), [z2]"+r"(z2), [z3]"+r"(z3)
yading@10 149 : [z4]"r"(z4), [z]"r"(z)
yading@10 150 : "memory"
yading@10 151 );
yading@10 152 }
yading@10 153
yading@10 154 static void sbr_qmf_post_shuffle_mips(float W[32][2], const float *z)
yading@10 155 {
yading@10 156 int Temp1, Temp2, Temp3, Temp4, Temp5;
yading@10 157 float *W_ptr = (float *)W;
yading@10 158 float *z1 = (float *)z;
yading@10 159 float *z2 = (float *)&z[60];
yading@10 160 float *z_end = z1 + 32;
yading@10 161
yading@10 162 /* loop unrolled 4 times */
yading@10 163 __asm__ volatile (
yading@10 164 "lui %[Temp5], 0x8000 \n\t"
yading@10 165 "1: \n\t"
yading@10 166 "lw %[Temp1], 0(%[z2]) \n\t"
yading@10 167 "lw %[Temp2], 4(%[z2]) \n\t"
yading@10 168 "lw %[Temp3], 8(%[z2]) \n\t"
yading@10 169 "lw %[Temp4], 12(%[z2]) \n\t"
yading@10 170 "xor %[Temp1], %[Temp1], %[Temp5] \n\t"
yading@10 171 "xor %[Temp2], %[Temp2], %[Temp5] \n\t"
yading@10 172 "xor %[Temp3], %[Temp3], %[Temp5] \n\t"
yading@10 173 "xor %[Temp4], %[Temp4], %[Temp5] \n\t"
yading@10 174 "addiu %[z2], %[z2], -16 \n\t"
yading@10 175 "sw %[Temp1], 24(%[W_ptr]) \n\t"
yading@10 176 "sw %[Temp2], 16(%[W_ptr]) \n\t"
yading@10 177 "sw %[Temp3], 8(%[W_ptr]) \n\t"
yading@10 178 "sw %[Temp4], 0(%[W_ptr]) \n\t"
yading@10 179 "lw %[Temp1], 0(%[z1]) \n\t"
yading@10 180 "lw %[Temp2], 4(%[z1]) \n\t"
yading@10 181 "lw %[Temp3], 8(%[z1]) \n\t"
yading@10 182 "lw %[Temp4], 12(%[z1]) \n\t"
yading@10 183 "sw %[Temp1], 4(%[W_ptr]) \n\t"
yading@10 184 "sw %[Temp2], 12(%[W_ptr]) \n\t"
yading@10 185 "sw %[Temp3], 20(%[W_ptr]) \n\t"
yading@10 186 "sw %[Temp4], 28(%[W_ptr]) \n\t"
yading@10 187 "addiu %[z1], %[z1], 16 \n\t"
yading@10 188 "addiu %[W_ptr], %[W_ptr], 32 \n\t"
yading@10 189 "bne %[z1], %[z_end], 1b \n\t"
yading@10 190
yading@10 191 : [Temp1]"=&r"(Temp1), [Temp2]"=&r"(Temp2),
yading@10 192 [Temp3]"=&r"(Temp3), [Temp4]"=&r"(Temp4),
yading@10 193 [Temp5]"=&r"(Temp5), [z1]"+r"(z1),
yading@10 194 [z2]"+r"(z2), [W_ptr]"+r"(W_ptr)
yading@10 195 : [z_end]"r"(z_end)
yading@10 196 : "memory"
yading@10 197 );
yading@10 198 }
yading@10 199
yading@10 200 #if HAVE_MIPSFPU
yading@10 201 static void sbr_sum64x5_mips(float *z)
yading@10 202 {
yading@10 203 int k;
yading@10 204 float *z1;
yading@10 205 float f1, f2, f3, f4, f5, f6, f7, f8;
yading@10 206 for (k = 0; k < 64; k += 8) {
yading@10 207
yading@10 208 z1 = &z[k];
yading@10 209
yading@10 210 /* loop unrolled 8 times */
yading@10 211 __asm__ volatile (
yading@10 212 "lwc1 $f0, 0(%[z1]) \n\t"
yading@10 213 "lwc1 $f1, 256(%[z1]) \n\t"
yading@10 214 "lwc1 $f2, 4(%[z1]) \n\t"
yading@10 215 "lwc1 $f3, 260(%[z1]) \n\t"
yading@10 216 "lwc1 $f4, 8(%[z1]) \n\t"
yading@10 217 "add.s %[f1], $f0, $f1 \n\t"
yading@10 218 "lwc1 $f5, 264(%[z1]) \n\t"
yading@10 219 "add.s %[f2], $f2, $f3 \n\t"
yading@10 220 "lwc1 $f6, 12(%[z1]) \n\t"
yading@10 221 "lwc1 $f7, 268(%[z1]) \n\t"
yading@10 222 "add.s %[f3], $f4, $f5 \n\t"
yading@10 223 "lwc1 $f8, 16(%[z1]) \n\t"
yading@10 224 "lwc1 $f9, 272(%[z1]) \n\t"
yading@10 225 "add.s %[f4], $f6, $f7 \n\t"
yading@10 226 "lwc1 $f10, 20(%[z1]) \n\t"
yading@10 227 "lwc1 $f11, 276(%[z1]) \n\t"
yading@10 228 "add.s %[f5], $f8, $f9 \n\t"
yading@10 229 "lwc1 $f12, 24(%[z1]) \n\t"
yading@10 230 "lwc1 $f13, 280(%[z1]) \n\t"
yading@10 231 "add.s %[f6], $f10, $f11 \n\t"
yading@10 232 "lwc1 $f14, 28(%[z1]) \n\t"
yading@10 233 "lwc1 $f15, 284(%[z1]) \n\t"
yading@10 234 "add.s %[f7], $f12, $f13 \n\t"
yading@10 235 "lwc1 $f0, 512(%[z1]) \n\t"
yading@10 236 "lwc1 $f1, 516(%[z1]) \n\t"
yading@10 237 "add.s %[f8], $f14, $f15 \n\t"
yading@10 238 "lwc1 $f2, 520(%[z1]) \n\t"
yading@10 239 "add.s %[f1], %[f1], $f0 \n\t"
yading@10 240 "add.s %[f2], %[f2], $f1 \n\t"
yading@10 241 "lwc1 $f3, 524(%[z1]) \n\t"
yading@10 242 "add.s %[f3], %[f3], $f2 \n\t"
yading@10 243 "lwc1 $f4, 528(%[z1]) \n\t"
yading@10 244 "lwc1 $f5, 532(%[z1]) \n\t"
yading@10 245 "add.s %[f4], %[f4], $f3 \n\t"
yading@10 246 "lwc1 $f6, 536(%[z1]) \n\t"
yading@10 247 "add.s %[f5], %[f5], $f4 \n\t"
yading@10 248 "add.s %[f6], %[f6], $f5 \n\t"
yading@10 249 "lwc1 $f7, 540(%[z1]) \n\t"
yading@10 250 "add.s %[f7], %[f7], $f6 \n\t"
yading@10 251 "lwc1 $f0, 768(%[z1]) \n\t"
yading@10 252 "lwc1 $f1, 772(%[z1]) \n\t"
yading@10 253 "add.s %[f8], %[f8], $f7 \n\t"
yading@10 254 "lwc1 $f2, 776(%[z1]) \n\t"
yading@10 255 "add.s %[f1], %[f1], $f0 \n\t"
yading@10 256 "add.s %[f2], %[f2], $f1 \n\t"
yading@10 257 "lwc1 $f3, 780(%[z1]) \n\t"
yading@10 258 "add.s %[f3], %[f3], $f2 \n\t"
yading@10 259 "lwc1 $f4, 784(%[z1]) \n\t"
yading@10 260 "lwc1 $f5, 788(%[z1]) \n\t"
yading@10 261 "add.s %[f4], %[f4], $f3 \n\t"
yading@10 262 "lwc1 $f6, 792(%[z1]) \n\t"
yading@10 263 "add.s %[f5], %[f5], $f4 \n\t"
yading@10 264 "add.s %[f6], %[f6], $f5 \n\t"
yading@10 265 "lwc1 $f7, 796(%[z1]) \n\t"
yading@10 266 "add.s %[f7], %[f7], $f6 \n\t"
yading@10 267 "lwc1 $f0, 1024(%[z1]) \n\t"
yading@10 268 "lwc1 $f1, 1028(%[z1]) \n\t"
yading@10 269 "add.s %[f8], %[f8], $f7 \n\t"
yading@10 270 "lwc1 $f2, 1032(%[z1]) \n\t"
yading@10 271 "add.s %[f1], %[f1], $f0 \n\t"
yading@10 272 "add.s %[f2], %[f2], $f1 \n\t"
yading@10 273 "lwc1 $f3, 1036(%[z1]) \n\t"
yading@10 274 "add.s %[f3], %[f3], $f2 \n\t"
yading@10 275 "lwc1 $f4, 1040(%[z1]) \n\t"
yading@10 276 "lwc1 $f5, 1044(%[z1]) \n\t"
yading@10 277 "add.s %[f4], %[f4], $f3 \n\t"
yading@10 278 "lwc1 $f6, 1048(%[z1]) \n\t"
yading@10 279 "add.s %[f5], %[f5], $f4 \n\t"
yading@10 280 "add.s %[f6], %[f6], $f5 \n\t"
yading@10 281 "lwc1 $f7, 1052(%[z1]) \n\t"
yading@10 282 "add.s %[f7], %[f7], $f6 \n\t"
yading@10 283 "swc1 %[f1], 0(%[z1]) \n\t"
yading@10 284 "swc1 %[f2], 4(%[z1]) \n\t"
yading@10 285 "add.s %[f8], %[f8], $f7 \n\t"
yading@10 286 "swc1 %[f3], 8(%[z1]) \n\t"
yading@10 287 "swc1 %[f4], 12(%[z1]) \n\t"
yading@10 288 "swc1 %[f5], 16(%[z1]) \n\t"
yading@10 289 "swc1 %[f6], 20(%[z1]) \n\t"
yading@10 290 "swc1 %[f7], 24(%[z1]) \n\t"
yading@10 291 "swc1 %[f8], 28(%[z1]) \n\t"
yading@10 292
yading@10 293 : [f1]"=&f"(f1), [f2]"=&f"(f2), [f3]"=&f"(f3),
yading@10 294 [f4]"=&f"(f4), [f5]"=&f"(f5), [f6]"=&f"(f6),
yading@10 295 [f7]"=&f"(f7), [f8]"=&f"(f8)
yading@10 296 : [z1]"r"(z1)
yading@10 297 : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5",
yading@10 298 "$f6", "$f7", "$f8", "$f9", "$f10", "$f11",
yading@10 299 "$f12", "$f13", "$f14", "$f15",
yading@10 300 "memory"
yading@10 301 );
yading@10 302 }
yading@10 303 }
yading@10 304
yading@10 305 static float sbr_sum_square_mips(float (*x)[2], int n)
yading@10 306 {
yading@10 307 float sum0 = 0.0f, sum1 = 0.0f;
yading@10 308 float *p_x;
yading@10 309 float temp0, temp1, temp2, temp3;
yading@10 310 float *loop_end;
yading@10 311 p_x = &x[0][0];
yading@10 312 loop_end = p_x + (n >> 1)*4 - 4;
yading@10 313
yading@10 314 __asm__ volatile (
yading@10 315 ".set push \n\t"
yading@10 316 ".set noreorder \n\t"
yading@10 317 "lwc1 %[temp0], 0(%[p_x]) \n\t"
yading@10 318 "lwc1 %[temp1], 4(%[p_x]) \n\t"
yading@10 319 "lwc1 %[temp2], 8(%[p_x]) \n\t"
yading@10 320 "lwc1 %[temp3], 12(%[p_x]) \n\t"
yading@10 321 "1: \n\t"
yading@10 322 "addiu %[p_x], %[p_x], 16 \n\t"
yading@10 323 "madd.s %[sum0], %[sum0], %[temp0], %[temp0] \n\t"
yading@10 324 "lwc1 %[temp0], 0(%[p_x]) \n\t"
yading@10 325 "madd.s %[sum1], %[sum1], %[temp1], %[temp1] \n\t"
yading@10 326 "lwc1 %[temp1], 4(%[p_x]) \n\t"
yading@10 327 "madd.s %[sum0], %[sum0], %[temp2], %[temp2] \n\t"
yading@10 328 "lwc1 %[temp2], 8(%[p_x]) \n\t"
yading@10 329 "madd.s %[sum1], %[sum1], %[temp3], %[temp3] \n\t"
yading@10 330 "bne %[p_x], %[loop_end], 1b \n\t"
yading@10 331 " lwc1 %[temp3], 12(%[p_x]) \n\t"
yading@10 332 "madd.s %[sum0], %[sum0], %[temp0], %[temp0] \n\t"
yading@10 333 "madd.s %[sum1], %[sum1], %[temp1], %[temp1] \n\t"
yading@10 334 "madd.s %[sum0], %[sum0], %[temp2], %[temp2] \n\t"
yading@10 335 "madd.s %[sum1], %[sum1], %[temp3], %[temp3] \n\t"
yading@10 336 ".set pop \n\t"
yading@10 337
yading@10 338 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 339 [temp3]"=&f"(temp3), [sum0]"+f"(sum0), [sum1]"+f"(sum1),
yading@10 340 [p_x]"+r"(p_x)
yading@10 341 : [loop_end]"r"(loop_end)
yading@10 342 : "memory"
yading@10 343 );
yading@10 344 return sum0 + sum1;
yading@10 345 }
yading@10 346
yading@10 347 static void sbr_qmf_deint_bfly_mips(float *v, const float *src0, const float *src1)
yading@10 348 {
yading@10 349 int i;
yading@10 350 float temp0, temp1, temp2, temp3, temp4, temp5;
yading@10 351 float temp6, temp7, temp8, temp9, temp10, temp11;
yading@10 352 float *v0 = v;
yading@10 353 float *v1 = &v[127];
yading@10 354 float *psrc0 = (float*)src0;
yading@10 355 float *psrc1 = (float*)&src1[63];
yading@10 356
yading@10 357 for (i = 0; i < 4; i++) {
yading@10 358
yading@10 359 /* loop unrolled 16 times */
yading@10 360 __asm__ volatile(
yading@10 361 "lwc1 %[temp0], 0(%[src0]) \n\t"
yading@10 362 "lwc1 %[temp1], 0(%[src1]) \n\t"
yading@10 363 "lwc1 %[temp3], 4(%[src0]) \n\t"
yading@10 364 "lwc1 %[temp4], -4(%[src1]) \n\t"
yading@10 365 "lwc1 %[temp6], 8(%[src0]) \n\t"
yading@10 366 "lwc1 %[temp7], -8(%[src1]) \n\t"
yading@10 367 "lwc1 %[temp9], 12(%[src0]) \n\t"
yading@10 368 "lwc1 %[temp10], -12(%[src1]) \n\t"
yading@10 369 "add.s %[temp2], %[temp0], %[temp1] \n\t"
yading@10 370 "add.s %[temp5], %[temp3], %[temp4] \n\t"
yading@10 371 "add.s %[temp8], %[temp6], %[temp7] \n\t"
yading@10 372 "add.s %[temp11], %[temp9], %[temp10] \n\t"
yading@10 373 "sub.s %[temp0], %[temp0], %[temp1] \n\t"
yading@10 374 "sub.s %[temp3], %[temp3], %[temp4] \n\t"
yading@10 375 "sub.s %[temp6], %[temp6], %[temp7] \n\t"
yading@10 376 "sub.s %[temp9], %[temp9], %[temp10] \n\t"
yading@10 377 "swc1 %[temp2], 0(%[v1]) \n\t"
yading@10 378 "swc1 %[temp0], 0(%[v0]) \n\t"
yading@10 379 "swc1 %[temp5], -4(%[v1]) \n\t"
yading@10 380 "swc1 %[temp3], 4(%[v0]) \n\t"
yading@10 381 "swc1 %[temp8], -8(%[v1]) \n\t"
yading@10 382 "swc1 %[temp6], 8(%[v0]) \n\t"
yading@10 383 "swc1 %[temp11], -12(%[v1]) \n\t"
yading@10 384 "swc1 %[temp9], 12(%[v0]) \n\t"
yading@10 385 "lwc1 %[temp0], 16(%[src0]) \n\t"
yading@10 386 "lwc1 %[temp1], -16(%[src1]) \n\t"
yading@10 387 "lwc1 %[temp3], 20(%[src0]) \n\t"
yading@10 388 "lwc1 %[temp4], -20(%[src1]) \n\t"
yading@10 389 "lwc1 %[temp6], 24(%[src0]) \n\t"
yading@10 390 "lwc1 %[temp7], -24(%[src1]) \n\t"
yading@10 391 "lwc1 %[temp9], 28(%[src0]) \n\t"
yading@10 392 "lwc1 %[temp10], -28(%[src1]) \n\t"
yading@10 393 "add.s %[temp2], %[temp0], %[temp1] \n\t"
yading@10 394 "add.s %[temp5], %[temp3], %[temp4] \n\t"
yading@10 395 "add.s %[temp8], %[temp6], %[temp7] \n\t"
yading@10 396 "add.s %[temp11], %[temp9], %[temp10] \n\t"
yading@10 397 "sub.s %[temp0], %[temp0], %[temp1] \n\t"
yading@10 398 "sub.s %[temp3], %[temp3], %[temp4] \n\t"
yading@10 399 "sub.s %[temp6], %[temp6], %[temp7] \n\t"
yading@10 400 "sub.s %[temp9], %[temp9], %[temp10] \n\t"
yading@10 401 "swc1 %[temp2], -16(%[v1]) \n\t"
yading@10 402 "swc1 %[temp0], 16(%[v0]) \n\t"
yading@10 403 "swc1 %[temp5], -20(%[v1]) \n\t"
yading@10 404 "swc1 %[temp3], 20(%[v0]) \n\t"
yading@10 405 "swc1 %[temp8], -24(%[v1]) \n\t"
yading@10 406 "swc1 %[temp6], 24(%[v0]) \n\t"
yading@10 407 "swc1 %[temp11], -28(%[v1]) \n\t"
yading@10 408 "swc1 %[temp9], 28(%[v0]) \n\t"
yading@10 409 "lwc1 %[temp0], 32(%[src0]) \n\t"
yading@10 410 "lwc1 %[temp1], -32(%[src1]) \n\t"
yading@10 411 "lwc1 %[temp3], 36(%[src0]) \n\t"
yading@10 412 "lwc1 %[temp4], -36(%[src1]) \n\t"
yading@10 413 "lwc1 %[temp6], 40(%[src0]) \n\t"
yading@10 414 "lwc1 %[temp7], -40(%[src1]) \n\t"
yading@10 415 "lwc1 %[temp9], 44(%[src0]) \n\t"
yading@10 416 "lwc1 %[temp10], -44(%[src1]) \n\t"
yading@10 417 "add.s %[temp2], %[temp0], %[temp1] \n\t"
yading@10 418 "add.s %[temp5], %[temp3], %[temp4] \n\t"
yading@10 419 "add.s %[temp8], %[temp6], %[temp7] \n\t"
yading@10 420 "add.s %[temp11], %[temp9], %[temp10] \n\t"
yading@10 421 "sub.s %[temp0], %[temp0], %[temp1] \n\t"
yading@10 422 "sub.s %[temp3], %[temp3], %[temp4] \n\t"
yading@10 423 "sub.s %[temp6], %[temp6], %[temp7] \n\t"
yading@10 424 "sub.s %[temp9], %[temp9], %[temp10] \n\t"
yading@10 425 "swc1 %[temp2], -32(%[v1]) \n\t"
yading@10 426 "swc1 %[temp0], 32(%[v0]) \n\t"
yading@10 427 "swc1 %[temp5], -36(%[v1]) \n\t"
yading@10 428 "swc1 %[temp3], 36(%[v0]) \n\t"
yading@10 429 "swc1 %[temp8], -40(%[v1]) \n\t"
yading@10 430 "swc1 %[temp6], 40(%[v0]) \n\t"
yading@10 431 "swc1 %[temp11], -44(%[v1]) \n\t"
yading@10 432 "swc1 %[temp9], 44(%[v0]) \n\t"
yading@10 433 "lwc1 %[temp0], 48(%[src0]) \n\t"
yading@10 434 "lwc1 %[temp1], -48(%[src1]) \n\t"
yading@10 435 "lwc1 %[temp3], 52(%[src0]) \n\t"
yading@10 436 "lwc1 %[temp4], -52(%[src1]) \n\t"
yading@10 437 "lwc1 %[temp6], 56(%[src0]) \n\t"
yading@10 438 "lwc1 %[temp7], -56(%[src1]) \n\t"
yading@10 439 "lwc1 %[temp9], 60(%[src0]) \n\t"
yading@10 440 "lwc1 %[temp10], -60(%[src1]) \n\t"
yading@10 441 "add.s %[temp2], %[temp0], %[temp1] \n\t"
yading@10 442 "add.s %[temp5], %[temp3], %[temp4] \n\t"
yading@10 443 "add.s %[temp8], %[temp6], %[temp7] \n\t"
yading@10 444 "add.s %[temp11], %[temp9], %[temp10] \n\t"
yading@10 445 "sub.s %[temp0], %[temp0], %[temp1] \n\t"
yading@10 446 "sub.s %[temp3], %[temp3], %[temp4] \n\t"
yading@10 447 "sub.s %[temp6], %[temp6], %[temp7] \n\t"
yading@10 448 "sub.s %[temp9], %[temp9], %[temp10] \n\t"
yading@10 449 "swc1 %[temp2], -48(%[v1]) \n\t"
yading@10 450 "swc1 %[temp0], 48(%[v0]) \n\t"
yading@10 451 "swc1 %[temp5], -52(%[v1]) \n\t"
yading@10 452 "swc1 %[temp3], 52(%[v0]) \n\t"
yading@10 453 "swc1 %[temp8], -56(%[v1]) \n\t"
yading@10 454 "swc1 %[temp6], 56(%[v0]) \n\t"
yading@10 455 "swc1 %[temp11], -60(%[v1]) \n\t"
yading@10 456 "swc1 %[temp9], 60(%[v0]) \n\t"
yading@10 457 "addiu %[src0], %[src0], 64 \n\t"
yading@10 458 "addiu %[src1], %[src1], -64 \n\t"
yading@10 459 "addiu %[v0], %[v0], 64 \n\t"
yading@10 460 "addiu %[v1], %[v1], -64 \n\t"
yading@10 461
yading@10 462 : [v0]"+r"(v0), [v1]"+r"(v1), [src0]"+r"(psrc0), [src1]"+r"(psrc1),
yading@10 463 [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 464 [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
yading@10 465 [temp6]"=&f"(temp6), [temp7]"=&f"(temp7), [temp8]"=&f"(temp8),
yading@10 466 [temp9]"=&f"(temp9), [temp10]"=&f"(temp10), [temp11]"=&f"(temp11)
yading@10 467 :
yading@10 468 :"memory"
yading@10 469 );
yading@10 470 }
yading@10 471 }
yading@10 472
yading@10 473 static void sbr_autocorrelate_mips(const float x[40][2], float phi[3][2][2])
yading@10 474 {
yading@10 475 int i;
yading@10 476 float real_sum_0 = 0.0f;
yading@10 477 float real_sum_1 = 0.0f;
yading@10 478 float real_sum_2 = 0.0f;
yading@10 479 float imag_sum_1 = 0.0f;
yading@10 480 float imag_sum_2 = 0.0f;
yading@10 481 float *p_x, *p_phi;
yading@10 482 float temp0, temp1, temp2, temp3, temp4, temp5, temp6;
yading@10 483 float temp7, temp_r, temp_r1, temp_r2, temp_r3, temp_r4;
yading@10 484 p_x = (float*)&x[0][0];
yading@10 485 p_phi = &phi[0][0][0];
yading@10 486
yading@10 487 __asm__ volatile (
yading@10 488 "lwc1 %[temp0], 8(%[p_x]) \n\t"
yading@10 489 "lwc1 %[temp1], 12(%[p_x]) \n\t"
yading@10 490 "lwc1 %[temp2], 16(%[p_x]) \n\t"
yading@10 491 "lwc1 %[temp3], 20(%[p_x]) \n\t"
yading@10 492 "lwc1 %[temp4], 24(%[p_x]) \n\t"
yading@10 493 "lwc1 %[temp5], 28(%[p_x]) \n\t"
yading@10 494 "mul.s %[temp_r], %[temp1], %[temp1] \n\t"
yading@10 495 "mul.s %[temp_r1], %[temp1], %[temp3] \n\t"
yading@10 496 "mul.s %[temp_r2], %[temp1], %[temp2] \n\t"
yading@10 497 "mul.s %[temp_r3], %[temp1], %[temp5] \n\t"
yading@10 498 "mul.s %[temp_r4], %[temp1], %[temp4] \n\t"
yading@10 499 "madd.s %[temp_r], %[temp_r], %[temp0], %[temp0] \n\t"
yading@10 500 "madd.s %[temp_r1], %[temp_r1], %[temp0], %[temp2] \n\t"
yading@10 501 "msub.s %[temp_r2], %[temp_r2], %[temp0], %[temp3] \n\t"
yading@10 502 "madd.s %[temp_r3], %[temp_r3], %[temp0], %[temp4] \n\t"
yading@10 503 "msub.s %[temp_r4], %[temp_r4], %[temp0], %[temp5] \n\t"
yading@10 504 "add.s %[real_sum_0], %[real_sum_0], %[temp_r] \n\t"
yading@10 505 "add.s %[real_sum_1], %[real_sum_1], %[temp_r1] \n\t"
yading@10 506 "add.s %[imag_sum_1], %[imag_sum_1], %[temp_r2] \n\t"
yading@10 507 "add.s %[real_sum_2], %[real_sum_2], %[temp_r3] \n\t"
yading@10 508 "add.s %[imag_sum_2], %[imag_sum_2], %[temp_r4] \n\t"
yading@10 509 "addiu %[p_x], %[p_x], 8 \n\t"
yading@10 510
yading@10 511 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 512 [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
yading@10 513 [real_sum_0]"+f"(real_sum_0), [real_sum_1]"+f"(real_sum_1),
yading@10 514 [imag_sum_1]"+f"(imag_sum_1), [real_sum_2]"+f"(real_sum_2),
yading@10 515 [temp_r]"=&f"(temp_r), [temp_r1]"=&f"(temp_r1), [temp_r2]"=&f"(temp_r2),
yading@10 516 [temp_r3]"=&f"(temp_r3), [temp_r4]"=&f"(temp_r4),
yading@10 517 [p_x]"+r"(p_x), [imag_sum_2]"+f"(imag_sum_2)
yading@10 518 :
yading@10 519 : "memory"
yading@10 520 );
yading@10 521
yading@10 522 for (i = 0; i < 12; i++) {
yading@10 523 __asm__ volatile (
yading@10 524 "lwc1 %[temp0], 8(%[p_x]) \n\t"
yading@10 525 "lwc1 %[temp1], 12(%[p_x]) \n\t"
yading@10 526 "lwc1 %[temp2], 16(%[p_x]) \n\t"
yading@10 527 "lwc1 %[temp3], 20(%[p_x]) \n\t"
yading@10 528 "lwc1 %[temp4], 24(%[p_x]) \n\t"
yading@10 529 "lwc1 %[temp5], 28(%[p_x]) \n\t"
yading@10 530 "mul.s %[temp_r], %[temp1], %[temp1] \n\t"
yading@10 531 "mul.s %[temp_r1], %[temp1], %[temp3] \n\t"
yading@10 532 "mul.s %[temp_r2], %[temp1], %[temp2] \n\t"
yading@10 533 "mul.s %[temp_r3], %[temp1], %[temp5] \n\t"
yading@10 534 "mul.s %[temp_r4], %[temp1], %[temp4] \n\t"
yading@10 535 "madd.s %[temp_r], %[temp_r], %[temp0], %[temp0] \n\t"
yading@10 536 "madd.s %[temp_r1], %[temp_r1], %[temp0], %[temp2] \n\t"
yading@10 537 "msub.s %[temp_r2], %[temp_r2], %[temp0], %[temp3] \n\t"
yading@10 538 "madd.s %[temp_r3], %[temp_r3], %[temp0], %[temp4] \n\t"
yading@10 539 "msub.s %[temp_r4], %[temp_r4], %[temp0], %[temp5] \n\t"
yading@10 540 "add.s %[real_sum_0], %[real_sum_0], %[temp_r] \n\t"
yading@10 541 "add.s %[real_sum_1], %[real_sum_1], %[temp_r1] \n\t"
yading@10 542 "add.s %[imag_sum_1], %[imag_sum_1], %[temp_r2] \n\t"
yading@10 543 "add.s %[real_sum_2], %[real_sum_2], %[temp_r3] \n\t"
yading@10 544 "add.s %[imag_sum_2], %[imag_sum_2], %[temp_r4] \n\t"
yading@10 545 "lwc1 %[temp0], 32(%[p_x]) \n\t"
yading@10 546 "lwc1 %[temp1], 36(%[p_x]) \n\t"
yading@10 547 "mul.s %[temp_r], %[temp3], %[temp3] \n\t"
yading@10 548 "mul.s %[temp_r1], %[temp3], %[temp5] \n\t"
yading@10 549 "mul.s %[temp_r2], %[temp3], %[temp4] \n\t"
yading@10 550 "mul.s %[temp_r3], %[temp3], %[temp1] \n\t"
yading@10 551 "mul.s %[temp_r4], %[temp3], %[temp0] \n\t"
yading@10 552 "madd.s %[temp_r], %[temp_r], %[temp2], %[temp2] \n\t"
yading@10 553 "madd.s %[temp_r1], %[temp_r1], %[temp2], %[temp4] \n\t"
yading@10 554 "msub.s %[temp_r2], %[temp_r2], %[temp2], %[temp5] \n\t"
yading@10 555 "madd.s %[temp_r3], %[temp_r3], %[temp2], %[temp0] \n\t"
yading@10 556 "msub.s %[temp_r4], %[temp_r4], %[temp2], %[temp1] \n\t"
yading@10 557 "add.s %[real_sum_0], %[real_sum_0], %[temp_r] \n\t"
yading@10 558 "add.s %[real_sum_1], %[real_sum_1], %[temp_r1] \n\t"
yading@10 559 "add.s %[imag_sum_1], %[imag_sum_1], %[temp_r2] \n\t"
yading@10 560 "add.s %[real_sum_2], %[real_sum_2], %[temp_r3] \n\t"
yading@10 561 "add.s %[imag_sum_2], %[imag_sum_2], %[temp_r4] \n\t"
yading@10 562 "lwc1 %[temp2], 40(%[p_x]) \n\t"
yading@10 563 "lwc1 %[temp3], 44(%[p_x]) \n\t"
yading@10 564 "mul.s %[temp_r], %[temp5], %[temp5] \n\t"
yading@10 565 "mul.s %[temp_r1], %[temp5], %[temp1] \n\t"
yading@10 566 "mul.s %[temp_r2], %[temp5], %[temp0] \n\t"
yading@10 567 "mul.s %[temp_r3], %[temp5], %[temp3] \n\t"
yading@10 568 "mul.s %[temp_r4], %[temp5], %[temp2] \n\t"
yading@10 569 "madd.s %[temp_r], %[temp_r], %[temp4], %[temp4] \n\t"
yading@10 570 "madd.s %[temp_r1], %[temp_r1], %[temp4], %[temp0] \n\t"
yading@10 571 "msub.s %[temp_r2], %[temp_r2], %[temp4], %[temp1] \n\t"
yading@10 572 "madd.s %[temp_r3], %[temp_r3], %[temp4], %[temp2] \n\t"
yading@10 573 "msub.s %[temp_r4], %[temp_r4], %[temp4], %[temp3] \n\t"
yading@10 574 "add.s %[real_sum_0], %[real_sum_0], %[temp_r] \n\t"
yading@10 575 "add.s %[real_sum_1], %[real_sum_1], %[temp_r1] \n\t"
yading@10 576 "add.s %[imag_sum_1], %[imag_sum_1], %[temp_r2] \n\t"
yading@10 577 "add.s %[real_sum_2], %[real_sum_2], %[temp_r3] \n\t"
yading@10 578 "add.s %[imag_sum_2], %[imag_sum_2], %[temp_r4] \n\t"
yading@10 579 "addiu %[p_x], %[p_x], 24 \n\t"
yading@10 580
yading@10 581 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 582 [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
yading@10 583 [real_sum_0]"+f"(real_sum_0), [real_sum_1]"+f"(real_sum_1),
yading@10 584 [imag_sum_1]"+f"(imag_sum_1), [real_sum_2]"+f"(real_sum_2),
yading@10 585 [temp_r]"=&f"(temp_r), [temp_r1]"=&f"(temp_r1),
yading@10 586 [temp_r2]"=&f"(temp_r2), [temp_r3]"=&f"(temp_r3),
yading@10 587 [temp_r4]"=&f"(temp_r4), [p_x]"+r"(p_x),
yading@10 588 [imag_sum_2]"+f"(imag_sum_2)
yading@10 589 :
yading@10 590 : "memory"
yading@10 591 );
yading@10 592 }
yading@10 593 __asm__ volatile (
yading@10 594 "lwc1 %[temp0], -296(%[p_x]) \n\t"
yading@10 595 "lwc1 %[temp1], -292(%[p_x]) \n\t"
yading@10 596 "lwc1 %[temp2], 8(%[p_x]) \n\t"
yading@10 597 "lwc1 %[temp3], 12(%[p_x]) \n\t"
yading@10 598 "lwc1 %[temp4], -288(%[p_x]) \n\t"
yading@10 599 "lwc1 %[temp5], -284(%[p_x]) \n\t"
yading@10 600 "lwc1 %[temp6], -280(%[p_x]) \n\t"
yading@10 601 "lwc1 %[temp7], -276(%[p_x]) \n\t"
yading@10 602 "madd.s %[temp_r], %[real_sum_0], %[temp0], %[temp0] \n\t"
yading@10 603 "madd.s %[temp_r1], %[real_sum_0], %[temp2], %[temp2] \n\t"
yading@10 604 "madd.s %[temp_r2], %[real_sum_1], %[temp0], %[temp4] \n\t"
yading@10 605 "madd.s %[temp_r3], %[imag_sum_1], %[temp0], %[temp5] \n\t"
yading@10 606 "madd.s %[temp_r], %[temp_r], %[temp1], %[temp1] \n\t"
yading@10 607 "madd.s %[temp_r1], %[temp_r1], %[temp3], %[temp3] \n\t"
yading@10 608 "madd.s %[temp_r2], %[temp_r2], %[temp1], %[temp5] \n\t"
yading@10 609 "nmsub.s %[temp_r3], %[temp_r3], %[temp1], %[temp4] \n\t"
yading@10 610 "lwc1 %[temp4], 16(%[p_x]) \n\t"
yading@10 611 "lwc1 %[temp5], 20(%[p_x]) \n\t"
yading@10 612 "swc1 %[temp_r], 40(%[p_phi]) \n\t"
yading@10 613 "swc1 %[temp_r1], 16(%[p_phi]) \n\t"
yading@10 614 "swc1 %[temp_r2], 24(%[p_phi]) \n\t"
yading@10 615 "swc1 %[temp_r3], 28(%[p_phi]) \n\t"
yading@10 616 "madd.s %[temp_r], %[real_sum_1], %[temp2], %[temp4] \n\t"
yading@10 617 "madd.s %[temp_r1], %[imag_sum_1], %[temp2], %[temp5] \n\t"
yading@10 618 "madd.s %[temp_r2], %[real_sum_2], %[temp0], %[temp6] \n\t"
yading@10 619 "madd.s %[temp_r3], %[imag_sum_2], %[temp0], %[temp7] \n\t"
yading@10 620 "madd.s %[temp_r], %[temp_r], %[temp3], %[temp5] \n\t"
yading@10 621 "nmsub.s %[temp_r1], %[temp_r1], %[temp3], %[temp4] \n\t"
yading@10 622 "madd.s %[temp_r2], %[temp_r2], %[temp1], %[temp7] \n\t"
yading@10 623 "nmsub.s %[temp_r3], %[temp_r3], %[temp1], %[temp6] \n\t"
yading@10 624 "swc1 %[temp_r], 0(%[p_phi]) \n\t"
yading@10 625 "swc1 %[temp_r1], 4(%[p_phi]) \n\t"
yading@10 626 "swc1 %[temp_r2], 8(%[p_phi]) \n\t"
yading@10 627 "swc1 %[temp_r3], 12(%[p_phi]) \n\t"
yading@10 628
yading@10 629 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 630 [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
yading@10 631 [temp6]"=&f"(temp6), [temp7]"=&f"(temp7), [temp_r]"=&f"(temp_r),
yading@10 632 [real_sum_0]"+f"(real_sum_0), [real_sum_1]"+f"(real_sum_1),
yading@10 633 [real_sum_2]"+f"(real_sum_2), [imag_sum_1]"+f"(imag_sum_1),
yading@10 634 [temp_r2]"=&f"(temp_r2), [temp_r3]"=&f"(temp_r3),
yading@10 635 [temp_r1]"=&f"(temp_r1), [p_phi]"+r"(p_phi),
yading@10 636 [imag_sum_2]"+f"(imag_sum_2)
yading@10 637 : [p_x]"r"(p_x)
yading@10 638 : "memory"
yading@10 639 );
yading@10 640 }
yading@10 641
yading@10 642 static void sbr_hf_gen_mips(float (*X_high)[2], const float (*X_low)[2],
yading@10 643 const float alpha0[2], const float alpha1[2],
yading@10 644 float bw, int start, int end)
yading@10 645 {
yading@10 646 float alpha[4];
yading@10 647 int i;
yading@10 648 float *p_x_low = (float*)&X_low[0][0] + 2*start;
yading@10 649 float *p_x_high = &X_high[0][0] + 2*start;
yading@10 650 float temp0, temp1, temp2, temp3, temp4, temp5, temp6;
yading@10 651 float temp7, temp8, temp9, temp10, temp11, temp12;
yading@10 652
yading@10 653 alpha[0] = alpha1[0] * bw * bw;
yading@10 654 alpha[1] = alpha1[1] * bw * bw;
yading@10 655 alpha[2] = alpha0[0] * bw;
yading@10 656 alpha[3] = alpha0[1] * bw;
yading@10 657
yading@10 658 for (i = start; i < end; i++) {
yading@10 659 __asm__ volatile (
yading@10 660 "lwc1 %[temp0], -16(%[p_x_low]) \n\t"
yading@10 661 "lwc1 %[temp1], -12(%[p_x_low]) \n\t"
yading@10 662 "lwc1 %[temp2], -8(%[p_x_low]) \n\t"
yading@10 663 "lwc1 %[temp3], -4(%[p_x_low]) \n\t"
yading@10 664 "lwc1 %[temp5], 0(%[p_x_low]) \n\t"
yading@10 665 "lwc1 %[temp6], 4(%[p_x_low]) \n\t"
yading@10 666 "lwc1 %[temp7], 0(%[alpha]) \n\t"
yading@10 667 "lwc1 %[temp8], 4(%[alpha]) \n\t"
yading@10 668 "lwc1 %[temp9], 8(%[alpha]) \n\t"
yading@10 669 "lwc1 %[temp10], 12(%[alpha]) \n\t"
yading@10 670 "addiu %[p_x_high], %[p_x_high], 8 \n\t"
yading@10 671 "addiu %[p_x_low], %[p_x_low], 8 \n\t"
yading@10 672 "mul.s %[temp11], %[temp1], %[temp8] \n\t"
yading@10 673 "msub.s %[temp11], %[temp11], %[temp0], %[temp7] \n\t"
yading@10 674 "madd.s %[temp11], %[temp11], %[temp2], %[temp9] \n\t"
yading@10 675 "nmsub.s %[temp11], %[temp11], %[temp3], %[temp10] \n\t"
yading@10 676 "add.s %[temp11], %[temp11], %[temp5] \n\t"
yading@10 677 "swc1 %[temp11], -8(%[p_x_high]) \n\t"
yading@10 678 "mul.s %[temp12], %[temp1], %[temp7] \n\t"
yading@10 679 "madd.s %[temp12], %[temp12], %[temp0], %[temp8] \n\t"
yading@10 680 "madd.s %[temp12], %[temp12], %[temp3], %[temp9] \n\t"
yading@10 681 "madd.s %[temp12], %[temp12], %[temp2], %[temp10] \n\t"
yading@10 682 "add.s %[temp12], %[temp12], %[temp6] \n\t"
yading@10 683 "swc1 %[temp12], -4(%[p_x_high]) \n\t"
yading@10 684
yading@10 685 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 686 [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
yading@10 687 [temp6]"=&f"(temp6), [temp7]"=&f"(temp7), [temp8]"=&f"(temp8),
yading@10 688 [temp9]"=&f"(temp9), [temp10]"=&f"(temp10), [temp11]"=&f"(temp11),
yading@10 689 [temp12]"=&f"(temp12), [p_x_high]"+r"(p_x_high),
yading@10 690 [p_x_low]"+r"(p_x_low)
yading@10 691 : [alpha]"r"(alpha)
yading@10 692 : "memory"
yading@10 693 );
yading@10 694 }
yading@10 695 }
yading@10 696
yading@10 697 static void sbr_hf_g_filt_mips(float (*Y)[2], const float (*X_high)[40][2],
yading@10 698 const float *g_filt, int m_max, intptr_t ixh)
yading@10 699 {
yading@10 700 float *p_y, *p_x, *p_g;
yading@10 701 float temp0, temp1, temp2;
yading@10 702 int loop_end;
yading@10 703
yading@10 704 p_g = (float*)&g_filt[0];
yading@10 705 p_y = &Y[0][0];
yading@10 706 p_x = (float*)&X_high[0][ixh][0];
yading@10 707 loop_end = (int)((int*)p_g + m_max);
yading@10 708
yading@10 709 __asm__ volatile(
yading@10 710 ".set push \n\t"
yading@10 711 ".set noreorder \n\t"
yading@10 712 "1: \n\t"
yading@10 713 "lwc1 %[temp0], 0(%[p_g]) \n\t"
yading@10 714 "lwc1 %[temp1], 0(%[p_x]) \n\t"
yading@10 715 "lwc1 %[temp2], 4(%[p_x]) \n\t"
yading@10 716 "mul.s %[temp1], %[temp1], %[temp0] \n\t"
yading@10 717 "mul.s %[temp2], %[temp2], %[temp0] \n\t"
yading@10 718 "addiu %[p_g], %[p_g], 4 \n\t"
yading@10 719 "addiu %[p_x], %[p_x], 320 \n\t"
yading@10 720 "swc1 %[temp1], 0(%[p_y]) \n\t"
yading@10 721 "swc1 %[temp2], 4(%[p_y]) \n\t"
yading@10 722 "bne %[p_g], %[loop_end], 1b \n\t"
yading@10 723 " addiu %[p_y], %[p_y], 8 \n\t"
yading@10 724 ".set pop \n\t"
yading@10 725
yading@10 726 : [temp0]"=&f"(temp0), [temp1]"=&f"(temp1),
yading@10 727 [temp2]"=&f"(temp2), [p_x]"+r"(p_x),
yading@10 728 [p_y]"+r"(p_y), [p_g]"+r"(p_g)
yading@10 729 : [loop_end]"r"(loop_end)
yading@10 730 : "memory"
yading@10 731 );
yading@10 732 }
yading@10 733
yading@10 734 static void sbr_hf_apply_noise_0_mips(float (*Y)[2], const float *s_m,
yading@10 735 const float *q_filt, int noise,
yading@10 736 int kx, int m_max)
yading@10 737 {
yading@10 738 int m;
yading@10 739
yading@10 740 for (m = 0; m < m_max; m++){
yading@10 741
yading@10 742 float *Y1=&Y[m][0];
yading@10 743 float *ff_table;
yading@10 744 float y0,y1, temp1, temp2, temp4, temp5;
yading@10 745 int temp0, temp3;
yading@10 746 const float *s_m1=&s_m[m];
yading@10 747 const float *q_filt1= &q_filt[m];
yading@10 748
yading@10 749 __asm__ volatile(
yading@10 750 "lwc1 %[y0], 0(%[Y1]) \n\t"
yading@10 751 "lwc1 %[temp1], 0(%[s_m1]) \n\t"
yading@10 752 "addiu %[noise], %[noise], 1 \n\t"
yading@10 753 "andi %[noise], %[noise], 0x1ff \n\t"
yading@10 754 "sll %[temp0], %[noise], 3 \n\t"
yading@10 755 "addu %[ff_table], %[ff_sbr_noise_table], %[temp0] \n\t"
yading@10 756 "add.s %[y0], %[y0], %[temp1] \n\t"
yading@10 757 "mfc1 %[temp3], %[temp1] \n\t"
yading@10 758 "bne %[temp3], $0, 1f \n\t"
yading@10 759 "lwc1 %[y1], 4(%[Y1]) \n\t"
yading@10 760 "lwc1 %[temp2], 0(%[q_filt1]) \n\t"
yading@10 761 "lwc1 %[temp4], 0(%[ff_table]) \n\t"
yading@10 762 "lwc1 %[temp5], 4(%[ff_table]) \n\t"
yading@10 763 "madd.s %[y0], %[y0], %[temp2], %[temp4] \n\t"
yading@10 764 "madd.s %[y1], %[y1], %[temp2], %[temp5] \n\t"
yading@10 765 "swc1 %[y1], 4(%[Y1]) \n\t"
yading@10 766 "1: \n\t"
yading@10 767 "swc1 %[y0], 0(%[Y1]) \n\t"
yading@10 768
yading@10 769 : [ff_table]"=&r"(ff_table), [y0]"=&f"(y0), [y1]"=&f"(y1),
yading@10 770 [temp0]"=&r"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 771 [temp3]"=&r"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5)
yading@10 772 : [ff_sbr_noise_table]"r"(ff_sbr_noise_table), [noise]"r"(noise),
yading@10 773 [Y1]"r"(Y1), [s_m1]"r"(s_m1), [q_filt1]"r"(q_filt1)
yading@10 774 : "memory"
yading@10 775 );
yading@10 776 }
yading@10 777 }
yading@10 778
yading@10 779 static void sbr_hf_apply_noise_1_mips(float (*Y)[2], const float *s_m,
yading@10 780 const float *q_filt, int noise,
yading@10 781 int kx, int m_max)
yading@10 782 {
yading@10 783 float y0,y1,temp1, temp2, temp4, temp5;
yading@10 784 int temp0, temp3, m;
yading@10 785 float phi_sign = 1 - 2 * (kx & 1);
yading@10 786
yading@10 787 for (m = 0; m < m_max; m++) {
yading@10 788
yading@10 789 float *ff_table;
yading@10 790 float *Y1=&Y[m][0];
yading@10 791 const float *s_m1=&s_m[m];
yading@10 792 const float *q_filt1= &q_filt[m];
yading@10 793
yading@10 794 __asm__ volatile(
yading@10 795 "lwc1 %[y1], 4(%[Y1]) \n\t"
yading@10 796 "lwc1 %[temp1], 0(%[s_m1]) \n\t"
yading@10 797 "lw %[temp3], 0(%[s_m1]) \n\t"
yading@10 798 "addiu %[noise], %[noise], 1 \n\t"
yading@10 799 "andi %[noise], %[noise], 0x1ff \n\t"
yading@10 800 "sll %[temp0], %[noise], 3 \n\t"
yading@10 801 "addu %[ff_table], %[ff_sbr_noise_table], %[temp0] \n\t"
yading@10 802 "madd.s %[y1], %[y1], %[temp1], %[phi_sign] \n\t"
yading@10 803 "bne %[temp3], $0, 1f \n\t"
yading@10 804 "lwc1 %[y0], 0(%[Y1]) \n\t"
yading@10 805 "lwc1 %[temp2], 0(%[q_filt1]) \n\t"
yading@10 806 "lwc1 %[temp4], 0(%[ff_table]) \n\t"
yading@10 807 "lwc1 %[temp5], 4(%[ff_table]) \n\t"
yading@10 808 "madd.s %[y0], %[y0], %[temp2], %[temp4] \n\t"
yading@10 809 "madd.s %[y1], %[y1], %[temp2], %[temp5] \n\t"
yading@10 810 "swc1 %[y0], 0(%[Y1]) \n\t"
yading@10 811 "1: \n\t"
yading@10 812 "swc1 %[y1], 4(%[Y1]) \n\t"
yading@10 813
yading@10 814 : [ff_table] "=&r" (ff_table), [y0] "=&f" (y0), [y1] "=&f" (y1),
yading@10 815 [temp0] "=&r" (temp0), [temp1] "=&f" (temp1), [temp2] "=&f" (temp2),
yading@10 816 [temp3] "=&r" (temp3), [temp4] "=&f" (temp4), [temp5] "=&f" (temp5)
yading@10 817 : [ff_sbr_noise_table] "r" (ff_sbr_noise_table), [noise] "r" (noise),
yading@10 818 [Y1] "r" (Y1), [s_m1] "r" (s_m1), [q_filt1] "r" (q_filt1),
yading@10 819 [phi_sign] "f" (phi_sign)
yading@10 820 : "memory"
yading@10 821 );
yading@10 822 phi_sign = -phi_sign;
yading@10 823 }
yading@10 824 }
yading@10 825
yading@10 826 static void sbr_hf_apply_noise_2_mips(float (*Y)[2], const float *s_m,
yading@10 827 const float *q_filt, int noise,
yading@10 828 int kx, int m_max)
yading@10 829 {
yading@10 830 int m;
yading@10 831 float *ff_table;
yading@10 832 float y0,y1, temp0, temp1, temp2, temp3, temp4, temp5;
yading@10 833
yading@10 834 for (m = 0; m < m_max; m++) {
yading@10 835
yading@10 836 float *Y1=&Y[m][0];
yading@10 837 const float *s_m1=&s_m[m];
yading@10 838 const float *q_filt1= &q_filt[m];
yading@10 839
yading@10 840 __asm__ volatile(
yading@10 841 "lwc1 %[y0], 0(%[Y1]) \n\t"
yading@10 842 "lwc1 %[temp1], 0(%[s_m1]) \n\t"
yading@10 843 "addiu %[noise], %[noise], 1 \n\t"
yading@10 844 "andi %[noise], %[noise], 0x1ff \n\t"
yading@10 845 "sll %[temp0], %[noise], 3 \n\t"
yading@10 846 "addu %[ff_table], %[ff_sbr_noise_table], %[temp0] \n\t"
yading@10 847 "sub.s %[y0], %[y0], %[temp1] \n\t"
yading@10 848 "mfc1 %[temp3], %[temp1] \n\t"
yading@10 849 "bne %[temp3], $0, 1f \n\t"
yading@10 850 "lwc1 %[y1], 4(%[Y1]) \n\t"
yading@10 851 "lwc1 %[temp2], 0(%[q_filt1]) \n\t"
yading@10 852 "lwc1 %[temp4], 0(%[ff_table]) \n\t"
yading@10 853 "lwc1 %[temp5], 4(%[ff_table]) \n\t"
yading@10 854 "madd.s %[y0], %[y0], %[temp2], %[temp4] \n\t"
yading@10 855 "madd.s %[y1], %[y1], %[temp2], %[temp5] \n\t"
yading@10 856 "swc1 %[y1], 4(%[Y1]) \n\t"
yading@10 857 "1: \n\t"
yading@10 858 "swc1 %[y0], 0(%[Y1]) \n\t"
yading@10 859
yading@10 860 : [temp0]"=&r"(temp0), [ff_table]"=&r"(ff_table), [y0]"=&f"(y0),
yading@10 861 [y1]"=&f"(y1), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 862 [temp3]"=&r"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5)
yading@10 863 : [ff_sbr_noise_table]"r"(ff_sbr_noise_table), [noise]"r"(noise),
yading@10 864 [Y1]"r"(Y1), [s_m1]"r"(s_m1), [q_filt1]"r"(q_filt1)
yading@10 865 : "memory"
yading@10 866 );
yading@10 867 }
yading@10 868 }
yading@10 869
yading@10 870 static void sbr_hf_apply_noise_3_mips(float (*Y)[2], const float *s_m,
yading@10 871 const float *q_filt, int noise,
yading@10 872 int kx, int m_max)
yading@10 873 {
yading@10 874 float phi_sign = 1 - 2 * (kx & 1);
yading@10 875 int m;
yading@10 876
yading@10 877 for (m = 0; m < m_max; m++) {
yading@10 878
yading@10 879 float *Y1=&Y[m][0];
yading@10 880 float *ff_table;
yading@10 881 float y0,y1, temp1, temp2, temp4, temp5;
yading@10 882 int temp0, temp3;
yading@10 883 const float *s_m1=&s_m[m];
yading@10 884 const float *q_filt1= &q_filt[m];
yading@10 885
yading@10 886 __asm__ volatile(
yading@10 887 "lwc1 %[y1], 4(%[Y1]) \n\t"
yading@10 888 "lwc1 %[temp1], 0(%[s_m1]) \n\t"
yading@10 889 "addiu %[noise], %[noise], 1 \n\t"
yading@10 890 "andi %[noise], %[noise], 0x1ff \n\t"
yading@10 891 "sll %[temp0], %[noise], 3 \n\t"
yading@10 892 "addu %[ff_table], %[ff_sbr_noise_table], %[temp0] \n\t"
yading@10 893 "nmsub.s %[y1], %[y1], %[temp1], %[phi_sign] \n\t"
yading@10 894 "mfc1 %[temp3], %[temp1] \n\t"
yading@10 895 "bne %[temp3], $0, 1f \n\t"
yading@10 896 "lwc1 %[y0], 0(%[Y1]) \n\t"
yading@10 897 "lwc1 %[temp2], 0(%[q_filt1]) \n\t"
yading@10 898 "lwc1 %[temp4], 0(%[ff_table]) \n\t"
yading@10 899 "lwc1 %[temp5], 4(%[ff_table]) \n\t"
yading@10 900 "madd.s %[y0], %[y0], %[temp2], %[temp4] \n\t"
yading@10 901 "madd.s %[y1], %[y1], %[temp2], %[temp5] \n\t"
yading@10 902 "swc1 %[y0], 0(%[Y1]) \n\t"
yading@10 903 "1: \n\t"
yading@10 904 "swc1 %[y1], 4(%[Y1]) \n\t"
yading@10 905
yading@10 906 : [ff_table]"=&r"(ff_table), [y0]"=&f"(y0), [y1]"=&f"(y1),
yading@10 907 [temp0]"=&r"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
yading@10 908 [temp3]"=&r"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5)
yading@10 909 : [ff_sbr_noise_table]"r"(ff_sbr_noise_table), [noise]"r"(noise),
yading@10 910 [Y1]"r"(Y1), [s_m1]"r"(s_m1), [q_filt1]"r"(q_filt1),
yading@10 911 [phi_sign]"f"(phi_sign)
yading@10 912 : "memory"
yading@10 913 );
yading@10 914 phi_sign = -phi_sign;
yading@10 915 }
yading@10 916 }
yading@10 917 #endif /* HAVE_MIPSFPU */
yading@10 918 #endif /* HAVE_INLINE_ASM */
yading@10 919
yading@10 920 void ff_sbrdsp_init_mips(SBRDSPContext *s)
yading@10 921 {
yading@10 922 #if HAVE_INLINE_ASM
yading@10 923 s->neg_odd_64 = sbr_neg_odd_64_mips;
yading@10 924 s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_mips;
yading@10 925 s->qmf_post_shuffle = sbr_qmf_post_shuffle_mips;
yading@10 926 #if HAVE_MIPSFPU
yading@10 927 s->sum64x5 = sbr_sum64x5_mips;
yading@10 928 s->sum_square = sbr_sum_square_mips;
yading@10 929 s->qmf_deint_bfly = sbr_qmf_deint_bfly_mips;
yading@10 930 s->autocorrelate = sbr_autocorrelate_mips;
yading@10 931 s->hf_gen = sbr_hf_gen_mips;
yading@10 932 s->hf_g_filt = sbr_hf_g_filt_mips;
yading@10 933
yading@10 934 s->hf_apply_noise[0] = sbr_hf_apply_noise_0_mips;
yading@10 935 s->hf_apply_noise[1] = sbr_hf_apply_noise_1_mips;
yading@10 936 s->hf_apply_noise[2] = sbr_hf_apply_noise_2_mips;
yading@10 937 s->hf_apply_noise[3] = sbr_hf_apply_noise_3_mips;
yading@10 938 #endif /* HAVE_MIPSFPU */
yading@10 939 #endif /* HAVE_INLINE_ASM */
yading@10 940 }