2 ; jdsample.asm - upsampling (64-bit SSE2)
4 ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5 ; Copyright (C) 2009, 2016, D. R. Commander.
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
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
19 %include "jsimdext.inc"
21 ; --------------------------------------------------------------------------
25 GLOBAL_DATA(jconst_fancy_upsample_sse2)
27 EXTN(jconst_fancy_upsample_sse2):
37 ; --------------------------------------------------------------------------
41 ; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.
43 ; The upsampling algorithm is linear interpolation between pixel centers,
44 ; also known as a "triangle filter". This is a good compromise between
45 ; speed and visual quality. The centers of the output pixels are 1/4 and 3/4
46 ; of the way between input pixel centers.
49 ; jsimd_h2v1_fancy_upsample_sse2(int max_v_samp_factor,
50 ; JDIMENSION downsampled_width,
51 ; JSAMPARRAY input_data,
52 ; JSAMPARRAY *output_data_ptr);
55 ; r10 = int max_v_samp_factor
56 ; r11d = JDIMENSION downsampled_width
57 ; r12 = JSAMPARRAY input_data
58 ; r13 = JSAMPARRAY *output_data_ptr
61 GLOBAL_FUNCTION(jsimd_h2v1_fancy_upsample_sse2)
63 EXTN(jsimd_h2v1_fancy_upsample_sse2):
69 mov eax, r11d ; colctr
77 mov rsi, r12 ; input_data
79 mov rdi, JSAMPARRAY [rdi] ; output_data
85 mov rsi, JSAMPROW [rsi] ; inptr
86 mov rdi, JSAMPROW [rdi] ; outptr
88 test rax, SIZEOF_XMMWORD-1
90 mov dl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]
91 mov JSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl ; insert a dummy sample
93 pxor xmm0, xmm0 ; xmm0=(all 0's)
95 psrldq xmm7, (SIZEOF_XMMWORD-1)
96 pand xmm7, XMMWORD [rsi+0*SIZEOF_XMMWORD]
98 add rax, byte SIZEOF_XMMWORD-1
99 and rax, byte -SIZEOF_XMMWORD
100 cmp rax, byte SIZEOF_XMMWORD
105 pslldq xmm6, (SIZEOF_XMMWORD-1)
106 pand xmm6, XMMWORD [rsi+0*SIZEOF_XMMWORD]
110 movdqa xmm6, XMMWORD [rsi+1*SIZEOF_XMMWORD]
111 pslldq xmm6, (SIZEOF_XMMWORD-1)
114 movdqa xmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]
116 movdqa xmm3, xmm1 ; xmm1=( 0 1 2 ... 13 14 15)
117 pslldq xmm2, 1 ; xmm2=(-- 0 1 ... 12 13 14)
118 psrldq xmm3, 1 ; xmm3=( 1 2 3 ... 14 15 --)
120 por xmm2, xmm7 ; xmm2=(-1 0 1 ... 12 13 14)
121 por xmm3, xmm6 ; xmm3=( 1 2 3 ... 14 15 16)
124 psrldq xmm7, (SIZEOF_XMMWORD-1) ; xmm7=(15 -- -- ... -- -- --)
127 punpcklbw xmm1, xmm0 ; xmm1=( 0 1 2 3 4 5 6 7)
128 punpckhbw xmm4, xmm0 ; xmm4=( 8 9 10 11 12 13 14 15)
130 punpcklbw xmm2, xmm0 ; xmm2=(-1 0 1 2 3 4 5 6)
131 punpckhbw xmm5, xmm0 ; xmm5=( 7 8 9 10 11 12 13 14)
133 punpcklbw xmm3, xmm0 ; xmm3=( 1 2 3 4 5 6 7 8)
134 punpckhbw xmm6, xmm0 ; xmm6=( 9 10 11 12 13 14 15 16)
136 pmullw xmm1, [rel PW_THREE]
137 pmullw xmm4, [rel PW_THREE]
138 paddw xmm2, [rel PW_ONE]
139 paddw xmm5, [rel PW_ONE]
140 paddw xmm3, [rel PW_TWO]
141 paddw xmm6, [rel PW_TWO]
145 psrlw xmm2, 2 ; xmm2=OutLE=( 0 2 4 6 8 10 12 14)
146 psrlw xmm5, 2 ; xmm5=OutHE=(16 18 20 22 24 26 28 30)
149 psrlw xmm3, 2 ; xmm3=OutLO=( 1 3 5 7 9 11 13 15)
150 psrlw xmm6, 2 ; xmm6=OutHO=(17 19 21 23 25 27 29 31)
154 por xmm2, xmm3 ; xmm2=OutL=( 0 1 2 ... 13 14 15)
155 por xmm5, xmm6 ; xmm5=OutH=(16 17 18 ... 29 30 31)
157 movdqa XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2
158 movdqa XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm5
160 sub rax, byte SIZEOF_XMMWORD
161 add rsi, byte 1*SIZEOF_XMMWORD ; inptr
162 add rdi, byte 2*SIZEOF_XMMWORD ; outptr
163 cmp rax, byte SIZEOF_XMMWORD
166 jnz near .columnloop_last
172 add rsi, byte SIZEOF_JSAMPROW ; input_data
173 add rdi, byte SIZEOF_JSAMPROW ; output_data
182 ; --------------------------------------------------------------------------
184 ; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.
185 ; Again a triangle filter; see comments for h2v1 case, above.
188 ; jsimd_h2v2_fancy_upsample_sse2(int max_v_samp_factor,
189 ; JDIMENSION downsampled_width,
190 ; JSAMPARRAY input_data,
191 ; JSAMPARRAY *output_data_ptr);
194 ; r10 = int max_v_samp_factor
195 ; r11d = JDIMENSION downsampled_width
196 ; r12 = JSAMPARRAY input_data
197 ; r13 = JSAMPARRAY *output_data_ptr
199 %define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
203 GLOBAL_FUNCTION(jsimd_h2v2_fancy_upsample_sse2)
205 EXTN(jsimd_h2v2_fancy_upsample_sse2):
207 mov rax, rsp ; rax = original rbp
209 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
211 mov rbp, rsp ; rbp = aligned rbp
216 mov eax, r11d ; colctr
220 mov rcx, r10 ; rowctr
224 mov rsi, r12 ; input_data
226 mov rdi, JSAMPARRAY [rdi] ; output_data
233 mov rcx, JSAMPROW [rsi-1*SIZEOF_JSAMPROW] ; inptr1(above)
234 mov rbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW] ; inptr0
235 mov rsi, JSAMPROW [rsi+1*SIZEOF_JSAMPROW] ; inptr1(below)
236 mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] ; outptr0
237 mov rdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] ; outptr1
239 test rax, SIZEOF_XMMWORD-1
242 mov dl, JSAMPLE [rcx+(rax-1)*SIZEOF_JSAMPLE]
243 mov JSAMPLE [rcx+rax*SIZEOF_JSAMPLE], dl
244 mov dl, JSAMPLE [rbx+(rax-1)*SIZEOF_JSAMPLE]
245 mov JSAMPLE [rbx+rax*SIZEOF_JSAMPLE], dl
246 mov dl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]
247 mov JSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl ; insert a dummy sample
250 ; -- process the first column block
252 movdqa xmm0, XMMWORD [rbx+0*SIZEOF_XMMWORD] ; xmm0=row[ 0][0]
253 movdqa xmm1, XMMWORD [rcx+0*SIZEOF_XMMWORD] ; xmm1=row[-1][0]
254 movdqa xmm2, XMMWORD [rsi+0*SIZEOF_XMMWORD] ; xmm2=row[+1][0]
256 pxor xmm3, xmm3 ; xmm3=(all 0's)
258 punpcklbw xmm0, xmm3 ; xmm0=row[ 0]( 0 1 2 3 4 5 6 7)
259 punpckhbw xmm4, xmm3 ; xmm4=row[ 0]( 8 9 10 11 12 13 14 15)
261 punpcklbw xmm1, xmm3 ; xmm1=row[-1]( 0 1 2 3 4 5 6 7)
262 punpckhbw xmm5, xmm3 ; xmm5=row[-1]( 8 9 10 11 12 13 14 15)
264 punpcklbw xmm2, xmm3 ; xmm2=row[+1]( 0 1 2 3 4 5 6 7)
265 punpckhbw xmm6, xmm3 ; xmm6=row[+1]( 8 9 10 11 12 13 14 15)
267 pmullw xmm0, [rel PW_THREE]
268 pmullw xmm4, [rel PW_THREE]
271 psrldq xmm7, (SIZEOF_XMMWORD-2)
273 paddw xmm1, xmm0 ; xmm1=Int0L=( 0 1 2 3 4 5 6 7)
274 paddw xmm5, xmm4 ; xmm5=Int0H=( 8 9 10 11 12 13 14 15)
275 paddw xmm2, xmm0 ; xmm2=Int1L=( 0 1 2 3 4 5 6 7)
276 paddw xmm6, xmm4 ; xmm6=Int1H=( 8 9 10 11 12 13 14 15)
278 movdqa XMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1 ; temporarily save
279 movdqa XMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5 ; the intermediate data
280 movdqa XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2
281 movdqa XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm6
283 pand xmm1, xmm7 ; xmm1=( 0 -- -- -- -- -- -- --)
284 pand xmm2, xmm7 ; xmm2=( 0 -- -- -- -- -- -- --)
286 movdqa XMMWORD [wk(0)], xmm1
287 movdqa XMMWORD [wk(1)], xmm2
289 add rax, byte SIZEOF_XMMWORD-1
290 and rax, byte -SIZEOF_XMMWORD
291 cmp rax, byte SIZEOF_XMMWORD
295 ; -- process the last column block
298 pslldq xmm1, (SIZEOF_XMMWORD-2)
301 pand xmm1, XMMWORD [rdx+1*SIZEOF_XMMWORD]
302 pand xmm2, XMMWORD [rdi+1*SIZEOF_XMMWORD]
304 movdqa XMMWORD [wk(2)], xmm1 ; xmm1=(-- -- -- -- -- -- -- 15)
305 movdqa XMMWORD [wk(3)], xmm2 ; xmm2=(-- -- -- -- -- -- -- 15)
310 ; -- process the next column block
312 movdqa xmm0, XMMWORD [rbx+1*SIZEOF_XMMWORD] ; xmm0=row[ 0][1]
313 movdqa xmm1, XMMWORD [rcx+1*SIZEOF_XMMWORD] ; xmm1=row[-1][1]
314 movdqa xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD] ; xmm2=row[+1][1]
316 pxor xmm3, xmm3 ; xmm3=(all 0's)
318 punpcklbw xmm0, xmm3 ; xmm0=row[ 0]( 0 1 2 3 4 5 6 7)
319 punpckhbw xmm4, xmm3 ; xmm4=row[ 0]( 8 9 10 11 12 13 14 15)
321 punpcklbw xmm1, xmm3 ; xmm1=row[-1]( 0 1 2 3 4 5 6 7)
322 punpckhbw xmm5, xmm3 ; xmm5=row[-1]( 8 9 10 11 12 13 14 15)
324 punpcklbw xmm2, xmm3 ; xmm2=row[+1]( 0 1 2 3 4 5 6 7)
325 punpckhbw xmm6, xmm3 ; xmm6=row[+1]( 8 9 10 11 12 13 14 15)
327 pmullw xmm0, [rel PW_THREE]
328 pmullw xmm4, [rel PW_THREE]
330 paddw xmm1, xmm0 ; xmm1=Int0L=( 0 1 2 3 4 5 6 7)
331 paddw xmm5, xmm4 ; xmm5=Int0H=( 8 9 10 11 12 13 14 15)
332 paddw xmm2, xmm0 ; xmm2=Int1L=( 0 1 2 3 4 5 6 7)
333 paddw xmm6, xmm4 ; xmm6=Int1H=( 8 9 10 11 12 13 14 15)
335 movdqa XMMWORD [rdx+2*SIZEOF_XMMWORD], xmm1 ; temporarily save
336 movdqa XMMWORD [rdx+3*SIZEOF_XMMWORD], xmm5 ; the intermediate data
337 movdqa XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2
338 movdqa XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm6
340 pslldq xmm1, (SIZEOF_XMMWORD-2) ; xmm1=(-- -- -- -- -- -- -- 0)
341 pslldq xmm2, (SIZEOF_XMMWORD-2) ; xmm2=(-- -- -- -- -- -- -- 0)
343 movdqa XMMWORD [wk(2)], xmm1
344 movdqa XMMWORD [wk(3)], xmm2
347 ; -- process the upper row
349 movdqa xmm7, XMMWORD [rdx+0*SIZEOF_XMMWORD]
350 movdqa xmm3, XMMWORD [rdx+1*SIZEOF_XMMWORD]
352 movdqa xmm0, xmm7 ; xmm7=Int0L=( 0 1 2 3 4 5 6 7)
353 movdqa xmm4, xmm3 ; xmm3=Int0H=( 8 9 10 11 12 13 14 15)
354 psrldq xmm0, 2 ; xmm0=( 1 2 3 4 5 6 7 --)
355 pslldq xmm4, (SIZEOF_XMMWORD-2) ; xmm4=(-- -- -- -- -- -- -- 8)
358 psrldq xmm5, (SIZEOF_XMMWORD-2) ; xmm5=( 7 -- -- -- -- -- -- --)
359 pslldq xmm6, 2 ; xmm6=(-- 8 9 10 11 12 13 14)
361 por xmm0, xmm4 ; xmm0=( 1 2 3 4 5 6 7 8)
362 por xmm5, xmm6 ; xmm5=( 7 8 9 10 11 12 13 14)
366 pslldq xmm1, 2 ; xmm1=(-- 0 1 2 3 4 5 6)
367 psrldq xmm2, 2 ; xmm2=( 9 10 11 12 13 14 15 --)
369 psrldq xmm4, (SIZEOF_XMMWORD-2) ; xmm4=(15 -- -- -- -- -- -- --)
371 por xmm1, XMMWORD [wk(0)] ; xmm1=(-1 0 1 2 3 4 5 6)
372 por xmm2, XMMWORD [wk(2)] ; xmm2=( 9 10 11 12 13 14 15 16)
374 movdqa XMMWORD [wk(0)], xmm4
376 pmullw xmm7, [rel PW_THREE]
377 pmullw xmm3, [rel PW_THREE]
378 paddw xmm1, [rel PW_EIGHT]
379 paddw xmm5, [rel PW_EIGHT]
380 paddw xmm0, [rel PW_SEVEN]
381 paddw xmm2, [rel PW_SEVEN]
385 psrlw xmm1, 4 ; xmm1=Out0LE=( 0 2 4 6 8 10 12 14)
386 psrlw xmm5, 4 ; xmm5=Out0HE=(16 18 20 22 24 26 28 30)
389 psrlw xmm0, 4 ; xmm0=Out0LO=( 1 3 5 7 9 11 13 15)
390 psrlw xmm2, 4 ; xmm2=Out0HO=(17 19 21 23 25 27 29 31)
394 por xmm1, xmm0 ; xmm1=Out0L=( 0 1 2 ... 13 14 15)
395 por xmm5, xmm2 ; xmm5=Out0H=(16 17 18 ... 29 30 31)
397 movdqa XMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1
398 movdqa XMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5
400 ; -- process the lower row
402 movdqa xmm6, XMMWORD [rdi+0*SIZEOF_XMMWORD]
403 movdqa xmm4, XMMWORD [rdi+1*SIZEOF_XMMWORD]
405 movdqa xmm7, xmm6 ; xmm6=Int1L=( 0 1 2 3 4 5 6 7)
406 movdqa xmm3, xmm4 ; xmm4=Int1H=( 8 9 10 11 12 13 14 15)
407 psrldq xmm7, 2 ; xmm7=( 1 2 3 4 5 6 7 --)
408 pslldq xmm3, (SIZEOF_XMMWORD-2) ; xmm3=(-- -- -- -- -- -- -- 8)
411 psrldq xmm0, (SIZEOF_XMMWORD-2) ; xmm0=( 7 -- -- -- -- -- -- --)
412 pslldq xmm2, 2 ; xmm2=(-- 8 9 10 11 12 13 14)
414 por xmm7, xmm3 ; xmm7=( 1 2 3 4 5 6 7 8)
415 por xmm0, xmm2 ; xmm0=( 7 8 9 10 11 12 13 14)
419 pslldq xmm1, 2 ; xmm1=(-- 0 1 2 3 4 5 6)
420 psrldq xmm5, 2 ; xmm5=( 9 10 11 12 13 14 15 --)
422 psrldq xmm3, (SIZEOF_XMMWORD-2) ; xmm3=(15 -- -- -- -- -- -- --)
424 por xmm1, XMMWORD [wk(1)] ; xmm1=(-1 0 1 2 3 4 5 6)
425 por xmm5, XMMWORD [wk(3)] ; xmm5=( 9 10 11 12 13 14 15 16)
427 movdqa XMMWORD [wk(1)], xmm3
429 pmullw xmm6, [rel PW_THREE]
430 pmullw xmm4, [rel PW_THREE]
431 paddw xmm1, [rel PW_EIGHT]
432 paddw xmm0, [rel PW_EIGHT]
433 paddw xmm7, [rel PW_SEVEN]
434 paddw xmm5, [rel PW_SEVEN]
438 psrlw xmm1, 4 ; xmm1=Out1LE=( 0 2 4 6 8 10 12 14)
439 psrlw xmm0, 4 ; xmm0=Out1HE=(16 18 20 22 24 26 28 30)
442 psrlw xmm7, 4 ; xmm7=Out1LO=( 1 3 5 7 9 11 13 15)
443 psrlw xmm5, 4 ; xmm5=Out1HO=(17 19 21 23 25 27 29 31)
447 por xmm1, xmm7 ; xmm1=Out1L=( 0 1 2 ... 13 14 15)
448 por xmm0, xmm5 ; xmm0=Out1H=(16 17 18 ... 29 30 31)
450 movdqa XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm1
451 movdqa XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm0
453 sub rax, byte SIZEOF_XMMWORD
454 add rcx, byte 1*SIZEOF_XMMWORD ; inptr1(above)
455 add rbx, byte 1*SIZEOF_XMMWORD ; inptr0
456 add rsi, byte 1*SIZEOF_XMMWORD ; inptr1(below)
457 add rdx, byte 2*SIZEOF_XMMWORD ; outptr0
458 add rdi, byte 2*SIZEOF_XMMWORD ; outptr1
459 cmp rax, byte SIZEOF_XMMWORD
462 jnz near .columnloop_last
469 add rsi, byte 1*SIZEOF_JSAMPROW ; input_data
470 add rdi, byte 2*SIZEOF_JSAMPROW ; output_data
471 sub rcx, byte 2 ; rowctr
477 mov rsp, rbp ; rsp <- aligned rbp
478 pop rsp ; rsp <- original rbp
482 ; --------------------------------------------------------------------------
484 ; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
485 ; It's still a box filter.
488 ; jsimd_h2v1_upsample_sse2(int max_v_samp_factor, JDIMENSION output_width,
489 ; JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
492 ; r10 = int max_v_samp_factor
493 ; r11d = JDIMENSION output_width
494 ; r12 = JSAMPARRAY input_data
495 ; r13 = JSAMPARRAY *output_data_ptr
498 GLOBAL_FUNCTION(jsimd_h2v1_upsample_sse2)
500 EXTN(jsimd_h2v1_upsample_sse2):
507 add rdx, byte (2*SIZEOF_XMMWORD)-1
508 and rdx, byte -(2*SIZEOF_XMMWORD)
511 mov rcx, r10 ; rowctr
515 mov rsi, r12 ; input_data
517 mov rdi, JSAMPARRAY [rdi] ; output_data
522 mov rsi, JSAMPROW [rsi] ; inptr
523 mov rdi, JSAMPROW [rdi] ; outptr
524 mov rax, rdx ; colctr
527 movdqa xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]
533 movdqa XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0
534 movdqa XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1
536 sub rax, byte 2*SIZEOF_XMMWORD
539 movdqa xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]
545 movdqa XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2
546 movdqa XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3
548 sub rax, byte 2*SIZEOF_XMMWORD
551 add rsi, byte 2*SIZEOF_XMMWORD ; inptr
552 add rdi, byte 4*SIZEOF_XMMWORD ; outptr
553 jmp short .columnloop
559 add rsi, byte SIZEOF_JSAMPROW ; input_data
560 add rdi, byte SIZEOF_JSAMPROW ; output_data
569 ; --------------------------------------------------------------------------
571 ; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
572 ; It's still a box filter.
575 ; jsimd_h2v2_upsample_sse2(int max_v_samp_factor, JDIMENSION output_width,
576 ; JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
579 ; r10 = int max_v_samp_factor
580 ; r11d = JDIMENSION output_width
581 ; r12 = JSAMPARRAY input_data
582 ; r13 = JSAMPARRAY *output_data_ptr
585 GLOBAL_FUNCTION(jsimd_h2v2_upsample_sse2)
587 EXTN(jsimd_h2v2_upsample_sse2):
595 add rdx, byte (2*SIZEOF_XMMWORD)-1
596 and rdx, byte -(2*SIZEOF_XMMWORD)
599 mov rcx, r10 ; rowctr
603 mov rsi, r12 ; input_data
605 mov rdi, JSAMPARRAY [rdi] ; output_data
610 mov rsi, JSAMPROW [rsi] ; inptr
611 mov rbx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] ; outptr0
612 mov rdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] ; outptr1
613 mov rax, rdx ; colctr
616 movdqa xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]
622 movdqa XMMWORD [rbx+0*SIZEOF_XMMWORD], xmm0
623 movdqa XMMWORD [rbx+1*SIZEOF_XMMWORD], xmm1
624 movdqa XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0
625 movdqa XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1
627 sub rax, byte 2*SIZEOF_XMMWORD
630 movdqa xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]
636 movdqa XMMWORD [rbx+2*SIZEOF_XMMWORD], xmm2
637 movdqa XMMWORD [rbx+3*SIZEOF_XMMWORD], xmm3
638 movdqa XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2
639 movdqa XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3
641 sub rax, byte 2*SIZEOF_XMMWORD
644 add rsi, byte 2*SIZEOF_XMMWORD ; inptr
645 add rbx, byte 4*SIZEOF_XMMWORD ; outptr0
646 add rdi, byte 4*SIZEOF_XMMWORD ; outptr1
647 jmp short .columnloop
653 add rsi, byte 1*SIZEOF_JSAMPROW ; input_data
654 add rdi, byte 2*SIZEOF_JSAMPROW ; output_data
655 sub rcx, byte 2 ; rowctr
664 ; For some reason, the OS X linker does not honor the request to align the
665 ; segment unless we do this.