diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c | 251 |
1 files changed, 251 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c new file mode 100644 index 0000000..f8fe02e --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_i386.c | |||
@@ -0,0 +1,251 @@ | |||
1 | /* blend mask x color -> dst */ | ||
2 | |||
3 | #ifdef BUILD_MMX | ||
4 | static void | ||
5 | _op_blend_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
6 | DATA32 *e = d + l; | ||
7 | pxor_r2r(mm0, mm0); | ||
8 | MOV_A2R(ALPHA_256, mm6) | ||
9 | MOV_P2R(c, mm2, mm0) | ||
10 | c = 256 - (c >> 24); | ||
11 | MOV_A2R(c, mm4) | ||
12 | while (d < e) { | ||
13 | l = *m; | ||
14 | switch(l) | ||
15 | { | ||
16 | case 0: | ||
17 | break; | ||
18 | case 255: | ||
19 | MOV_P2R(*d, mm1, mm0) | ||
20 | MUL4_256_R2R(mm4, mm1) | ||
21 | paddw_r2r(mm2, mm1); | ||
22 | MOV_R2P(mm1, *d, mm0) | ||
23 | break; | ||
24 | default: | ||
25 | l++; | ||
26 | MOV_A2R(l, mm3) | ||
27 | MUL4_256_R2R(mm2, mm3) | ||
28 | |||
29 | MOV_RA2R(mm3, mm1) | ||
30 | movq_r2r(mm6, mm7); | ||
31 | psubw_r2r(mm1, mm7); | ||
32 | |||
33 | MOV_P2R(*d, mm1, mm0) | ||
34 | MUL4_256_R2R(mm7, mm1) | ||
35 | |||
36 | paddw_r2r(mm3, mm1); | ||
37 | MOV_R2P(mm1, *d, mm0) | ||
38 | break; | ||
39 | } | ||
40 | m++; d++; | ||
41 | } | ||
42 | } | ||
43 | |||
44 | static void | ||
45 | _op_blend_mas_can_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
46 | DATA32 *e = d + l; | ||
47 | pxor_r2r(mm0, mm0); | ||
48 | MOV_P2R(c, mm2, mm0) | ||
49 | MOV_A2R(ALPHA_255, mm5) | ||
50 | while (d < e) { | ||
51 | l = *m; | ||
52 | switch(l) | ||
53 | { | ||
54 | case 0: | ||
55 | break; | ||
56 | case 255: | ||
57 | *d = c; | ||
58 | break; | ||
59 | default: | ||
60 | l++; | ||
61 | MOV_A2R(l, mm3) | ||
62 | MOV_P2R(*d, mm1, mm0) | ||
63 | movq_r2r(mm2, mm4); | ||
64 | INTERP_256_R2R(mm3, mm4, mm1, mm5) | ||
65 | MOV_R2P(mm1, *d, mm0) | ||
66 | break; | ||
67 | } | ||
68 | m++; d++; | ||
69 | } | ||
70 | } | ||
71 | |||
72 | #define _op_blend_mas_cn_dp_mmx _op_blend_mas_can_dp_mmx | ||
73 | #define _op_blend_mas_caa_dp_mmx _op_blend_mas_c_dp_mmx | ||
74 | |||
75 | #define _op_blend_mas_c_dpan_mmx _op_blend_mas_c_dp_mmx | ||
76 | #define _op_blend_mas_cn_dpan_mmx _op_blend_mas_cn_dp_mmx | ||
77 | #define _op_blend_mas_can_dpan_mmx _op_blend_mas_can_dp_mmx | ||
78 | #define _op_blend_mas_caa_dpan_mmx _op_blend_mas_caa_dp_mmx | ||
79 | |||
80 | static void | ||
81 | init_blend_mask_color_span_funcs_mmx(void) | ||
82 | { | ||
83 | op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_mas_c_dp_mmx; | ||
84 | op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_mas_cn_dp_mmx; | ||
85 | op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_mas_can_dp_mmx; | ||
86 | op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_mas_caa_dp_mmx; | ||
87 | |||
88 | op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_mas_c_dpan_mmx; | ||
89 | op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_mas_cn_dpan_mmx; | ||
90 | op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_mas_can_dpan_mmx; | ||
91 | op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_mas_caa_dpan_mmx; | ||
92 | } | ||
93 | #endif | ||
94 | |||
95 | #ifdef BUILD_MMX | ||
96 | static void | ||
97 | _op_blend_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
98 | s = m + 1; | ||
99 | MOV_A2R(s, mm3) | ||
100 | MOV_A2R(ALPHA_256, mm6) | ||
101 | pxor_r2r(mm0, mm0); | ||
102 | MOV_P2R(c, mm2, mm0) | ||
103 | MUL4_256_R2R(mm2, mm3) | ||
104 | |||
105 | MOV_RA2R(mm3, mm1) | ||
106 | psubw_r2r(mm1, mm6); | ||
107 | |||
108 | MOV_P2R(*d, mm1, mm0) | ||
109 | MUL4_256_R2R(mm6, mm1) | ||
110 | |||
111 | paddw_r2r(mm3, mm1); | ||
112 | MOV_R2P(mm1, *d, mm0) | ||
113 | } | ||
114 | |||
115 | |||
116 | #define _op_blend_pt_mas_cn_dp_mmx _op_blend_pt_mas_c_dp_mmx | ||
117 | #define _op_blend_pt_mas_can_dp_mmx _op_blend_pt_mas_c_dp_mmx | ||
118 | #define _op_blend_pt_mas_caa_dp_mmx _op_blend_pt_mas_c_dp_mmx | ||
119 | |||
120 | #define _op_blend_pt_mas_c_dpan_mmx _op_blend_pt_mas_c_dp_mmx | ||
121 | #define _op_blend_pt_mas_cn_dpan_mmx _op_blend_pt_mas_cn_dp_mmx | ||
122 | #define _op_blend_pt_mas_can_dpan_mmx _op_blend_pt_mas_can_dp_mmx | ||
123 | #define _op_blend_pt_mas_caa_dpan_mmx _op_blend_pt_mas_caa_dp_mmx | ||
124 | |||
125 | static void | ||
126 | init_blend_mask_color_pt_funcs_mmx(void) | ||
127 | { | ||
128 | op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_pt_mas_c_dp_mmx; | ||
129 | op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_mas_cn_dp_mmx; | ||
130 | op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_pt_mas_can_dp_mmx; | ||
131 | op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_pt_mas_caa_dp_mmx; | ||
132 | |||
133 | op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_pt_mas_c_dpan_mmx; | ||
134 | op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_mas_cn_dpan_mmx; | ||
135 | op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_pt_mas_can_dpan_mmx; | ||
136 | op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_pt_mas_caa_dpan_mmx; | ||
137 | } | ||
138 | #endif | ||
139 | |||
140 | /*-----*/ | ||
141 | |||
142 | /* blend_rel mask x color -> dst */ | ||
143 | |||
144 | #ifdef BUILD_MMX | ||
145 | static void | ||
146 | _op_blend_rel_mas_c_dp_mmx(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
147 | DATA32 *e = d + l; | ||
148 | pxor_r2r(mm0, mm0); | ||
149 | MOV_A2R(ALPHA_256, mm6) | ||
150 | MOV_A2R(ALPHA_255, mm5) | ||
151 | MOV_P2R(c, mm2, mm0) | ||
152 | while (d < e) { | ||
153 | l = *m; | ||
154 | switch(l) | ||
155 | { | ||
156 | case 0: | ||
157 | break; | ||
158 | default: | ||
159 | l++; | ||
160 | MOV_A2R(l, mm3) | ||
161 | MUL4_256_R2R(mm2, mm3) | ||
162 | |||
163 | MOV_RA2R(mm3, mm1) | ||
164 | movq_r2r(mm6, mm7); | ||
165 | psubw_r2r(mm1, mm7); | ||
166 | |||
167 | MOV_P2R(*d, mm1, mm0) | ||
168 | MOV_RA2R(mm1, mm4) | ||
169 | MUL4_256_R2R(mm7, mm1) | ||
170 | |||
171 | MUL4_SYM_R2R(mm4, mm3, mm5) | ||
172 | |||
173 | paddw_r2r(mm3, mm1); | ||
174 | MOV_R2P(mm1, *d, mm0) | ||
175 | break; | ||
176 | } | ||
177 | m++; d++; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | #define _op_blend_rel_mas_cn_dp_mmx _op_blend_rel_mas_c_dp_mmx | ||
182 | #define _op_blend_rel_mas_can_dp_mmx _op_blend_rel_mas_c_dp_mmx | ||
183 | #define _op_blend_rel_mas_caa_dp_mmx _op_blend_rel_mas_c_dp_mmx | ||
184 | |||
185 | #define _op_blend_rel_mas_c_dpan_mmx _op_blend_mas_c_dpan_mmx | ||
186 | #define _op_blend_rel_mas_cn_dpan_mmx _op_blend_mas_cn_dpan_mmx | ||
187 | #define _op_blend_rel_mas_can_dpan_mmx _op_blend_mas_can_dpan_mmx | ||
188 | #define _op_blend_rel_mas_caa_dpan_mmx _op_blend_mas_caa_dpan_mmx | ||
189 | |||
190 | static void | ||
191 | init_blend_rel_mask_color_span_funcs_mmx(void) | ||
192 | { | ||
193 | op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_rel_mas_c_dp_mmx; | ||
194 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_rel_mas_cn_dp_mmx; | ||
195 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_rel_mas_can_dp_mmx; | ||
196 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_rel_mas_caa_dp_mmx; | ||
197 | |||
198 | op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_rel_mas_c_dpan_mmx; | ||
199 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_mas_cn_dpan_mmx; | ||
200 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_mas_can_dpan_mmx; | ||
201 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_mas_caa_dpan_mmx; | ||
202 | } | ||
203 | #endif | ||
204 | |||
205 | #ifdef BUILD_MMX | ||
206 | static void | ||
207 | _op_blend_rel_pt_mas_c_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
208 | pxor_r2r(mm0, mm0); | ||
209 | MOV_A2R(ALPHA_256, mm6) | ||
210 | MOV_A2R(ALPHA_255, mm5) | ||
211 | s = m + 1; | ||
212 | MOV_A2R(s, mm3) | ||
213 | MOV_P2R(c, mm2, mm0) | ||
214 | MUL4_256_R2R(mm2, mm3) | ||
215 | |||
216 | MOV_RA2R(mm3, mm1) | ||
217 | psubw_r2r(mm1, mm6); | ||
218 | |||
219 | MOV_P2R(*d, mm1, mm0) | ||
220 | MOV_RA2R(mm1, mm4) | ||
221 | MUL4_256_R2R(mm6, mm1) | ||
222 | |||
223 | MUL4_SYM_R2R(mm4, mm3, mm5) | ||
224 | |||
225 | paddw_r2r(mm3, mm1); | ||
226 | MOV_R2P(mm1, *d, mm0) | ||
227 | } | ||
228 | |||
229 | #define _op_blend_rel_pt_mas_cn_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx | ||
230 | #define _op_blend_rel_pt_mas_can_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx | ||
231 | #define _op_blend_rel_pt_mas_caa_dp_mmx _op_blend_rel_pt_mas_c_dp_mmx | ||
232 | |||
233 | #define _op_blend_rel_pt_mas_c_dpan_mmx _op_blend_pt_mas_c_dpan_mmx | ||
234 | #define _op_blend_rel_pt_mas_cn_dpan_mmx _op_blend_pt_mas_cn_dpan_mmx | ||
235 | #define _op_blend_rel_pt_mas_can_dpan_mmx _op_blend_pt_mas_can_dpan_mmx | ||
236 | #define _op_blend_rel_pt_mas_caa_dpan_mmx _op_blend_pt_mas_caa_dpan_mmx | ||
237 | |||
238 | static void | ||
239 | init_blend_rel_mask_color_pt_funcs_mmx(void) | ||
240 | { | ||
241 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_MMX] = _op_blend_rel_pt_mas_c_dp_mmx; | ||
242 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_rel_pt_mas_cn_dp_mmx; | ||
243 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_MMX] = _op_blend_rel_pt_mas_can_dp_mmx; | ||
244 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_MMX] = _op_blend_rel_pt_mas_caa_dp_mmx; | ||
245 | |||
246 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_c_dpan_mmx; | ||
247 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_cn_dpan_mmx; | ||
248 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_can_dpan_mmx; | ||
249 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_MMX] = _op_blend_rel_pt_mas_caa_dpan_mmx; | ||
250 | } | ||
251 | #endif | ||