OLD | NEW |
1 ; | 1 ; |
2 ; jdmrgext.asm - merged upsampling/color conversion (SSE2) | 2 ; jdmrgext.asm - merged upsampling/color conversion (SSE2) |
3 ; | 3 ; |
4 ; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB | 4 ; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB |
5 ; Copyright 2012 D. R. Commander | 5 ; Copyright 2012 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 input_buf(b) (b)+12 ; JSAMPIMAGE input_buf | 34 %define input_buf(b) (b)+12 ; JSAMPIMAGE input_buf |
35 %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr | 35 %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr |
36 %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf | 36 %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf |
37 | 37 |
38 %define original_ebp ebp+0 | 38 %define original_ebp ebp+0 |
39 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] | 39 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] |
40 %define WK_NUM 3 | 40 %define WK_NUM 3 |
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_h2v1_merged_upsample_sse2) | 44 global EXTN(jsimd_h2v1_merged_upsample_sse2) PRIVATE |
45 | 45 |
46 EXTN(jsimd_h2v1_merged_upsample_sse2): | 46 EXTN(jsimd_h2v1_merged_upsample_sse2): |
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_XMMWORD) ; align to 128 bits | 50 and esp, byte (-SIZEOF_XMMWORD) ; align to 128 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 ; JDIMENSION in_row_group_ctr, | 457 ; JDIMENSION in_row_group_ctr, |
458 ; JSAMPARRAY output_buf); | 458 ; JSAMPARRAY output_buf); |
459 ; | 459 ; |
460 | 460 |
461 %define output_width(b) (b)+8 ; JDIMENSION output_width | 461 %define output_width(b) (b)+8 ; JDIMENSION output_width |
462 %define input_buf(b) (b)+12 ; JSAMPIMAGE input_buf | 462 %define input_buf(b) (b)+12 ; JSAMPIMAGE input_buf |
463 %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr | 463 %define in_row_group_ctr(b) (b)+16 ; JDIMENSION in_row_group_ctr |
464 %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf | 464 %define output_buf(b) (b)+20 ; JSAMPARRAY output_buf |
465 | 465 |
466 align 16 | 466 align 16 |
467 global EXTN(jsimd_h2v2_merged_upsample_sse2) | 467 global EXTN(jsimd_h2v2_merged_upsample_sse2) PRIVATE |
468 | 468 |
469 EXTN(jsimd_h2v2_merged_upsample_sse2): | 469 EXTN(jsimd_h2v2_merged_upsample_sse2): |
470 push ebp | 470 push ebp |
471 mov ebp,esp | 471 mov ebp,esp |
472 push ebx | 472 push ebx |
473 ; push ecx ; need not be preserved | 473 ; push ecx ; need not be preserved |
474 ; push edx ; need not be preserved | 474 ; push edx ; need not be preserved |
475 push esi | 475 push esi |
476 push edi | 476 push edi |
477 | 477 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 pop esi | 510 pop esi |
511 ; pop edx ; need not be preserved | 511 ; pop edx ; need not be preserved |
512 ; pop ecx ; need not be preserved | 512 ; pop ecx ; need not be preserved |
513 pop ebx | 513 pop ebx |
514 pop ebp | 514 pop ebp |
515 ret | 515 ret |
516 | 516 |
517 ; For some reason, the OS X linker does not honor the request to align the | 517 ; For some reason, the OS X linker does not honor the request to align the |
518 ; segment unless we do this. | 518 ; segment unless we do this. |
519 align 16 | 519 align 16 |
OLD | NEW |