home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Priss / source / a64_polyphase.asm next >
Encoding:
Assembly Source File  |  2009-09-14  |  14.2 KB  |  422 lines

  1. ;    Priss (NekoAmp 2.0) - MPEG-1/2 audio decoding library
  2. ;    Copyright (C) 2003-2004 Avery Lee
  3. ;
  4. ;    This program is free software; you can redistribute it and/or modify
  5. ;    it under the terms of the GNU General Public License as published by
  6. ;    the Free Software Foundation; either version 2 of the License, or
  7. ;    (at your option) any later version.
  8. ;
  9. ;    This program is distributed in the hope that it will be useful,
  10. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;    GNU General Public License for more details.
  13. ;
  14. ;    You should have received a copy of the GNU General Public License    
  15. ;    along with this program; if not, write to the Free Software
  16. ;    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.     default    rel
  19.     segment    .rdata, align=16
  20.  
  21.         align 16
  22. c2        dd    0.92387953251128674,0.92387953251128674,0.92387953251128674,0.92387953251128674
  23. c4        dd    0.70710678118654757,0.70710678118654757,0.70710678118654757,0.70710678118654757
  24. c6        dd    0.38268343236508984,0.38268343236508984,0.38268343236508984,0.38268343236508984
  25.  
  26. ; [1 .5 .5 -.5 .5 .5 .5 .5] ./ cos(pi*[0 5 6 1 4 7 2 3]/16)
  27. d        dd    +1.00000000000000,+1.00000000000000,+1.00000000000000,+1.00000000000000
  28.         dd    +0.89997622313642,+0.89997622313642,+0.89997622313642,+0.89997622313642
  29.         dd    +1.30656296487638,+1.30656296487638,+1.30656296487638,+1.30656296487638
  30.         dd    -0.50979557910416,-0.50979557910416,-0.50979557910416,-0.50979557910416
  31.         dd    +0.70710678118655,+0.70710678118655,+0.70710678118655,+0.70710678118655
  32.         dd    +2.56291544774151,+2.56291544774151,+2.56291544774151,+2.56291544774151
  33.         dd    +0.54119610014620,+0.54119610014620,+0.54119610014620,+0.54119610014620
  34.         dd    +0.60134488693505,+0.60134488693505,+0.60134488693505,+0.60134488693505
  35.  
  36. invother    dd    0, 80000000h, 0, 80000000h
  37. invall        dd    80000000h, 80000000h, 80000000h, 80000000h
  38.  
  39.         extern    leecoef1 : far
  40.         extern    leecoef2 : far
  41.  
  42.     segment    .text
  43.  
  44.     global    vdasm_mpegaudio_polyphase_dctinputbutterflies
  45. vdasm_mpegaudio_polyphase_dctinputbutterflies:
  46.         xor        r9, r9
  47.         mov        r8, 48
  48.         lea        r10, [leecoef1]
  49.         lea        r11, [leecoef2]
  50. .xloop:
  51.         movups    xmm0, [rdx+r9]            ;xmm0 = in[i]
  52.         movups    xmm1, [rdx+r8]            ;xmm1 = in[15-i]
  53.         movups    xmm2, [rdx+r9+64]        ;xmm2 = in[i+16]
  54.         movups    xmm3, [rdx+r8+64]        ;xmm3 = in[31-i]
  55.         shufps    xmm1, xmm1, 00011011b
  56.         shufps    xmm3, xmm3, 00011011b
  57.  
  58.         ;butterfly for first decomposition
  59.         movaps    xmm4, xmm0
  60.         movaps    xmm5, xmm1
  61.         addps    xmm0, xmm3                ;xmm0 = y0 = x0+x3
  62.         addps    xmm1, xmm2                ;xmm1 = y1 = x1+x2
  63.         subps    xmm4, xmm3                ;xmm4 = y2 = x0-x3
  64.         subps    xmm5, xmm2                ;xmm5 = y3 = x1-x2
  65.         mulps    xmm4, [r10+r9]
  66.         mulps    xmm5, [r10+r9+32]
  67.  
  68.         ;butterfly for second decomposition
  69.         movaps    xmm2, xmm0
  70.         movaps    xmm3, xmm4
  71.         addps    xmm0, xmm1                ;xmm0 = z0 = y0+y1
  72.         subps    xmm2, xmm1                ;xmm2 = z1 = y0-y1
  73.         addps    xmm3, xmm5                ;xmm3 = z2 = y2+y3
  74.         subps    xmm4, xmm5                ;xmm4 = z3 = y2-y3
  75.         mulps    xmm2, [r11+r9]
  76.         mulps    xmm4, [r11+r9]
  77.  
  78.         ;interleave in 0-2-1-3 order
  79.         movaps        xmm1, xmm0
  80.         unpcklps    xmm0, xmm3            ;xmm0 = z2B | z0B | z2A | z0A
  81.         unpckhps    xmm1, xmm3            ;xmm1 = z2D | z0D | z2C | z0C
  82.         movaps        xmm3, xmm2
  83.         unpcklps    xmm2, xmm4            ;xmm2 = z3B | z1B | z3A | z1A
  84.         unpckhps    xmm3, xmm4            ;xmm3 = z3D | z1D | z3C | z1C
  85.  
  86.         movlps    qword [rcx   ], xmm0
  87.         movlps    qword [rcx+ 8], xmm2
  88.         movhps    qword [rcx+16], xmm0
  89.         movhps    qword [rcx+24], xmm2
  90.         movlps    qword [rcx+32], xmm1
  91.         movlps    qword [rcx+40], xmm3
  92.         movhps    qword [rcx+48], xmm1
  93.         movhps    qword [rcx+56], xmm3
  94.  
  95.         add        rcx, 64
  96.         add        r9, 16
  97.         sub        r8, 16
  98.         cmp        r9, r8
  99.         jb        .xloop
  100.         ret
  101.  
  102.  
  103.     global    vdasm_mpegaudio_polyphase_dct4x8
  104. vdasm_mpegaudio_polyphase_dct4x8:
  105. ;    See the FPU version to get an idea of the flow of this AAN
  106. ;    implementation.  Note that we do all four DCTs in parallel!
  107.  
  108.         movlhps    xmm14, xmm6
  109.         movlhps    xmm15, xmm7
  110.  
  111.         ;even part - B3 (4a)
  112.         movaps    xmm0, [rcx+0*16]        ;xmm0 = s[0]
  113.         movaps    xmm1, [rcx+1*16]        ;xmm1 = s[1]
  114.         movaps    xmm2, [rcx+2*16]        ;xmm2 = s[2]
  115.         movaps    xmm3, [rcx+3*16]        ;xmm3 = s[3]
  116.         addps    xmm0, [rcx+7*16]        ;xmm0 = s[0]+s[7]
  117.         addps    xmm1, [rcx+6*16]        ;xmm1 = s[1]+s[6]
  118.         addps    xmm2, [rcx+5*16]        ;xmm2 = s[2]+s[5]
  119.         addps    xmm3, [rcx+4*16]        ;xmm3 = s[3]+s[4]
  120.  
  121.         ;even part - B2/~B1a (4a)
  122.         movaps    xmm4, xmm0
  123.         addps    xmm0, xmm3                ;xmm0 = b2[0] = b3[0]+b3[3]
  124.         movaps    xmm5, xmm1
  125.         addps    xmm1, xmm2                ;xmm1 = b2[1] = b3[1]+b2[2]
  126.         subps    xmm4, xmm3                ;xmm4 = b2[2] = b3[0]-b3[3]
  127.         subps    xmm5, xmm2                ;xmm5 = b2[3] = b3[1]-b3[2]
  128.  
  129.         ;even part - ~B1b/M (3a1m)
  130.         movaps    xmm2, xmm0
  131.         subps    xmm4, xmm5
  132.         addps    xmm0, xmm1                ;xmm0 = m[0] = b2[0] + b2[1]
  133.         mulps    xmm4, [c4]                ;xmm4 = m[2] = (b2[2] - b2[3])*c4
  134.         subps    xmm2, xmm1                ;xmm2 = m[1] = b2[0] - b2[1]
  135.  
  136.         ;even part - R1 (2a)
  137.         movaps    xmm3, xmm4
  138.         subps    xmm4, xmm5                ;xmm4 = r1[3] = m[2]-m[3]
  139.         addps    xmm3, xmm5                ;xmm3 = r1[2] = m[2]+m[3]
  140.  
  141.         ;even part - d (4m)
  142.         mulps    xmm0, [d+0*16]            ;xmm0 = out[0] = r1[0]*d[0]
  143.         mulps    xmm2, [d+4*16]            ;xmm2 = out[4] = r1[1]*d[4]
  144.         mulps    xmm3, [d+2*16]            ;xmm3 = out[2] = r1[2]*d[2]
  145.         mulps    xmm4, [d+6*16]            ;xmm4 = out[6] = r1[3]*d[6]
  146.  
  147.         ;odd part - B3 (4a)
  148.         movaps    xmm1, [rcx+0*16]
  149.         movaps    xmm5, [rcx+1*16]
  150.         movaps    xmm6, [rcx+2*16]
  151.         movaps    xmm7, [rcx+3*16]
  152.         subps    xmm1, [rcx+7*16]        ;xmm1 = b3[4] = s[0]-s[7]
  153.         subps    xmm5, [rcx+6*16]        ;xmm5 = b3[5] = s[1]-s[6]
  154.         subps    xmm6, [rcx+5*16]        ;xmm6 = b3[6] = s[2]-s[5]
  155.         subps    xmm7, [rcx+4*16]        ;xmm7 = b3[7] = s[3]-s[4]
  156.  
  157.         ;even part - writeout
  158.         movaps    [rcx+0*16], xmm0
  159.         movaps    [rcx+4*16], xmm2
  160.         movaps    [rcx+2*16], xmm3
  161.         movaps    [rcx+6*16], xmm4
  162.  
  163.         ;odd part - B2/~B1a (3a)
  164.         addps    xmm5, xmm7                ;xmm5 = b2[5] = b3[5]+b3[7]
  165.         subps    xmm7, xmm1                ;xmm7 = b2[7] = b3[7]-b3[4]
  166.         subps    xmm1, xmm6                ;xmm1 = b2[4] = b3[4]-b3[6]
  167.  
  168.         ;odd part - ~B1b/M (2a5m)
  169.         movaps    xmm0, xmm1
  170.         mulps    xmm7, [c4]                ;xmm7 = m[7] = c4*b2[7]
  171.         movaps    xmm2, xmm5
  172.         mulps    xmm0, [c6]
  173.         mulps    xmm1, [c2]
  174.         mulps    xmm2, [c2]
  175.         mulps    xmm5, [c6]
  176.         addps    xmm0, xmm2                ;xmm0 = m[4] = c6*b2[4] + c2*b2[5]
  177.         subps    xmm1, xmm5                ;xmm1 = m[5] = c2*b2[4] - c6*b2[5]
  178.  
  179.         ;odd part - R1a (2a)
  180.         movaps    xmm5, xmm6
  181.         addps    xmm6, xmm7                ;xmm6 = r1a[6] = m[6]+m[7]
  182.         subps    xmm5, xmm7                ;xmm5 = r1a[7] = m[6]-m[7]
  183.  
  184.         ;odd part - R1b (4a)
  185.         movaps    xmm3, xmm5
  186.         movaps    xmm4, xmm6
  187.         subps    xmm5, xmm0                ;xmm5 = r1b[7] = r1a[7]-r1a[4]
  188.         subps    xmm6, xmm1                ;xmm6 = r1b[6] = r1a[6]-r1a[5]
  189.         addps    xmm4, xmm1                ;xmm4 = r1b[5] = r1a[6]+r1a[5]
  190.         addps    xmm3, xmm0                ;xmm3 = r1b[4] = r1a[7]+r1a[4]
  191.  
  192.         ;odd part - D (4a)
  193.         mulps    xmm3, [d+1*16]
  194.         mulps    xmm4, [d+5*16]
  195.         mulps    xmm6, [d+3*16]
  196.         mulps    xmm5, [d+7*16]
  197.  
  198.         ;odd part - writeout
  199.         movaps    [rcx+1*16], xmm3
  200.         movaps    [rcx+5*16], xmm4
  201.         movaps    [rcx+3*16], xmm6
  202.         movaps    [rcx+7*16], xmm5
  203.  
  204.         movhlps    xmm6, xmm14
  205.         movhlps    xmm7, xmm15
  206.         ret
  207.  
  208. ;void vdasm_mpegaudio_polyphase_matrixout_stereo(const float (*pSrc)[16], const float *pWinFwd, const float *pWinRev, int inc, const uint32 *pSampleInv, const sint16 *pDst, const float (*pSrcFinal)[16], const uint32 *pFinalMask);
  209.  
  210.     global    vdasm_mpegaudio_polyphase_matrixout_stereo
  211. vdasm_mpegaudio_polyphase_matrixout_stereo:
  212.         ;rcx = pointer to subband samples
  213.         ;rdx = pointer to forward window
  214.         ;r8 = pointer to reverse window
  215.         ;r9 = source increment
  216.  
  217.         movlhps    xmm15, xmm6
  218.         movlhps    xmm14, xmm7
  219.  
  220.         movsxd    r9, r9d
  221.         mov        r10, [rsp+40]            ;r10 = pointer to sample inversion value
  222.         mov        r11, [rsp+48]            ;r11 = pointer to first two forward destination samples
  223.         lea        rax, [r11+120]            ;rax = pointer to first two reverse destination samples
  224.  
  225.         ;compute first sample (0)
  226.  
  227.         movaps    xmm5, oword [invother]
  228.         movups    xmm0, [rdx]                ;load window samples 0-3
  229.         xorps    xmm0, xmm5                ;toggle signs on odd window samples
  230.         movaps    xmm1, xmm0
  231.         mulps    xmm0, [rcx]                ;multiply by left subband samples
  232.         mulps    xmm1, [rcx+64]            ;multiply by right subband samples
  233.         movups    xmm2, [rdx+16]            ;load window samples 4-7
  234.         xorps    xmm2, xmm5                ;toggle signs on odd window samples
  235.         movaps    xmm3, xmm2
  236.         mulps    xmm2, [rcx+16]            ;multiply by left subband samples
  237.         mulps    xmm3, [rcx+80]            ;multiply by right subband samples
  238.         addps    xmm0, xmm2
  239.         addps    xmm1, xmm3
  240.         movups    xmm2, [rdx+32]            ;load window samples 8-11
  241.         xorps    xmm2, xmm5                ;toggle signs on odd window samples
  242.         movaps    xmm3, xmm2
  243.         mulps    xmm2, [rcx+32]            ;multiply by left subband samples
  244.         mulps    xmm3, [rcx+96]            ;multiply by right subband samples
  245.         addps    xmm0, xmm2
  246.         addps    xmm1, xmm3
  247.         movups    xmm2, [rdx+48]            ;load window samples 12-15
  248.         xorps    xmm2, xmm5                ;toggle signs on odd window samples
  249.         movaps    xmm3, xmm2
  250.         mulps    xmm2, [rcx+48]            ;multiply by left subband samples
  251.         mulps    xmm3, [rcx+112]            ;multiply by right subband samples
  252.         addps    xmm0, xmm2
  253.         addps    xmm1, xmm3
  254.  
  255.         movaps    xmm2, xmm0                ;xmm2 = l3 | l2 | l1 | l0
  256.         movlhps    xmm0, xmm1                ;xmm0 = r1 | r0 | l1 | l0
  257.         movhlps    xmm1, xmm2                ;xmm1 = r3 | r2 | l3 | l2
  258.         addps    xmm0, xmm1                ;xmm0 = r1+r3 | r0+r2 | l1+l3 | l0+l2
  259.         shufps    xmm0, xmm0, 11011000b    ;xmm0 = r1+r3 | l1+l3 | r0+r2 | l0+l2
  260.         movhlps    xmm3, xmm0                ;xmm3 =   ?   |   ?   | r1+r3 | l1+l3
  261.         movaps    xmm4, [r10]
  262.         movhlps    xmm4, xmm4
  263.         addps    xmm0, xmm3                ;xmm0 = ? | ? | r | l
  264.         xorps    xmm0, xmm4
  265.         cvtps2dq    xmm0, xmm0
  266.         packssdw    xmm0, xmm0
  267.         movd    dword [r11-4], xmm0
  268.  
  269.         add        rdx, 128
  270.         add        r8, 128
  271.         add        rcx, r9
  272.  
  273.         ;compute reflected samples (1-15, 17-31)
  274. .xloop:
  275.         movups    xmm2, [r8+48]
  276.         shufps    xmm2, xmm2, 00011011b    ;xmm2 = reverse window
  277.         movups    xmm3, [rdx]                ;xmm3 = forward window
  278.         xorps    xmm3, [invother]        ;negate every other sample in forward window
  279.         movaps    xmm0, [rcx]                ;xmm0 = left source
  280.         movaps    xmm1, xmm0
  281.         mulps    xmm0, xmm2
  282.         mulps    xmm1, xmm3
  283.         movaps    xmm4, xmm0                ;xmm4 = left forward
  284.         movaps    xmm5, xmm1                ;xmm5 = left reverse
  285.         movaps    xmm0, [rcx+64]            ;xmm0 = left source
  286.         movaps    xmm1, xmm0
  287.         mulps    xmm0, xmm2
  288.         mulps    xmm1, xmm3
  289.         movaps    xmm6, xmm0                ;xmm6 = right forward
  290.         movaps    xmm7, xmm1                ;xmm7 = right reverse
  291.  
  292.         movups    xmm2, [r8+32]
  293.         shufps    xmm2, xmm2, 00011011b    ;xmm2 = reverse window
  294.         movups    xmm3, [rdx+16]            ;xmm3 = forward window
  295.         xorps    xmm3, [invother]        ;negate every other sample in forward window
  296.         movaps    xmm0, [rcx+16]            ;xmm0 = left source
  297.         movaps    xmm1, xmm0
  298.         mulps    xmm0, xmm2
  299.         mulps    xmm1, xmm3
  300.         addps    xmm4, xmm0                ;xmm4 += left forward
  301.         addps    xmm5, xmm1                ;xmm5 += left reverse
  302.         movaps    xmm0, [rcx+80]            ;xmm0 = left source
  303.         movaps    xmm1, xmm0
  304.         mulps    xmm0, xmm2
  305.         mulps    xmm1, xmm3
  306.         addps    xmm6, xmm0                ;xmm6 += right forward
  307.         addps    xmm7, xmm1                ;xmm7 += right reverse
  308.  
  309.         movups    xmm2, [r8+16]
  310.         shufps    xmm2, xmm2, 00011011b    ;xmm2 = reverse window
  311.         movups    xmm3, [rdx+32]            ;xmm3 = forward window
  312.         xorps    xmm3, [invother]        ;negate every other sample in forward window
  313.         movaps    xmm0, [rcx+32]            ;xmm0 = left source
  314.         movaps    xmm1, xmm0
  315.         mulps    xmm0, xmm2
  316.         mulps    xmm1, xmm3
  317.         addps    xmm4, xmm0                ;xmm4 += left forward
  318.         addps    xmm5, xmm1                ;xmm5 += left reverse
  319.         movaps    xmm0, [rcx+96]            ;xmm0 = left source
  320.         movaps    xmm1, xmm0
  321.         mulps    xmm0, xmm2
  322.         mulps    xmm1, xmm3
  323.         addps    xmm6, xmm0                ;xmm6 += right forward
  324.         addps    xmm7, xmm1                ;xmm7 += right reverse
  325.  
  326.         movups    xmm2, [r8]
  327.         shufps    xmm2, xmm2, 00011011b    ;xmm2 = reverse window
  328.         movups    xmm3, [rdx+48]            ;xmm3 = forward window
  329.         xorps    xmm3, [invother]        ;negate every other sample in forward window
  330.         movaps    xmm0, [rcx+48]            ;xmm0 = left source
  331.         movaps    xmm1, xmm0
  332.         mulps    xmm0, xmm2
  333.         mulps    xmm1, xmm3
  334.         addps    xmm4, xmm0                ;xmm4 += left forward
  335.         addps    xmm5, xmm1                ;xmm5 += left reverse
  336.         movaps    xmm0, [rcx+112]            ;xmm0 = left source
  337.         movaps    xmm1, xmm0
  338.         mulps    xmm0, xmm2
  339.         mulps    xmm1, xmm3
  340.         addps    xmm6, xmm0                ;xmm6 += right forward
  341.         addps    xmm7, xmm1                ;xmm7 += right reverse
  342.  
  343.         movaps    xmm0, xmm4                ;xmm0 = lf3 | lf2 | lf1 | lf0
  344.         movaps    xmm1, xmm5
  345.         movlhps    xmm0, xmm6                ;xmm0 = rf0 | rf1 | lf1 | lf0
  346.         movlhps    xmm1, xmm7
  347.         movhlps    xmm6, xmm4                ;xmm6 = rf3 | rf2 | lf3 | lf2
  348.         movhlps    xmm7, xmm5
  349.         addps    xmm0, xmm6                ;xmm0 = rf0+rf3 | rf1+rf2 | lf1+lf3 | lf0+lf2
  350.         addps    xmm1, xmm7
  351.         movaps    xmm2, xmm0
  352.         movaps    xmm3, xmm1
  353.         shufps    xmm0, xmm0, 10110001b    ;xmm0 = rf1+rf2 | rf0+rf3 | lf0+lf2 | lf1+lf3
  354.         shufps    xmm1, xmm1, 10110001b
  355.         addps    xmm0, xmm2                ;xmm0 = rf | rf | lf | lf
  356.         addps    xmm1, xmm3                ;xmm1 = rb | rb | lb | lb
  357.         shufps    xmm0, xmm1, 10001000b    ;xmm0 = rf | lf | rb | lb
  358.         xorps    xmm0, [r10]
  359.         cvtps2dq    xmm0, xmm0
  360.         packssdw    xmm0, xmm0
  361.         movd    dword [rax], xmm0
  362.         psrldq    xmm0, 4
  363.         movd    dword [r11], xmm0
  364.  
  365.         add        r11,4
  366.         sub        rax,4
  367.         add        rcx,r9
  368.         add        rdx,128
  369.         add        r8,128
  370.         cmp        r11,rax
  371.         jne        .xloop
  372.  
  373.         ;do last sample (16)
  374.         mov        rcx, [rsp+56]
  375.         mov        rax, [rsp+64]
  376.         movaps    xmm5, [rax]                ;load final mask (masks out every other sample)
  377.  
  378.         movups    xmm0, [rdx]                ;load window samples 0-3
  379.         andps    xmm0, xmm5                ;mask out every other sample
  380.         movaps    xmm1, xmm0
  381.         mulps    xmm0, [rcx]                ;multiply by left subband samples
  382.         mulps    xmm1, [rcx+64]            ;multiply by right subband samples
  383.         movups    xmm2, [rdx+16]            ;load window samples 4-7
  384.         andps    xmm2, xmm5                ;mask out every other sample
  385.         movaps    xmm3, xmm2
  386.         mulps    xmm2, [rcx+16]            ;multiply by left subband samples
  387.         mulps    xmm3, [rcx+80]            ;multiply by right subband samples
  388.         addps    xmm0, xmm2
  389.         addps    xmm1, xmm3
  390.         movups    xmm2, [rdx+32]            ;load window samples 8-11
  391.         andps    xmm2, xmm5                ;mask out every other sample
  392.         movaps    xmm3, xmm2
  393.         mulps    xmm2, [rcx+32]            ;multiply by left subband samples
  394.         mulps    xmm3, [rcx+96]            ;multiply by right subband samples
  395.         addps    xmm0, xmm2
  396.         addps    xmm1, xmm3
  397.         movups    xmm2, [rdx+48]            ;load window samples 12-15
  398.         andps    xmm2, xmm5                ;mask out every other sample
  399.         movaps    xmm3, xmm2
  400.         mulps    xmm2, [rcx+48]            ;multiply by left subband samples
  401.         mulps    xmm3, [rcx+112]            ;multiply by right subband samples
  402.         addps    xmm0, xmm2
  403.         addps    xmm1, xmm3
  404.  
  405.         movaps    xmm2, xmm0                ;xmm2 = l3 | l2 | l1 | l0
  406.         movlhps    xmm0, xmm1                ;xmm0 = r1 | r0 | l1 | l0
  407.         movhlps    xmm1, xmm2                ;xmm1 = r3 | r2 | l3 | l2
  408.         addps    xmm0, xmm1                ;xmm0 = r1+r3 | r0+r2 | l1+l3 | l0+l2
  409.         shufps    xmm0, xmm0, 11011000b    ;xmm0 = r1+r3 | l1+l3 | r0+r2 | l0+l2
  410.         movhlps    xmm3, xmm0                ;xmm3 =   ?   |   ?   | r1+r3 | l1+l3
  411.         addps    xmm0, xmm3                ;xmm0 = ? | ? | r | l
  412.         xorps    xmm0, [invall]
  413.         cvtps2dq    xmm0, xmm0
  414.         packssdw    xmm0, xmm0
  415.         movd    dword [r11], xmm0
  416.  
  417.         movhlps    xmm6, xmm15
  418.         movhlps    xmm7, xmm14
  419.         ret
  420.  
  421.         end
  422.