| OLD | NEW |
| 1 ; | 1 ; |
| 2 ; jcgryext.asm - grayscale colorspace conversion (64-bit SSE2) | 2 ; jcgryext.asm - grayscale colorspace conversion (64-bit SSE2) |
| 3 ; | 3 ; |
| 4 ; x86 SIMD extension for IJG JPEG library | 4 ; x86 SIMD extension for IJG JPEG library |
| 5 ; Copyright (C) 1999-2006, MIYASAKA Masaru. | 5 ; Copyright (C) 1999-2006, MIYASAKA Masaru. |
| 6 ; Copyright (C) 2011, D. R. Commander. | 6 ; Copyright (C) 2011, D. R. Commander. |
| 7 ; For conditions of distribution and use, see copyright notice in jsimdext.inc | 7 ; For conditions of distribution and use, see copyright notice in jsimdext.inc |
| 8 ; | 8 ; |
| 9 ; This file should be assembled with NASM (Netwide Assembler), | 9 ; This file should be assembled with NASM (Netwide Assembler), |
| 10 ; can *not* be assembled with Microsoft's MASM or any compatible | 10 ; can *not* be assembled with Microsoft's MASM or any compatible |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 ; r11 = JSAMPARRAY input_buf | 30 ; r11 = JSAMPARRAY input_buf |
| 31 ; r12 = JSAMPIMAGE output_buf | 31 ; r12 = JSAMPIMAGE output_buf |
| 32 ; r13 = JDIMENSION output_row | 32 ; r13 = JDIMENSION output_row |
| 33 ; r14 = int num_rows | 33 ; r14 = int num_rows |
| 34 | 34 |
| 35 %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] | 35 %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] |
| 36 %define WK_NUM 2 | 36 %define WK_NUM 2 |
| 37 | 37 |
| 38 align 16 | 38 align 16 |
| 39 | 39 |
| 40 global EXTN(jsimd_rgb_gray_convert_sse2) | 40 global EXTN(jsimd_rgb_gray_convert_sse2) PRIVATE |
| 41 | 41 |
| 42 EXTN(jsimd_rgb_gray_convert_sse2): | 42 EXTN(jsimd_rgb_gray_convert_sse2): |
| 43 push rbp | 43 push rbp |
| 44 mov rax,rsp ; rax = original rbp | 44 mov rax,rsp ; rax = original rbp |
| 45 sub rsp, byte 4 | 45 sub rsp, byte 4 |
| 46 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits | 46 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits |
| 47 mov [rsp],rax | 47 mov [rsp],rax |
| 48 mov rbp,rsp ; rbp = aligned rbp | 48 mov rbp,rsp ; rbp = aligned rbp |
| 49 lea rsp, [wk(0)] | 49 lea rsp, [wk(0)] |
| 50 collect_args | 50 collect_args |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 pop rbx | 355 pop rbx |
| 356 uncollect_args | 356 uncollect_args |
| 357 mov rsp,rbp ; rsp <- aligned rbp | 357 mov rsp,rbp ; rsp <- aligned rbp |
| 358 pop rsp ; rsp <- original rbp | 358 pop rsp ; rsp <- original rbp |
| 359 pop rbp | 359 pop rbp |
| 360 ret | 360 ret |
| 361 | 361 |
| 362 ; For some reason, the OS X linker does not honor the request to align the | 362 ; For some reason, the OS X linker does not honor the request to align the |
| 363 ; segment unless we do this. | 363 ; segment unless we do this. |
| 364 align 16 | 364 align 16 |
| OLD | NEW |