iwalsh_sse2.asm 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ;
  2. ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. ;
  4. ; Use of this source code is governed by a BSD-style license
  5. ; that can be found in the LICENSE file in the root of the source
  6. ; tree. An additional intellectual property rights grant can be found
  7. ; in the file PATENTS. All contributing project authors may
  8. ; be found in the AUTHORS file in the root of the source tree.
  9. ;
  10. %include "vpx_ports/x86_abi_support.asm"
  11. SECTION .text
  12. ;void vp8_short_inv_walsh4x4_sse2(short *input, short *mb_dqcoeff)
  13. global sym(vp8_short_inv_walsh4x4_sse2) PRIVATE
  14. sym(vp8_short_inv_walsh4x4_sse2):
  15. push rbp
  16. mov rbp, rsp
  17. SHADOW_ARGS_TO_STACK 2
  18. ; end prolog
  19. mov rcx, arg(0)
  20. mov rdx, arg(1)
  21. mov rax, 30003h
  22. movdqa xmm0, [rcx + 0] ;ip[4] ip[0]
  23. movdqa xmm1, [rcx + 16] ;ip[12] ip[8]
  24. pshufd xmm2, xmm1, 4eh ;ip[8] ip[12]
  25. movdqa xmm3, xmm0 ;ip[4] ip[0]
  26. paddw xmm0, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1
  27. psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1
  28. movdqa xmm4, xmm0
  29. punpcklqdq xmm0, xmm3 ;d1 a1
  30. punpckhqdq xmm4, xmm3 ;c1 b1
  31. movdqa xmm1, xmm4 ;c1 b1
  32. paddw xmm4, xmm0 ;dl+cl a1+b1 aka op[4] op[0]
  33. psubw xmm0, xmm1 ;d1-c1 a1-b1 aka op[12] op[8]
  34. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. ; 13 12 11 10 03 02 01 00
  36. ;
  37. ; 33 32 31 30 23 22 21 20
  38. ;
  39. movdqa xmm3, xmm4 ; 13 12 11 10 03 02 01 00
  40. punpcklwd xmm4, xmm0 ; 23 03 22 02 21 01 20 00
  41. punpckhwd xmm3, xmm0 ; 33 13 32 12 31 11 30 10
  42. movdqa xmm1, xmm4 ; 23 03 22 02 21 01 20 00
  43. punpcklwd xmm4, xmm3 ; 31 21 11 01 30 20 10 00
  44. punpckhwd xmm1, xmm3 ; 33 23 13 03 32 22 12 02
  45. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  46. movd xmm0, eax
  47. pshufd xmm2, xmm1, 4eh ;ip[8] ip[12]
  48. movdqa xmm3, xmm4 ;ip[4] ip[0]
  49. pshufd xmm0, xmm0, 0 ;03 03 03 03 03 03 03 03
  50. paddw xmm4, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1
  51. psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1
  52. movdqa xmm5, xmm4
  53. punpcklqdq xmm4, xmm3 ;d1 a1
  54. punpckhqdq xmm5, xmm3 ;c1 b1
  55. movdqa xmm1, xmm5 ;c1 b1
  56. paddw xmm5, xmm4 ;dl+cl a1+b1 aka op[4] op[0]
  57. psubw xmm4, xmm1 ;d1-c1 a1-b1 aka op[12] op[8]
  58. paddw xmm5, xmm0
  59. paddw xmm4, xmm0
  60. psraw xmm5, 3
  61. psraw xmm4, 3
  62. movd eax, xmm5
  63. movd ecx, xmm4
  64. psrldq xmm5, 4
  65. psrldq xmm4, 4
  66. mov word ptr[rdx+32*0], ax
  67. mov word ptr[rdx+32*2], cx
  68. shr eax, 16
  69. shr ecx, 16
  70. mov word ptr[rdx+32*4], ax
  71. mov word ptr[rdx+32*6], cx
  72. movd eax, xmm5
  73. movd ecx, xmm4
  74. psrldq xmm5, 4
  75. psrldq xmm4, 4
  76. mov word ptr[rdx+32*8], ax
  77. mov word ptr[rdx+32*10], cx
  78. shr eax, 16
  79. shr ecx, 16
  80. mov word ptr[rdx+32*12], ax
  81. mov word ptr[rdx+32*14], cx
  82. movd eax, xmm5
  83. movd ecx, xmm4
  84. psrldq xmm5, 4
  85. psrldq xmm4, 4
  86. mov word ptr[rdx+32*1], ax
  87. mov word ptr[rdx+32*3], cx
  88. shr eax, 16
  89. shr ecx, 16
  90. mov word ptr[rdx+32*5], ax
  91. mov word ptr[rdx+32*7], cx
  92. movd eax, xmm5
  93. movd ecx, xmm4
  94. mov word ptr[rdx+32*9], ax
  95. mov word ptr[rdx+32*11], cx
  96. shr eax, 16
  97. shr ecx, 16
  98. mov word ptr[rdx+32*13], ax
  99. mov word ptr[rdx+32*15], cx
  100. ; begin epilog
  101. UNSHADOW_ARGS
  102. pop rbp
  103. ret