diff options
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c new file mode 100644 index 0000000..4fa50a9 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_i386.c | |||
@@ -0,0 +1,157 @@ | |||
1 | /* blend pixel x mask --> dst */ | ||
2 | |||
3 | #ifdef BUILD_MMX | ||
4 | static void | ||
5 | _op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
6 | DATA32 *e = d + l; | ||
7 | pxor_r2r(mm0, mm0); | ||
8 | MOV_A2R(ALPHA_256, mm6) | ||
9 | while (d < e) { | ||
10 | l = (*s >> 24); | ||
11 | switch(*m & l) | ||
12 | { | ||
13 | case 0: | ||
14 | break; | ||
15 | case 255: | ||
16 | *d = *s; | ||
17 | break; | ||
18 | default: | ||
19 | l = 1 + *m; | ||
20 | MOV_A2R(l, mm3) | ||
21 | MOV_P2R(*s, mm2, mm0) | ||
22 | MUL4_256_R2R(mm3, mm2) | ||
23 | |||
24 | MOV_RA2R(mm2, mm1) | ||
25 | movq_r2r(mm6, mm3); | ||
26 | psubw_r2r(mm1, mm3); | ||
27 | |||
28 | MOV_P2R(*d, mm1, mm0) | ||
29 | MUL4_256_R2R(mm3, mm1) | ||
30 | |||
31 | paddw_r2r(mm2, mm1); | ||
32 | MOV_R2P(mm1, *d, mm0) | ||
33 | break; | ||
34 | } | ||
35 | m++; s++; d++; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | static void | ||
40 | _op_blend_pan_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
41 | DATA32 *e = d + l; | ||
42 | MOV_A2R(ALPHA_255, mm5) | ||
43 | pxor_r2r(mm0, mm0); | ||
44 | while (d < e) { | ||
45 | l = *m; | ||
46 | switch(l) | ||
47 | { | ||
48 | case 0: | ||
49 | break; | ||
50 | case 255: | ||
51 | *d = *s; | ||
52 | break; | ||
53 | default: | ||
54 | l++; | ||
55 | MOV_A2R(l, mm3) | ||
56 | MOV_P2R(*s, mm2, mm0) | ||
57 | MOV_P2R(*d, mm1, mm0) | ||
58 | INTERP_256_R2R(mm3, mm2, mm1, mm5) | ||
59 | MOV_R2P(mm1, *d, mm0) | ||
60 | break; | ||
61 | } | ||
62 | m++; s++; d++; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | #define _op_blend_p_mas_dp_mmx _op_blend_pas_mas_dp_mmx | ||
67 | |||
68 | #define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx | ||
69 | #define _op_blend_pan_mas_dpan_mmx _op_blend_pan_mas_dp_mmx | ||
70 | #define _op_blend_pas_mas_dpan_mmx _op_blend_pas_mas_dp_mmx | ||
71 | |||
72 | static void | ||
73 | init_blend_pixel_mask_span_funcs_mmx(void) | ||
74 | { | ||
75 | op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_p_mas_dp_mmx; | ||
76 | op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pas_mas_dp_mmx; | ||
77 | op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pan_mas_dp_mmx; | ||
78 | |||
79 | op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_p_mas_dpan_mmx; | ||
80 | op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pas_mas_dpan_mmx; | ||
81 | op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pan_mas_dpan_mmx; | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | #ifdef BUILD_MMX | ||
86 | static void | ||
87 | _op_blend_pt_p_mas_dp_mmx(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
88 | c = m + 1; | ||
89 | MOV_A2R(c, mm3) | ||
90 | pxor_r2r(mm0, mm0); | ||
91 | MOV_A2R(ALPHA_256, mm6) | ||
92 | MOV_P2R(s, mm2, mm0) | ||
93 | MUL4_256_R2R(mm3, mm2) | ||
94 | |||
95 | MOV_RA2R(mm2, mm1) | ||
96 | psubw_r2r(mm1, mm6); | ||
97 | |||
98 | MOV_P2R(*d, mm1, mm0) | ||
99 | MUL4_256_R2R(mm6, mm1) | ||
100 | |||
101 | paddw_r2r(mm2, mm1); | ||
102 | MOV_R2P(mm1, *d, mm0) | ||
103 | } | ||
104 | |||
105 | #define _op_blend_pt_pan_mas_dp_mmx _op_blend_pt_p_mas_dp_mmx | ||
106 | #define _op_blend_pt_pas_mas_dp_mmx _op_blend_pt_p_mas_dp_mmx | ||
107 | |||
108 | #define _op_blend_pt_p_mas_dpan_mmx _op_blend_pt_p_mas_dp_mmx | ||
109 | #define _op_blend_pt_pas_mas_dpan_mmx _op_blend_pt_pas_mas_dp_mmx | ||
110 | #define _op_blend_pt_pan_mas_dpan_mmx _op_blend_pt_pan_mas_dp_mmx | ||
111 | |||
112 | static void | ||
113 | init_blend_pixel_mask_pt_funcs_mmx(void) | ||
114 | { | ||
115 | op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_p_mas_dp_mmx; | ||
116 | op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_pas_mas_dp_mmx; | ||
117 | op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_MMX] = _op_blend_pt_pan_mas_dp_mmx; | ||
118 | |||
119 | op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_p_mas_dpan_mmx; | ||
120 | op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pas_mas_dpan_mmx; | ||
121 | op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_pt_pan_mas_dpan_mmx; | ||
122 | } | ||
123 | #endif | ||
124 | |||
125 | /*-----*/ | ||
126 | |||
127 | /* blend_rel pixel x mask -> dst */ | ||
128 | |||
129 | #ifdef BUILD_MMX | ||
130 | |||
131 | #define _op_blend_rel_p_mas_dpan_mmx _op_blend_p_mas_dpan_mmx | ||
132 | #define _op_blend_rel_pas_mas_dpan_mmx _op_blend_pas_mas_dpan_mmx | ||
133 | #define _op_blend_rel_pan_mas_dpan_mmx _op_blend_pan_mas_dpan_mmx | ||
134 | |||
135 | static void | ||
136 | init_blend_rel_pixel_mask_span_funcs_mmx(void) | ||
137 | { | ||
138 | op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_p_mas_dpan_mmx; | ||
139 | op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pas_mas_dpan_mmx; | ||
140 | op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pan_mas_dpan_mmx; | ||
141 | } | ||
142 | #endif | ||
143 | |||
144 | #ifdef BUILD_MMX | ||
145 | |||
146 | #define _op_blend_rel_pt_p_mas_dpan_mmx _op_blend_pt_p_mas_dpan_mmx | ||
147 | #define _op_blend_rel_pt_pas_mas_dpan_mmx _op_blend_pt_pas_mas_dpan_mmx | ||
148 | #define _op_blend_rel_pt_pan_mas_dpan_mmx _op_blend_pt_pan_mas_dpan_mmx | ||
149 | |||
150 | static void | ||
151 | init_blend_rel_pixel_mask_pt_funcs_mmx(void) | ||
152 | { | ||
153 | op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_p_mas_dpan_mmx; | ||
154 | op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pas_mas_dpan_mmx; | ||
155 | op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_MMX] = _op_blend_rel_pt_pan_mas_dpan_mmx; | ||
156 | } | ||
157 | #endif | ||