2 # Copyright 2002,2005 Free Software Foundation, Inc.
4 # This file is part of GNU Radio
6 # GNU Radio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
11 # GNU Radio is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Radio; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street,
19 # Boston, MA 02110-1301, USA.
23 # input and taps are guarenteed to be 16 byte aligned.
24 # n_4_float_blocks is != 0
28 # float_dotprod_generic (const float *input,
29 # const float *taps, unsigned n_4_float_blocks)
38 # sum0 += input[0] * taps[0];
39 # sum1 += input[1] * taps[1];
40 # sum2 += input[2] * taps[2];
41 # sum3 += input[3] * taps[3];
46 # } while (--n_4_float_blocks != 0);
49 # return sum0 + sum1 + sum2 + sum3;
56 .file "float_dotprod_3dnow64.S"
60 .globl GLOB_SYMB(float_dotprod_3dnow)
61 DEF_FUNC_HEAD(float_dotprod_3dnow)
62 GLOB_SYMB(float_dotprod_3dnow):
64 # intput: rdi, taps: rsi, n_2_ccomplex_blocks: rdx
70 pxor %mm4, %mm4 # mm4 = 0 0
71 pxor %mm5, %mm5 # mm5 = 0 0
72 pxor %mm6, %mm6 # mm6 = 0 0
73 pxor %mm7, %mm7 # mm7 = 0 0
75 shr $1, %rax # rax = n_4_float_blocks / 2
84 # something like 6 cycles / loop
111 # We've handled the bulk of multiplies up to here.
112 # Now accumulate the final two additions and see if original
113 # n_4_float_blocks was odd. If so, we've got 4 more
121 # The count was odd, do 4 more taps.
122 # Note that we've already got mm0 and mm1 preloaded
123 # from the main loop.
131 # at this point mm4, mm5, mm6 and mm7 contain partial sums
139 movss -8(%rsp), %xmm0
144 FUNC_TAIL(float_dotprod_3dnow)
145 .ident "Hand coded x86_64 3DNow! assembly"
147 #if defined(__linux__) && defined(__ELF__)
148 .section .note.GNU-stack,"",%progbits