OLD | NEW |
1 ; | 1 ; |
2 ; jcgryext.asm - grayscale colorspace conversion (SSE2) | 2 ; jcgryext.asm - grayscale colorspace conversion (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 21 matching lines...) Expand all Loading... |
32 %define output_row(b) (b)+20 ; JDIMENSION output_row | 32 %define output_row(b) (b)+20 ; JDIMENSION output_row |
33 %define num_rows(b) (b)+24 ; int num_rows | 33 %define num_rows(b) (b)+24 ; int num_rows |
34 | 34 |
35 %define original_ebp ebp+0 | 35 %define original_ebp ebp+0 |
36 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] | 36 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] |
37 %define WK_NUM 2 | 37 %define WK_NUM 2 |
38 %define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr | 38 %define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr |
39 | 39 |
40 align 16 | 40 align 16 |
41 | 41 |
42 global EXTN(jsimd_rgb_gray_convert_sse2) | 42 global EXTN(jsimd_rgb_gray_convert_sse2) PRIVATE |
43 | 43 |
44 EXTN(jsimd_rgb_gray_convert_sse2): | 44 EXTN(jsimd_rgb_gray_convert_sse2): |
45 push ebp | 45 push ebp |
46 mov eax,esp ; eax = original ebp | 46 mov eax,esp ; eax = original ebp |
47 sub esp, byte 4 | 47 sub esp, byte 4 |
48 and esp, byte (-SIZEOF_XMMWORD) ; align to 128 bits | 48 and esp, byte (-SIZEOF_XMMWORD) ; align to 128 bits |
49 mov [esp],eax | 49 mov [esp],eax |
50 mov ebp,esp ; ebp = aligned ebp | 50 mov ebp,esp ; ebp = aligned ebp |
51 lea esp, [wk(0)] | 51 lea esp, [wk(0)] |
52 pushpic eax ; make a room for GOT address | 52 pushpic eax ; make a room for GOT address |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 ; pop ecx ; need not be preserved | 374 ; pop ecx ; need not be preserved |
375 pop ebx | 375 pop ebx |
376 mov esp,ebp ; esp <- aligned ebp | 376 mov esp,ebp ; esp <- aligned ebp |
377 pop esp ; esp <- original ebp | 377 pop esp ; esp <- original ebp |
378 pop ebp | 378 pop ebp |
379 ret | 379 ret |
380 | 380 |
381 ; For some reason, the OS X linker does not honor the request to align the | 381 ; For some reason, the OS X linker does not honor the request to align the |
382 ; segment unless we do this. | 382 ; segment unless we do this. |
383 align 16 | 383 align 16 |
OLD | NEW |