jfdctfst-sse2-64.asm 17 KB

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