jfdctfst-sse2.asm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. ;
  2. ; jfdctfst.asm - fast integer FDCT (64-bit SSE2)
  3. ;
  4. ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
  5. ; Copyright (C) 2009, 2016, D. R. Commander.
  6. ;
  7. ; Based on the x86 SIMD extension for IJG JPEG library
  8. ; Copyright (C) 1999-2006, MIYASAKA Masaru.
  9. ; For conditions of distribution and use, see copyright notice in jsimdext.inc
  10. ;
  11. ; This file should be assembled with NASM (Netwide Assembler),
  12. ; can *not* be assembled with Microsoft's MASM or any compatible
  13. ; assembler (including Borland's Turbo Assembler).
  14. ; NASM is available from http://nasm.sourceforge.net/ or
  15. ; http://sourceforge.net/project/showfiles.php?group_id=6208
  16. ;
  17. ; This file contains a fast, not so accurate integer implementation of
  18. ; the forward DCT (Discrete Cosine Transform). The following code is
  19. ; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c
  20. ; for more details.
  21. %include "jsimdext.inc"
  22. %include "jdct.inc"
  23. ; --------------------------------------------------------------------------
  24. %define CONST_BITS 8 ; 14 is also OK.
  25. %if CONST_BITS == 8
  26. F_0_382 equ 98 ; FIX(0.382683433)
  27. F_0_541 equ 139 ; FIX(0.541196100)
  28. F_0_707 equ 181 ; FIX(0.707106781)
  29. F_1_306 equ 334 ; FIX(1.306562965)
  30. %else
  31. ; NASM cannot do compile-time arithmetic on floating-point constants.
  32. %define DESCALE(x, n) (((x) + (1 << ((n) - 1))) >> (n))
  33. F_0_382 equ DESCALE( 410903207, 30 - CONST_BITS) ; FIX(0.382683433)
  34. F_0_541 equ DESCALE( 581104887, 30 - CONST_BITS) ; FIX(0.541196100)
  35. F_0_707 equ DESCALE( 759250124, 30 - CONST_BITS) ; FIX(0.707106781)
  36. F_1_306 equ DESCALE(1402911301, 30 - CONST_BITS) ; FIX(1.306562965)
  37. %endif
  38. ; --------------------------------------------------------------------------
  39. SECTION SEG_CONST
  40. ; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)
  41. ; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)
  42. %define PRE_MULTIPLY_SCALE_BITS 2
  43. %define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)
  44. alignz 32
  45. GLOBAL_DATA(jconst_fdct_ifast_sse2)
  46. EXTN(jconst_fdct_ifast_sse2):
  47. PW_F0707 times 8 dw F_0_707 << CONST_SHIFT
  48. PW_F0382 times 8 dw F_0_382 << CONST_SHIFT
  49. PW_F0541 times 8 dw F_0_541 << CONST_SHIFT
  50. PW_F1306 times 8 dw F_1_306 << CONST_SHIFT
  51. alignz 32
  52. ; --------------------------------------------------------------------------
  53. SECTION SEG_TEXT
  54. BITS 64
  55. ;
  56. ; Perform the forward DCT on one block of samples.
  57. ;
  58. ; GLOBAL(void)
  59. ; jsimd_fdct_ifast_sse2(DCTELEM *data)
  60. ;
  61. ; r10 = DCTELEM *data
  62. %define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
  63. %define WK_NUM 2
  64. align 32
  65. GLOBAL_FUNCTION(jsimd_fdct_ifast_sse2)
  66. EXTN(jsimd_fdct_ifast_sse2):
  67. push rbp
  68. mov rax, rsp ; rax = original rbp
  69. sub rsp, byte 4
  70. and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
  71. mov [rsp], rax
  72. mov rbp, rsp ; rbp = aligned rbp
  73. lea rsp, [wk(0)]
  74. collect_args 1
  75. ; ---- Pass 1: process rows.
  76. mov rdx, r10 ; (DCTELEM *)
  77. movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)]
  78. movdqa xmm1, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)]
  79. movdqa xmm2, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)]
  80. movdqa xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)]
  81. ; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)
  82. ; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)
  83. movdqa xmm4, xmm0 ; transpose coefficients(phase 1)
  84. punpcklwd xmm0, xmm1 ; xmm0=(00 10 01 11 02 12 03 13)
  85. punpckhwd xmm4, xmm1 ; xmm4=(04 14 05 15 06 16 07 17)
  86. movdqa xmm5, xmm2 ; transpose coefficients(phase 1)
  87. punpcklwd xmm2, xmm3 ; xmm2=(20 30 21 31 22 32 23 33)
  88. punpckhwd xmm5, xmm3 ; xmm5=(24 34 25 35 26 36 27 37)
  89. movdqa xmm6, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)]
  90. movdqa xmm7, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)]
  91. movdqa xmm1, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)]
  92. movdqa xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)]
  93. ; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)
  94. ; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)
  95. movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=(20 30 21 31 22 32 23 33)
  96. movdqa XMMWORD [wk(1)], xmm5 ; wk(1)=(24 34 25 35 26 36 27 37)
  97. movdqa xmm2, xmm6 ; transpose coefficients(phase 1)
  98. punpcklwd xmm6, xmm7 ; xmm6=(40 50 41 51 42 52 43 53)
  99. punpckhwd xmm2, xmm7 ; xmm2=(44 54 45 55 46 56 47 57)
  100. movdqa xmm5, xmm1 ; transpose coefficients(phase 1)
  101. punpcklwd xmm1, xmm3 ; xmm1=(60 70 61 71 62 72 63 73)
  102. punpckhwd xmm5, xmm3 ; xmm5=(64 74 65 75 66 76 67 77)
  103. movdqa xmm7, xmm6 ; transpose coefficients(phase 2)
  104. punpckldq xmm6, xmm1 ; xmm6=(40 50 60 70 41 51 61 71)
  105. punpckhdq xmm7, xmm1 ; xmm7=(42 52 62 72 43 53 63 73)
  106. movdqa xmm3, xmm2 ; transpose coefficients(phase 2)
  107. punpckldq xmm2, xmm5 ; xmm2=(44 54 64 74 45 55 65 75)
  108. punpckhdq xmm3, xmm5 ; xmm3=(46 56 66 76 47 57 67 77)
  109. movdqa xmm1, XMMWORD [wk(0)] ; xmm1=(20 30 21 31 22 32 23 33)
  110. movdqa xmm5, XMMWORD [wk(1)] ; xmm5=(24 34 25 35 26 36 27 37)
  111. movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=(42 52 62 72 43 53 63 73)
  112. movdqa XMMWORD [wk(1)], xmm2 ; wk(1)=(44 54 64 74 45 55 65 75)
  113. movdqa xmm7, xmm0 ; transpose coefficients(phase 2)
  114. punpckldq xmm0, xmm1 ; xmm0=(00 10 20 30 01 11 21 31)
  115. punpckhdq xmm7, xmm1 ; xmm7=(02 12 22 32 03 13 23 33)
  116. movdqa xmm2, xmm4 ; transpose coefficients(phase 2)
  117. punpckldq xmm4, xmm5 ; xmm4=(04 14 24 34 05 15 25 35)
  118. punpckhdq xmm2, xmm5 ; xmm2=(06 16 26 36 07 17 27 37)
  119. movdqa xmm1, xmm0 ; transpose coefficients(phase 3)
  120. punpcklqdq xmm0, xmm6 ; xmm0=(00 10 20 30 40 50 60 70)=data0
  121. punpckhqdq xmm1, xmm6 ; xmm1=(01 11 21 31 41 51 61 71)=data1
  122. movdqa xmm5, xmm2 ; transpose coefficients(phase 3)
  123. punpcklqdq xmm2, xmm3 ; xmm2=(06 16 26 36 46 56 66 76)=data6
  124. punpckhqdq xmm5, xmm3 ; xmm5=(07 17 27 37 47 57 67 77)=data7
  125. movdqa xmm6, xmm1
  126. movdqa xmm3, xmm0
  127. psubw xmm1, xmm2 ; xmm1=data1-data6=tmp6
  128. psubw xmm0, xmm5 ; xmm0=data0-data7=tmp7
  129. paddw xmm6, xmm2 ; xmm6=data1+data6=tmp1
  130. paddw xmm3, xmm5 ; xmm3=data0+data7=tmp0
  131. movdqa xmm2, XMMWORD [wk(0)] ; xmm2=(42 52 62 72 43 53 63 73)
  132. movdqa xmm5, XMMWORD [wk(1)] ; xmm5=(44 54 64 74 45 55 65 75)
  133. movdqa XMMWORD [wk(0)], xmm1 ; wk(0)=tmp6
  134. movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=tmp7
  135. movdqa xmm1, xmm7 ; transpose coefficients(phase 3)
  136. punpcklqdq xmm7, xmm2 ; xmm7=(02 12 22 32 42 52 62 72)=data2
  137. punpckhqdq xmm1, xmm2 ; xmm1=(03 13 23 33 43 53 63 73)=data3
  138. movdqa xmm0, xmm4 ; transpose coefficients(phase 3)
  139. punpcklqdq xmm4, xmm5 ; xmm4=(04 14 24 34 44 54 64 74)=data4
  140. punpckhqdq xmm0, xmm5 ; xmm0=(05 15 25 35 45 55 65 75)=data5
  141. movdqa xmm2, xmm1
  142. movdqa xmm5, xmm7
  143. paddw xmm1, xmm4 ; xmm1=data3+data4=tmp3
  144. paddw xmm7, xmm0 ; xmm7=data2+data5=tmp2
  145. psubw xmm2, xmm4 ; xmm2=data3-data4=tmp4
  146. psubw xmm5, xmm0 ; xmm5=data2-data5=tmp5
  147. ; -- Even part
  148. movdqa xmm4, xmm3
  149. movdqa xmm0, xmm6
  150. psubw xmm3, xmm1 ; xmm3=tmp13
  151. psubw xmm6, xmm7 ; xmm6=tmp12
  152. paddw xmm4, xmm1 ; xmm4=tmp10
  153. paddw xmm0, xmm7 ; xmm0=tmp11
  154. paddw xmm6, xmm3
  155. psllw xmm6, PRE_MULTIPLY_SCALE_BITS
  156. pmulhw xmm6, [rel PW_F0707] ; xmm6=z1
  157. movdqa xmm1, xmm4
  158. movdqa xmm7, xmm3
  159. psubw xmm4, xmm0 ; xmm4=data4
  160. psubw xmm3, xmm6 ; xmm3=data6
  161. paddw xmm1, xmm0 ; xmm1=data0
  162. paddw xmm7, xmm6 ; xmm7=data2
  163. movdqa xmm0, XMMWORD [wk(0)] ; xmm0=tmp6
  164. movdqa xmm6, XMMWORD [wk(1)] ; xmm6=tmp7
  165. movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=data4
  166. movdqa XMMWORD [wk(1)], xmm3 ; wk(1)=data6
  167. ; -- Odd part
  168. paddw xmm2, xmm5 ; xmm2=tmp10
  169. paddw xmm5, xmm0 ; xmm5=tmp11
  170. paddw xmm0, xmm6 ; xmm0=tmp12, xmm6=tmp7
  171. psllw xmm2, PRE_MULTIPLY_SCALE_BITS
  172. psllw xmm0, PRE_MULTIPLY_SCALE_BITS
  173. psllw xmm5, PRE_MULTIPLY_SCALE_BITS
  174. pmulhw xmm5, [rel PW_F0707] ; xmm5=z3
  175. movdqa xmm4, xmm2 ; xmm4=tmp10
  176. psubw xmm2, xmm0
  177. pmulhw xmm2, [rel PW_F0382] ; xmm2=z5
  178. pmulhw xmm4, [rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)
  179. pmulhw xmm0, [rel PW_F1306] ; xmm0=MULTIPLY(tmp12,FIX_1_306562)
  180. paddw xmm4, xmm2 ; xmm4=z2
  181. paddw xmm0, xmm2 ; xmm0=z4
  182. movdqa xmm3, xmm6
  183. psubw xmm6, xmm5 ; xmm6=z13
  184. paddw xmm3, xmm5 ; xmm3=z11
  185. movdqa xmm2, xmm6
  186. movdqa xmm5, xmm3
  187. psubw xmm6, xmm4 ; xmm6=data3
  188. psubw xmm3, xmm0 ; xmm3=data7
  189. paddw xmm2, xmm4 ; xmm2=data5
  190. paddw xmm5, xmm0 ; xmm5=data1
  191. ; ---- Pass 2: process columns.
  192. ; xmm1=(00 10 20 30 40 50 60 70), xmm7=(02 12 22 32 42 52 62 72)
  193. ; xmm5=(01 11 21 31 41 51 61 71), xmm6=(03 13 23 33 43 53 63 73)
  194. movdqa xmm4, xmm1 ; transpose coefficients(phase 1)
  195. punpcklwd xmm1, xmm5 ; xmm1=(00 01 10 11 20 21 30 31)
  196. punpckhwd xmm4, xmm5 ; xmm4=(40 41 50 51 60 61 70 71)
  197. movdqa xmm0, xmm7 ; transpose coefficients(phase 1)
  198. punpcklwd xmm7, xmm6 ; xmm7=(02 03 12 13 22 23 32 33)
  199. punpckhwd xmm0, xmm6 ; xmm0=(42 43 52 53 62 63 72 73)
  200. movdqa xmm5, XMMWORD [wk(0)] ; xmm5=col4
  201. movdqa xmm6, XMMWORD [wk(1)] ; xmm6=col6
  202. ; xmm5=(04 14 24 34 44 54 64 74), xmm6=(06 16 26 36 46 56 66 76)
  203. ; xmm2=(05 15 25 35 45 55 65 75), xmm3=(07 17 27 37 47 57 67 77)
  204. movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=(02 03 12 13 22 23 32 33)
  205. movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=(42 43 52 53 62 63 72 73)
  206. movdqa xmm7, xmm5 ; transpose coefficients(phase 1)
  207. punpcklwd xmm5, xmm2 ; xmm5=(04 05 14 15 24 25 34 35)
  208. punpckhwd xmm7, xmm2 ; xmm7=(44 45 54 55 64 65 74 75)
  209. movdqa xmm0, xmm6 ; transpose coefficients(phase 1)
  210. punpcklwd xmm6, xmm3 ; xmm6=(06 07 16 17 26 27 36 37)
  211. punpckhwd xmm0, xmm3 ; xmm0=(46 47 56 57 66 67 76 77)
  212. movdqa xmm2, xmm5 ; transpose coefficients(phase 2)
  213. punpckldq xmm5, xmm6 ; xmm5=(04 05 06 07 14 15 16 17)
  214. punpckhdq xmm2, xmm6 ; xmm2=(24 25 26 27 34 35 36 37)
  215. movdqa xmm3, xmm7 ; transpose coefficients(phase 2)
  216. punpckldq xmm7, xmm0 ; xmm7=(44 45 46 47 54 55 56 57)
  217. punpckhdq xmm3, xmm0 ; xmm3=(64 65 66 67 74 75 76 77)
  218. movdqa xmm6, XMMWORD [wk(0)] ; xmm6=(02 03 12 13 22 23 32 33)
  219. movdqa xmm0, XMMWORD [wk(1)] ; xmm0=(42 43 52 53 62 63 72 73)
  220. movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=(24 25 26 27 34 35 36 37)
  221. movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=(44 45 46 47 54 55 56 57)
  222. movdqa xmm2, xmm1 ; transpose coefficients(phase 2)
  223. punpckldq xmm1, xmm6 ; xmm1=(00 01 02 03 10 11 12 13)
  224. punpckhdq xmm2, xmm6 ; xmm2=(20 21 22 23 30 31 32 33)
  225. movdqa xmm7, xmm4 ; transpose coefficients(phase 2)
  226. punpckldq xmm4, xmm0 ; xmm4=(40 41 42 43 50 51 52 53)
  227. punpckhdq xmm7, xmm0 ; xmm7=(60 61 62 63 70 71 72 73)
  228. movdqa xmm6, xmm1 ; transpose coefficients(phase 3)
  229. punpcklqdq xmm1, xmm5 ; xmm1=(00 01 02 03 04 05 06 07)=data0
  230. punpckhqdq xmm6, xmm5 ; xmm6=(10 11 12 13 14 15 16 17)=data1
  231. movdqa xmm0, xmm7 ; transpose coefficients(phase 3)
  232. punpcklqdq xmm7, xmm3 ; xmm7=(60 61 62 63 64 65 66 67)=data6
  233. punpckhqdq xmm0, xmm3 ; xmm0=(70 71 72 73 74 75 76 77)=data7
  234. movdqa xmm5, xmm6
  235. movdqa xmm3, xmm1
  236. psubw xmm6, xmm7 ; xmm6=data1-data6=tmp6
  237. psubw xmm1, xmm0 ; xmm1=data0-data7=tmp7
  238. paddw xmm5, xmm7 ; xmm5=data1+data6=tmp1
  239. paddw xmm3, xmm0 ; xmm3=data0+data7=tmp0
  240. movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(24 25 26 27 34 35 36 37)
  241. movdqa xmm0, XMMWORD [wk(1)] ; xmm0=(44 45 46 47 54 55 56 57)
  242. movdqa XMMWORD [wk(0)], xmm6 ; wk(0)=tmp6
  243. movdqa XMMWORD [wk(1)], xmm1 ; wk(1)=tmp7
  244. movdqa xmm6, xmm2 ; transpose coefficients(phase 3)
  245. punpcklqdq xmm2, xmm7 ; xmm2=(20 21 22 23 24 25 26 27)=data2
  246. punpckhqdq xmm6, xmm7 ; xmm6=(30 31 32 33 34 35 36 37)=data3
  247. movdqa xmm1, xmm4 ; transpose coefficients(phase 3)
  248. punpcklqdq xmm4, xmm0 ; xmm4=(40 41 42 43 44 45 46 47)=data4
  249. punpckhqdq xmm1, xmm0 ; xmm1=(50 51 52 53 54 55 56 57)=data5
  250. movdqa xmm7, xmm6
  251. movdqa xmm0, xmm2
  252. paddw xmm6, xmm4 ; xmm6=data3+data4=tmp3
  253. paddw xmm2, xmm1 ; xmm2=data2+data5=tmp2
  254. psubw xmm7, xmm4 ; xmm7=data3-data4=tmp4
  255. psubw xmm0, xmm1 ; xmm0=data2-data5=tmp5
  256. ; -- Even part
  257. movdqa xmm4, xmm3
  258. movdqa xmm1, xmm5
  259. psubw xmm3, xmm6 ; xmm3=tmp13
  260. psubw xmm5, xmm2 ; xmm5=tmp12
  261. paddw xmm4, xmm6 ; xmm4=tmp10
  262. paddw xmm1, xmm2 ; xmm1=tmp11
  263. paddw xmm5, xmm3
  264. psllw xmm5, PRE_MULTIPLY_SCALE_BITS
  265. pmulhw xmm5, [rel PW_F0707] ; xmm5=z1
  266. movdqa xmm6, xmm4
  267. movdqa xmm2, xmm3
  268. psubw xmm4, xmm1 ; xmm4=data4
  269. psubw xmm3, xmm5 ; xmm3=data6
  270. paddw xmm6, xmm1 ; xmm6=data0
  271. paddw xmm2, xmm5 ; xmm2=data2
  272. movdqa XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)], xmm4
  273. movdqa XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)], xmm3
  274. movdqa XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)], xmm6
  275. movdqa XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)], xmm2
  276. ; -- Odd part
  277. movdqa xmm1, XMMWORD [wk(0)] ; xmm1=tmp6
  278. movdqa xmm5, XMMWORD [wk(1)] ; xmm5=tmp7
  279. paddw xmm7, xmm0 ; xmm7=tmp10
  280. paddw xmm0, xmm1 ; xmm0=tmp11
  281. paddw xmm1, xmm5 ; xmm1=tmp12, xmm5=tmp7
  282. psllw xmm7, PRE_MULTIPLY_SCALE_BITS
  283. psllw xmm1, PRE_MULTIPLY_SCALE_BITS
  284. psllw xmm0, PRE_MULTIPLY_SCALE_BITS
  285. pmulhw xmm0, [rel PW_F0707] ; xmm0=z3
  286. movdqa xmm4, xmm7 ; xmm4=tmp10
  287. psubw xmm7, xmm1
  288. pmulhw xmm7, [rel PW_F0382] ; xmm7=z5
  289. pmulhw xmm4, [rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)
  290. pmulhw xmm1, [rel PW_F1306] ; xmm1=MULTIPLY(tmp12,FIX_1_306562)
  291. paddw xmm4, xmm7 ; xmm4=z2
  292. paddw xmm1, xmm7 ; xmm1=z4
  293. movdqa xmm3, xmm5
  294. psubw xmm5, xmm0 ; xmm5=z13
  295. paddw xmm3, xmm0 ; xmm3=z11
  296. movdqa xmm6, xmm5
  297. movdqa xmm2, xmm3
  298. psubw xmm5, xmm4 ; xmm5=data3
  299. psubw xmm3, xmm1 ; xmm3=data7
  300. paddw xmm6, xmm4 ; xmm6=data5
  301. paddw xmm2, xmm1 ; xmm2=data1
  302. movdqa XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)], xmm5
  303. movdqa XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)], xmm3
  304. movdqa XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)], xmm6
  305. movdqa XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)], xmm2
  306. uncollect_args 1
  307. mov rsp, rbp ; rsp <- aligned rbp
  308. pop rsp ; rsp <- original rbp
  309. pop rbp
  310. ret
  311. ; For some reason, the OS X linker does not honor the request to align the
  312. ; segment unless we do this.
  313. align 32