~mc.../inkscape/inkscape

« back to all changes in this revision

Viewing changes to src/libnr/nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP.S

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
        .file   "nr-compose.c"
 
2
        
 
3
# Ensure Inkscape is execshield protected
 
4
        .section .note.GNU-stack
 
5
        .previous
 
6
        
 
7
        .text
 
8
        .align 2
 
9
.globl nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP
 
10
        .type   nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP,@function
 
11
 
 
12
/*
 
13
 * This code is in public domain
 
14
 *
 
15
 * c     32(%ebp)
 
16
 * srs   28(%ebp)
 
17
 * spx   24(%ebp)
 
18
 * rs    20(%ebp)
 
19
 * h     16(%ebp)
 
20
 * w     12(%ebp)
 
21
 * px    8(%ebp)
 
22
 * r    -8(%ebp)
 
23
 * g    -12(%ebp)
 
24
 * b    -16(%ebp)
 
25
 * a    -20(%ebp)
 
26
 * s    -24(%ebp) -> %esi
 
27
 * d    -28(%ebp) -> %edi
 
28
 * x    -32(%ebp) -> %ebx
 
29
 * y    -36(%ebp)
 
30
 * ca   -40(%ebp)
 
31
 *
 
32
 * mm0 Fg
 
33
 * mm1 FgA
 
34
 * mm2 FgPre
 
35
 * mm3
 
36
 * mm4
 
37
 * mm5
 
38
 * mm6 128
 
39
 * mm7 0
 
40
 *
 
41
*/
 
42
 
 
43
nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP:
 
44
        pushl   %ebp
 
45
        movl    %esp, %ebp
 
46
        pushl   %ebx
 
47
        subl    $36, %esp
 
48
        pushl   %edi
 
49
        pushl   %esi
 
50
 
 
51
/* Load %mm7 with [0 0 0 0] */
 
52
        movl    $0, %eax
 
53
        movd    %eax, %mm7
 
54
 
 
55
/* Load %mm6 with [128 128 128 128] */
 
56
        movl    $0x80808080, %eax
 
57
        movd    %eax, %mm6
 
58
        punpcklbw %mm7, %mm6
 
59
 
 
60
/* FgC -> %mm0 */
 
61
        movl    32(%ebp), %eax
 
62
        movd    (%eax), %mm0
 
63
        punpcklbw %mm7, %mm0
 
64
 
 
65
/* for (y = ...) */
 
66
        movl    16(%ebp), %ecx
 
67
.fory:
 
68
 
 
69
/* d = px */
 
70
/* s = spx */
 
71
        movl    8(%ebp), %edi
 
72
        movl    24(%ebp), %esi
 
73
 
 
74
/* for (x = ...) */
 
75
        movl    12(%ebp), %ebx
 
76
.forx:
 
77
 
 
78
/* [m m m m] -> %mm1 */
 
79
        movzbl  (%esi), %eax
 
80
        testb   $0xff, %al
 
81
        jz      .clip
 
82
        movd    %eax, %mm1
 
83
        punpcklwd %mm1, %mm1
 
84
        punpckldq %mm1, %mm1
 
85
 
 
86
/* Fg -> mm2 */
 
87
        movq    %mm0, %mm2
 
88
        pmullw  %mm1, %mm2
 
89
        paddw   %mm6, %mm2
 
90
        movq    %mm2, %mm3
 
91
        psrlw   $8, %mm3
 
92
        paddw   %mm3, %mm2
 
93
        psrlw   $8, %mm2
 
94
 
 
95
/* Store pixel */
 
96
        packuswb %mm2, %mm2
 
97
        movd    %mm2, (%edi)
 
98
 
 
99
.clip:
 
100
        addl    $4, %edi
 
101
        incl    %esi
 
102
 
 
103
        decl    %ebx
 
104
        jnz     .forx
 
105
 
 
106
        movl    20(%ebp), %eax
 
107
        addl    %eax, 8(%ebp)
 
108
        movl    28(%ebp), %eax
 
109
        addl    %eax, 24(%ebp)
 
110
 
 
111
        decl    %ecx
 
112
        jnz     .fory
 
113
 
 
114
.exit:
 
115
        emms
 
116
        popl    %esi
 
117
        popl    %edi
 
118
        addl    $36, %esp
 
119
        popl    %ebx
 
120
        popl    %ebp
 
121
        ret
 
122
 
 
123
.Lfe1:
 
124
        .size   nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP,.Lfe1-nr_mmx_R8G8B8A8_P_EMPTY_A8_RGBAP
 
125
        .ident  "GCC: (GNU) 3.2"