| # SSE2 assist routines for peakval |
| # Copyright 2001 Phil Karn, KA9Q |
| # May be used under the terms of the GNU Public License (GPL) |
| # Find peak absolute value in signed 16-bit input samples |
| # int peakval_sse2(signed short *in,int cnt); |
| .type peakval_sse2,@function |
| pxor %xmm7,%xmm7 # clear peak |
| psraw $15,%xmm1 # xmm1 = 1's if negative, 0's if positive |
| pxor %xmm1,%xmm0 # complement negatives |
| psubw %xmm1,%xmm0 # add 1 to negatives |
| pmaxsw %xmm0,%xmm7 # store peak |
| pmaxsw %xmm0,%xmm7 # min value in low word of %xmm7 |