OLD | NEW |
1 ; | 1 ; |
2 ; jcgryext.asm - grayscale colorspace conversion (MMX) | 2 ; jcgryext.asm - grayscale colorspace conversion (MMX) |
3 ; | 3 ; |
4 ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB | 4 ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
5 ; Copyright 2011 D. R. Commander | 5 ; Copyright 2011 D. R. Commander |
6 ; | 6 ; |
7 ; Based on | 7 ; Based on |
8 ; x86 SIMD extension for IJG JPEG library | 8 ; x86 SIMD extension for IJG JPEG library |
9 ; Copyright (C) 1999-2006, MIYASAKA Masaru. | 9 ; Copyright (C) 1999-2006, MIYASAKA Masaru. |
10 ; For conditions of distribution and use, see copyright notice in jsimdext.inc | 10 ; For conditions of distribution and use, see copyright notice in jsimdext.inc |
(...skipping 23 matching lines...) Expand all Loading... |
34 %define output_buf(b) (b)+16 ; JSAMPIMAGE output_buf | 34 %define output_buf(b) (b)+16 ; JSAMPIMAGE output_buf |
35 %define output_row(b) (b)+20 ; JDIMENSION output_row | 35 %define output_row(b) (b)+20 ; JDIMENSION output_row |
36 %define num_rows(b) (b)+24 ; int num_rows | 36 %define num_rows(b) (b)+24 ; int num_rows |
37 | 37 |
38 %define original_ebp ebp+0 | 38 %define original_ebp ebp+0 |
39 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] | 39 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] |
40 %define WK_NUM 2 | 40 %define WK_NUM 2 |
41 %define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr | 41 %define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr |
42 | 42 |
43 align 16 | 43 align 16 |
44 global EXTN(jsimd_rgb_gray_convert_mmx) | 44 global EXTN(jsimd_rgb_gray_convert_mmx) PRIVATE |
45 | 45 |
46 EXTN(jsimd_rgb_gray_convert_mmx): | 46 EXTN(jsimd_rgb_gray_convert_mmx): |
47 push ebp | 47 push ebp |
48 mov eax,esp ; eax = original ebp | 48 mov eax,esp ; eax = original ebp |
49 sub esp, byte 4 | 49 sub esp, byte 4 |
50 and esp, byte (-SIZEOF_MMWORD) ; align to 64 bits | 50 and esp, byte (-SIZEOF_MMWORD) ; align to 64 bits |
51 mov [esp],eax | 51 mov [esp],eax |
52 mov ebp,esp ; ebp = aligned ebp | 52 mov ebp,esp ; ebp = aligned ebp |
53 lea esp, [wk(0)] | 53 lea esp, [wk(0)] |
54 pushpic eax ; make a room for GOT address | 54 pushpic eax ; make a room for GOT address |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 ; pop ecx ; need not be preserved | 348 ; pop ecx ; need not be preserved |
349 pop ebx | 349 pop ebx |
350 mov esp,ebp ; esp <- aligned ebp | 350 mov esp,ebp ; esp <- aligned ebp |
351 pop esp ; esp <- original ebp | 351 pop esp ; esp <- original ebp |
352 pop ebp | 352 pop ebp |
353 ret | 353 ret |
354 | 354 |
355 ; For some reason, the OS X linker does not honor the request to align the | 355 ; For some reason, the OS X linker does not honor the request to align the |
356 ; segment unless we do this. | 356 ; segment unless we do this. |
357 align 16 | 357 align 16 |
OLD | NEW |