diff options
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c new file mode 100644 index 0000000..52751f4 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_color_i386.c | |||
@@ -0,0 +1,221 @@ | |||
1 | /* blend pixel x color --> dst */ | ||
2 | |||
3 | #ifdef BUILD_MMX | ||
4 | static void | ||
5 | _op_blend_p_c_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { | ||
6 | DATA32 *e = d + l; | ||
7 | MOV_A2R(ALPHA_256, mm6) | ||
8 | MOV_A2R(ALPHA_255, mm5) | ||
9 | pxor_r2r(mm0, mm0); | ||
10 | MOV_P2R(c, mm2, mm0) | ||
11 | while (d < e) { | ||
12 | MOV_P2R(*s, mm3, mm0) | ||
13 | MUL4_SYM_R2R(mm2, mm3, mm5) | ||
14 | |||
15 | MOV_RA2R(mm3, mm1) | ||
16 | movq_r2r(mm6, mm4); | ||
17 | psubw_r2r(mm1, mm4); | ||
18 | |||
19 | MOV_P2R(*d, mm1, mm0) | ||
20 | MUL4_256_R2R(mm4, mm1) | ||
21 | |||
22 | paddw_r2r(mm3, mm1); | ||
23 | MOV_R2P(mm1, *d, mm0) | ||
24 | s++; d++; | ||
25 | } | ||
26 | } | ||
27 | |||
28 | static void | ||
29 | _op_blend_pan_can_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { | ||
30 | DATA32 *e = d + l; | ||
31 | pxor_r2r(mm0, mm0); | ||
32 | MOV_P2R(c, mm2, mm0) | ||
33 | MOV_A2R(ALPHA_255, mm5) | ||
34 | while (d < e) { | ||
35 | MOV_P2R(*s, mm1, mm0) | ||
36 | MUL4_SYM_R2R(mm2, mm1, mm5) | ||
37 | MOV_R2P(mm1, *d, mm0) | ||
38 | s++; d++; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | static void | ||
43 | _op_blend_pan_caa_dp_mmx(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { | ||
44 | DATA32 *e = d + l; | ||
45 | c = 1 + (c & 0xff); | ||
46 | MOV_A2R(c, mm2) | ||
47 | MOV_A2R(ALPHA_255, mm5) | ||
48 | pxor_r2r(mm0, mm0); | ||
49 | while (d < e) { | ||
50 | MOV_P2R(*s, mm3, mm0) | ||
51 | MOV_P2R(*d, mm1, mm0) | ||
52 | INTERP_256_R2R(mm2, mm3, mm1, mm5) | ||
53 | MOV_R2P(mm1, *d, mm0) | ||
54 | s++; d++; | ||
55 | } | ||
56 | } | ||
57 | |||
58 | #define _op_blend_pas_c_dp_mmx _op_blend_p_c_dp_mmx | ||
59 | #define _op_blend_pan_c_dp_mmx _op_blend_p_c_dp_mmx | ||
60 | #define _op_blend_p_can_dp_mmx _op_blend_p_c_dp_mmx | ||
61 | #define _op_blend_pas_can_dp_mmx _op_blend_p_c_dp_mmx | ||
62 | #define _op_blend_p_caa_dp_mmx _op_blend_p_c_dp_mmx | ||
63 | #define _op_blend_pas_caa_dp_mmx _op_blend_p_c_dp_mmx | ||
64 | |||
65 | #define _op_blend_p_c_dpan_mmx _op_blend_p_c_dp_mmx | ||
66 | #define _op_blend_pas_c_dpan_mmx _op_blend_pas_c_dp_mmx | ||
67 | #define _op_blend_pan_c_dpan_mmx _op_blend_pan_c_dp_mmx | ||
68 | #define _op_blend_p_can_dpan_mmx _op_blend_p_can_dp_mmx | ||
69 | #define _op_blend_pas_can_dpan_mmx _op_blend_pas_can_dp_mmx | ||
70 | #define _op_blend_pan_can_dpan_mmx _op_blend_pan_can_dp_mmx | ||
71 | #define _op_blend_p_caa_dpan_mmx _op_blend_p_caa_dp_mmx | ||
72 | #define _op_blend_pas_caa_dpan_mmx _op_blend_pas_caa_dp_mmx | ||
73 | #define _op_blend_pan_caa_dpan_mmx _op_blend_pan_caa_dp_mmx | ||
74 | |||
75 | |||
76 | static void | ||
77 | init_blend_pixel_color_span_funcs_mmx(void) | ||
78 | { | ||
79 | op_blend_span_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_blend_p_c_dp_mmx; | ||
80 | op_blend_span_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_blend_pas_c_dp_mmx; | ||
81 | op_blend_span_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_blend_pan_c_dp_mmx; | ||
82 | op_blend_span_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_p_can_dp_mmx; | ||
83 | op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pas_can_dp_mmx; | ||
84 | op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pan_can_dp_mmx; | ||
85 | op_blend_span_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_p_caa_dp_mmx; | ||
86 | op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pas_caa_dp_mmx; | ||
87 | op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pan_caa_dp_mmx; | ||
88 | |||
89 | op_blend_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_p_c_dpan_mmx; | ||
90 | op_blend_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pas_c_dpan_mmx; | ||
91 | op_blend_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pan_c_dpan_mmx; | ||
92 | op_blend_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_p_can_dpan_mmx; | ||
93 | op_blend_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pas_can_dpan_mmx; | ||
94 | op_blend_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pan_can_dpan_mmx; | ||
95 | op_blend_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_p_caa_dpan_mmx; | ||
96 | op_blend_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pas_caa_dpan_mmx; | ||
97 | op_blend_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pan_caa_dpan_mmx; | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | #ifdef BUILD_MMX | ||
102 | static void | ||
103 | _op_blend_pt_p_c_dp_mmx(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) { | ||
104 | MOV_A2R(ALPHA_256, mm4) | ||
105 | MOV_A2R(ALPHA_255, mm5) | ||
106 | pxor_r2r(mm0, mm0); | ||
107 | MOV_P2R(c, mm2, mm0) | ||
108 | MOV_P2R(s, mm3, mm0) | ||
109 | MUL4_SYM_R2R(mm2, mm3, mm5) | ||
110 | |||
111 | MOV_RA2R(mm3, mm1) | ||
112 | psubw_r2r(mm1, mm4); | ||
113 | |||
114 | MOV_P2R(*d, mm1, mm0) | ||
115 | MUL4_256_R2R(mm4, mm1) | ||
116 | |||
117 | paddw_r2r(mm3, mm1); | ||
118 | MOV_R2P(mm1, *d, mm0) | ||
119 | } | ||
120 | |||
121 | #define _op_blend_pt_pas_c_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
122 | #define _op_blend_pt_pan_c_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
123 | #define _op_blend_pt_p_can_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
124 | #define _op_blend_pt_pas_can_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
125 | #define _op_blend_pt_pan_can_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
126 | #define _op_blend_pt_p_caa_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
127 | #define _op_blend_pt_pas_caa_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
128 | #define _op_blend_pt_pan_caa_dp_mmx _op_blend_pt_p_c_dp_mmx | ||
129 | |||
130 | #define _op_blend_pt_p_c_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
131 | #define _op_blend_pt_pas_c_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
132 | #define _op_blend_pt_pan_c_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
133 | #define _op_blend_pt_p_can_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
134 | #define _op_blend_pt_pas_can_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
135 | #define _op_blend_pt_pan_can_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
136 | #define _op_blend_pt_p_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
137 | #define _op_blend_pt_pas_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
138 | #define _op_blend_pt_pan_caa_dpan_mmx _op_blend_pt_p_c_dp_mmx | ||
139 | |||
140 | static void | ||
141 | init_blend_pixel_color_pt_funcs_mmx(void) | ||
142 | { | ||
143 | op_blend_pt_funcs[SP][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_p_c_dp_mmx; | ||
144 | op_blend_pt_funcs[SP_AS][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_pas_c_dp_mmx; | ||
145 | op_blend_pt_funcs[SP_AN][SM_N][SC][DP][CPU_MMX] = _op_blend_pt_pan_c_dp_mmx; | ||
146 | op_blend_pt_funcs[SP][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_p_can_dp_mmx; | ||
147 | op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_pas_can_dp_mmx; | ||
148 | op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP][CPU_MMX] = _op_blend_pt_pan_can_dp_mmx; | ||
149 | op_blend_pt_funcs[SP][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_p_caa_dp_mmx; | ||
150 | op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_pas_caa_dp_mmx; | ||
151 | op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_MMX] = _op_blend_pt_pan_caa_dp_mmx; | ||
152 | |||
153 | op_blend_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_p_c_dpan_mmx; | ||
154 | op_blend_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_pas_c_dpan_mmx; | ||
155 | op_blend_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_pt_pan_c_dpan_mmx; | ||
156 | op_blend_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_p_can_dpan_mmx; | ||
157 | op_blend_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_pas_can_dpan_mmx; | ||
158 | op_blend_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_pan_can_dpan_mmx; | ||
159 | op_blend_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_p_caa_dpan_mmx; | ||
160 | op_blend_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_pas_caa_dpan_mmx; | ||
161 | op_blend_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_pan_caa_dpan_mmx; | ||
162 | } | ||
163 | #endif | ||
164 | |||
165 | /*-----*/ | ||
166 | |||
167 | /* blend_rel pixel x color -> dst */ | ||
168 | |||
169 | #ifdef BUILD_MMX | ||
170 | |||
171 | #define _op_blend_rel_p_c_dpan_mmx _op_blend_p_c_dpan_mmx | ||
172 | #define _op_blend_rel_pas_c_dpan_mmx _op_blend_pas_c_dpan_mmx | ||
173 | #define _op_blend_rel_pan_c_dpan_mmx _op_blend_pan_c_dpan_mmx | ||
174 | #define _op_blend_rel_p_can_dpan_mmx _op_blend_p_can_dpan_mmx | ||
175 | #define _op_blend_rel_pas_can_dpan_mmx _op_blend_pas_can_dpan_mmx | ||
176 | #define _op_blend_rel_pan_can_dpan_mmx _op_blend_pan_can_dpan_mmx | ||
177 | #define _op_blend_rel_p_caa_dpan_mmx _op_blend_p_caa_dpan_mmx | ||
178 | #define _op_blend_rel_pas_caa_dpan_mmx _op_blend_pas_caa_dpan_mmx | ||
179 | #define _op_blend_rel_pan_caa_dpan_mmx _op_blend_pan_caa_dpan_mmx | ||
180 | |||
181 | static void | ||
182 | init_blend_rel_pixel_color_span_funcs_mmx(void) | ||
183 | { | ||
184 | op_blend_rel_span_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_p_c_dpan_mmx; | ||
185 | op_blend_rel_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pas_c_dpan_mmx; | ||
186 | op_blend_rel_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pan_c_dpan_mmx; | ||
187 | op_blend_rel_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_p_can_dpan_mmx; | ||
188 | op_blend_rel_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pas_can_dpan_mmx; | ||
189 | op_blend_rel_span_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pan_can_dpan_mmx; | ||
190 | op_blend_rel_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_p_caa_dpan_mmx; | ||
191 | op_blend_rel_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pas_caa_dpan_mmx; | ||
192 | op_blend_rel_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pan_caa_dpan_mmx; | ||
193 | } | ||
194 | #endif | ||
195 | |||
196 | #ifdef BUILD_MMX | ||
197 | |||
198 | #define _op_blend_rel_pt_p_c_dpan_mmx _op_blend_pt_p_c_dpan_mmx | ||
199 | #define _op_blend_rel_pt_pas_c_dpan_mmx _op_blend_pt_pas_c_dpan_mmx | ||
200 | #define _op_blend_rel_pt_pan_c_dpan_mmx _op_blend_pt_pan_c_dpan_mmx | ||
201 | #define _op_blend_rel_pt_p_can_dpan_mmx _op_blend_pt_p_can_dpan_mmx | ||
202 | #define _op_blend_rel_pt_pas_can_dpan_mmx _op_blend_pt_pas_can_dpan_mmx | ||
203 | #define _op_blend_rel_pt_pan_can_dpan_mmx _op_blend_pt_pan_can_dpan_mmx | ||
204 | #define _op_blend_rel_pt_p_caa_dpan_mmx _op_blend_pt_p_caa_dpan_mmx | ||
205 | #define _op_blend_rel_pt_pas_caa_dpan_mmx _op_blend_pt_pas_caa_dpan_mmx | ||
206 | #define _op_blend_rel_pt_pan_caa_dpan_mmx _op_blend_pt_pan_caa_dpan_mmx | ||
207 | |||
208 | static void | ||
209 | init_blend_rel_pixel_color_pt_funcs_mmx(void) | ||
210 | { | ||
211 | op_blend_rel_pt_funcs[SP][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_c_dpan_mmx; | ||
212 | op_blend_rel_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_c_dpan_mmx; | ||
213 | op_blend_rel_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_c_dpan_mmx; | ||
214 | op_blend_rel_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_can_dpan_mmx; | ||
215 | op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_can_dpan_mmx; | ||
216 | op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_can_dpan_mmx; | ||
217 | op_blend_rel_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_caa_dpan_mmx; | ||
218 | op_blend_rel_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_caa_dpan_mmx; | ||
219 | op_blend_rel_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_caa_dpan_mmx; | ||
220 | } | ||
221 | #endif | ||