1 /****************************************************************************
3 ** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic <dtatalovic@mips.com>
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtGui module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
42 #include "qt_mips_asm_dsp.h"
44 LEAF_MIPS_DSP(destfetchARGB32_asm_mips_dsp)
46 * a0 - buffer address (dst)
47 * a1 - data address (src)
52 move v0, a0 /* just return the address of buffer
53 * for storing returning values */
56 li t7, 8388736 /* t7 = 0x800080 */
61 srl t6, t8, 24 /* t6 = alpha */
71 preceu.ph.qbla t1, t3 /* t1 holds R & B blended with alpha
72 * | 0 | dRab | 0 | dBab | */
76 preceu.ph.qbla t2, t4 /* t2 holds A & G blended with alpha
77 * | 0 | dAab | 0 | dGab | */
78 andi t2, t2, 255 /* t2 = 0xff */
87 beqz a2, 2f /* there was only one member */
90 lw t0, 0(a1) /* t0 = src1 */
91 lw t1, 4(a1) /* t1 = src2 */
92 precrq.qb.ph t4, t0, t1 /* t4 = a1 G1 a2 G2 */
93 preceu.ph.qbra t3, t4 /* t3 = 0 G1 0 G2 */
94 preceu.ph.qbla t2, t4 /* t2 = | 0 | a1 | 0 | a2 | */
96 or t8, t2, t5 /* t8 = 0 a1 a1 a2 */
97 muleu_s.ph.qbr t5, t8, t3
101 precrq.ph.w t9, t0, t1
102 preceu.ph.qbra t9, t9
104 preceu.ph.qbla t6, t5
107 muleu_s.ph.qbr t6, t8, t9
110 preceu.ph.qbra t3, t3
111 muleu_s.ph.qbr t8, t8, t3
112 preceu.ph.qbla t3, t6
115 preceu.ph.qbla t5, t8
119 precrq.ph.w t0, t4, t3 /* t0 = | 0 | a1 | 0 | dR1 | */
120 precrq.ph.w t1, t2, t5 /* t1 = | 0 | dG1 | 0 | dB1 | */
121 precrq.qb.ph t6, t0, t1 /* t6 = | a1 | dR1 | dG1 | dB1 | */
126 precrq.qb.ph t8, t0, t1 /* t8 = | a2 | dR2 | dG2 | dB2 | */
135 END(destfetchARGB32_asm_mips_dsp)
137 LEAF_MIPS_DSP(qt_memfill32_asm_mips_dsp)
139 * a0 - destination address (dst)
147 andi t0, a2, 0x7 /* t0 holds how many counts exceeds 8 */
148 beqzl t0, 2f /* count is multiple of 8 (8, 16, 24, ....) */
190 END(qt_memfill32_asm_mips_dsp)
192 LEAF_MIPS_DSP(comp_func_SourceOver_asm_mips_dsp)
195 * a1 - const uint *src
197 * a3 - uint const_alpha
203 li t7, 8388736 /* t7 = 0x800080 */
207 /* part where const_alpha = 255 */
216 lw t0, 0(a1) /* t0 = s = src[i] */
219 srl t1, t1, 24 /* t1 = ~qAlpha(s) */
222 sw t0, 0(a0) /* dst[i] = src[i] */
234 muleu_s.ph.qbl t2, t4, t6
235 muleu_s.ph.qbr t3, t4, t6
237 preceu.ph.qbla t4, t2
240 preceu.ph.qbla t5, t3
243 precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */
244 addu t8, t0, t8 /* dst[i] =
245 * s + BYTE_MUL(dst[i],~qAlpha(s)) */
252 lw t0, 0(a0) /* t0 - dst[i] "1" */
253 lw t1, 0(a1) /* t1 - src[i] "2" */
256 replv.ph t6, a3 /* a1 = 0x00a00a */
257 muleu_s.ph.qbl t2, t1, t6
258 muleu_s.ph.qbr t3, t1, t6
259 preceu.ph.qbla t4, t2
262 preceu.ph.qbla t5, t3
265 precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */
271 muleu_s.ph.qbl t2, t0, t6
272 muleu_s.ph.qbr t3, t0, t6
273 preceu.ph.qbla t4, t2
276 preceu.ph.qbla t5, t3
279 precrq.qb.ph t6, t4, t5 /* t6 = | ddA | ddR | ddG | ddB | */
289 END(comp_func_SourceOver_asm_mips_dsp)
291 LEAF_MIPS_DSPR2(qt_destStoreARGB32_asm_mips_dsp)
294 * a1 - const uint *buffer
345 extr.w t6, $ac0, 0x10
363 END(qt_destStoreARGB32_asm_mips_dsp)
365 LEAF_MIPS_DSP(comp_func_solid_Source_dsp_asm_x2)
367 * a0 - const uint *dest
376 li t9, 8388736 /* t9 = 0x800080 */
380 or t2, t0, t1 /* if both dest are zero, no computation needed */
384 BYTE_MUL_x2 t0, t1, t6, t7, a3, a3, t9, t2, t3, t4, t5, 0
404 END(comp_func_solid_Source_dsp_asm_x2)
406 LEAF_MIPS_DSP(comp_func_solid_DestinationOver_dsp_asm_x2)
420 li t9, 8388736 /* t4 = 0x800080 */
429 or t2, t4, t5 /* if both dest are zero, no computation needed */
435 BYTE_MUL_x2 a2, a2, t8, a3, t2, t3, t9, t4, t5, t6, t7
452 END(comp_func_solid_DestinationOver_dsp_asm_x2)
454 LEAF_MIPS_DSP(comp_func_DestinationOver_dsp_asm_x2)
459 * a3 - uint const_alpha
468 li t9, 8388736 /* t4 = 0x800080 */
473 /* part where const_alpha != 255 */
481 BYTE_MUL_x2 t0, t1, t8, AT, a3, a3, t9, t4, t5, t6, t7, 0
484 lw t0, 0(a0) # dest_1
485 lw t1, 4(a0) # dest_2
491 replv.ph t2, t4 # qAlpha(~d) 1
492 replv.ph t3, t5 # qAlpha(~d) 2
494 BYTE_MUL_x2 t8, AT, s0, s1, t2, t3, t9, t4, t5, t6, t7
505 /* part where const_alpha = 255 */
507 lw t0, 0(a0) # dest 1
508 lw t1, 4(a0) # dest 2
520 BYTE_MUL_x2 s0, s1, t8, AT, t2, t3, t9, t4, t5, t6, t7
537 END(comp_func_DestinationOver_dsp_asm_x2)
539 LEAF_MIPS_DSP(comp_func_solid_SourceIn_dsp_asm_x2)
544 * a3 - uint const_alpha
554 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
558 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
560 /* part where const_alpha != 255 */
564 BYTE_MUL a2, a2, t0, t9, t1, t2, t3, t4 /* a2 = color ( = BYTE_MUL(color, const_alpha)); */
565 subu t1, t5, a3 /* t1 = cia = 255 - const_alpha */
567 lw t2, 0(a0) /* t2 = d */
570 srl t3, t2, 24 /* t3 = qAlpha(d) */
573 INTERPOLATE_PIXEL_255 a2, t3, t2, t1, AT, t9, t8, t4, t5, t6, t7
574 INTERPOLATE_PIXEL_255 a2, s2, s0, t1, s1, t9, t8, t4, t5, t6, t7
583 /* part where const_alpha = 255 */
585 lw t0, 0(a0) /* dest 1 */
586 lw t1, 4(a0) /* dest 2 */
593 BYTE_MUL_x2 a2, a2, t8, AT, t2, t3, t9, t4, t5, t6, t7
609 END(comp_func_solid_SourceIn_dsp_asm_x2)
611 LEAF_MIPS_DSP(comp_func_SourceIn_dsp_asm_x2)
614 * a1 - const uint *src
616 * a3 - uint const_alpha
627 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
631 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
633 /* part where const_alpha != 255 */
636 subu t7, t5, a3 /* t7 = cia = 255 - const_alpha */
639 lw t0, 0(a1) /* t0 = src 1 */
640 lw t1, 4(a1) /* t1 = src 2 */
643 BYTE_MUL_x2 t0, t1, AT, s0, a3, a3, t9, t3, t4, t5, t6, 0
645 lw t0, 0(a0) /* t0 = dest 1 */
646 lw t1, 4(a0) /* t1 = dest 2 */
649 srl t2, t0, 24 /* t2 = qAlpha(d) 1 */
650 srl t3, t1, 24 /* t3 = qAlpha(d) 2 */
652 INTERPOLATE_PIXEL_255 AT, t2, t0, t7, s1, t9, t8, t4, t5, t6, s3
653 INTERPOLATE_PIXEL_255 s0, t3, t1, t7, s2, t9, t8, t4, t5, t6, s3
662 /* part where const_alpha = 255 */
664 lw t2, 0(a0) /* dest 1 */
665 lw t3, 4(a0) /* dest 2 */
666 lw t0, 0(a1) /* src 1 */
667 lw t1, 4(a1) /* src 2 */
674 BYTE_MUL_x2 t0, t1, t8, AT, t2, t3, t9, t4, t5, t6, t7
692 END(comp_func_SourceIn_dsp_asm_x2)
694 LEAF_MIPS_DSP(comp_func_solid_DestinationIn_dsp_asm_x2)
704 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
711 BYTE_MUL_x2 t0, t1, t8, AT, a2, a2, t9, t4, t5, t6, t7, 0
722 END(comp_func_solid_DestinationIn_dsp_asm_x2)
724 LEAF_MIPS_DSP(comp_func_DestinationIn_dsp_asm_x2)
727 * a1 - const uint *src
729 * a3 - uint const_alpha
737 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
742 /* part where const_alpha != 255 */
745 subu t8, t5, a3 /* t8 = cia = 255 - const_alpha */
748 lw t0, 0(a1) /* t0 = src 1 */
749 lw t1, 4(a1) /* t1 = src 2 */
754 BYTE_MUL_x2 t0, t1, s1, t7, a3, a3, t9, t3, t4, t5, t6, 0
756 lw t0, 0(a0) /* t0 = dest 1 */
757 lw t1, 4(a0) /* t1 = dest 2 */
758 addu s1, s1, t8 /* a 1 */
759 addu t7, t7, t8 /* a 2 */
763 BYTE_MUL_x2 t0, t1, s1, t7, t2, t3, t9, t4, t5, t6, s0
773 /* part where const_alpha = 255 */
775 lw t2, 0(a1) /* src 1 */
776 lw t3, 4(a1) /* src 2 */
777 lw t0, 0(a0) /* dest 1 */
778 lw t1, 4(a0) /* dest 2 */
781 replv.ph t2, t4 /* t2 = qAlpha(src 1) */
782 replv.ph t3, t5 /* t3 = qAlpha(src 2) */
785 BYTE_MUL_x2 t0, t1, t8, s1, t2, t3, t9, t4, t5, t6, t7
800 END(comp_func_DestinationIn_dsp_asm_x2)
802 LEAF_MIPS_DSP(comp_func_DestinationOut_dsp_asm_x2)
805 * a1 - const uint *src
807 * a3 - uint const_alpha
815 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
820 /* part where const_alpha != 255 */
823 subu t8, t5, a3 /* t8 = cia = 255 - const_alpha */
826 lw t0, 0(a1) /* t0 = src 1 */
827 lw t1, 4(a1) /* t1 = src 2 */
834 BYTE_MUL_x2 t0, t1, AT, t7, a3, a3, t9, t3, t4, t5, t6, 0
836 lw t0, 0(a0) /* t0 = dest 1 */
837 lw t1, 4(a0) /* t1 = dest 2 */
838 addu AT, AT, t8 /* a 1 */
839 addu t7, t7, t8 /* a 2 */
843 BYTE_MUL_x2 t0, t1, AT, t7, t2, t3, t9, t4, t5, t6, s0
853 /* part where const_alpha = 255 */
855 lw t2, 0(a1) /* src 1 */
856 lw t3, 4(a1) /* src 2 */
859 lw t0, 0(a0) /* dest 1 */
860 lw t1, 4(a0) /* dest 2 */
863 replv.ph t2, t4 /* t2 = qAlpha(src 1) */
864 replv.ph t3, t5 /* t3 = qAlpha(src 2) */
867 BYTE_MUL_x2 t0, t1, t8, AT, t2, t3, t9, t4, t5, t6, t7
882 END(comp_func_DestinationOut_dsp_asm_x2)
884 LEAF_MIPS_DSP(comp_func_solid_SourceAtop_dsp_asm_x2)
897 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
899 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
901 lw t0, 0(a0) /* t0 = dest 1 */
902 lw t1, 4(a0) /* t1 = dest 2 */
904 srl t2, t0, 24 /* t2 = qAlpha(dest 1) */
905 srl t3, t1, 24 /* t3 = qAlpha(dest 2) */
907 INTERPOLATE_PIXEL_255 a2, t2, t0, a3, AT, t9, t8, t4, t5, t6, t7
908 INTERPOLATE_PIXEL_255 a2, t3, t1, a3, s0, t9, t8, t4, t5, t6, t7
921 END(comp_func_solid_SourceAtop_dsp_asm_x2)
923 LEAF_MIPS_DSP(comp_func_SourceAtop_dsp_asm_x2)
926 * a1 - const uint *src
928 * a3 - uint const_alpha
940 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
944 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
946 /* part where const_alpha != 255 */
950 lw AT, 0(a1) /* src 1 */
951 lw s0, 4(a1) /* src 2 */
953 BYTE_MUL_x2 AT, s0, t0, t1, a3, a3, t9, t3, t4, t5, t6, 0
956 lw t2, 0(a0) /* t2 = dest 1 */
957 lw t3, 4(a0) /* t3 = dest 2 */
959 srl t4, t2, 24 /* t4 = qAplpha(dest 1) */
963 srl t6, t6, 24 /* t6 = qAlpha(~s) */
967 INTERPOLATE_PIXEL_255 t0, t4, t2, t6, AT, t9, t8, s1, s2, s3, s4
968 INTERPOLATE_PIXEL_255 t1, t5, t3, t7, s0, t9, t8, s1, s2, s3, s4
978 /* part where const_alpha = 255 */
980 lw t2, 0(a0) /* dest 1 */
981 lw t3, 4(a0) /* dest 2 */
982 lw t0, 0(a1) /* src 1 */
983 lw t1, 4(a1) /* src 2 */
992 INTERPOLATE_PIXEL_255 t0, t4, t2, t6, AT, t9, t8, s1, s2, s3, s4
993 INTERPOLATE_PIXEL_255 t1, t5, t3, t7, s0, t9, t8, s1, s2, s3, s4
1012 END(comp_func_SourceAtop_dsp_asm_x2)
1014 LEAF_MIPS_DSP(comp_func_solid_DestinationAtop_dsp_asm_x2)
1027 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1029 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1031 lw t0, 0(a0) /* t0 = dest 1 */
1032 lw t1, 4(a0) /* t1 = dest 2 */
1036 srl t2, t2, 24 /* t2 = qAlpha(~(dest 1)) */
1037 srl t3, t3, 24 /* t3 = qAlpha(~(dest 2)) */
1039 INTERPOLATE_PIXEL_255 t0, a3, a2, t2, AT, t9, t8, t4, t5, t6, t7
1040 INTERPOLATE_PIXEL_255 t1, a3, a2, t3, s0, t9, t8, t4, t5, t6, t7
1053 END(comp_func_solid_DestinationAtop_dsp_asm_x2)
1055 LEAF_MIPS_DSP(comp_func_DestinationAtop_dsp_asm_x2)
1058 * a1 - const uint *src
1060 * a3 - uint const_alpha
1073 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1077 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1079 /* part where const_alpha != 255 */
1082 subu s5, s5, a3 /* s5 = cia = 255 - const_alpha */
1085 lw AT, 0(a1) /* src 1 */
1086 lw s0, 4(a1) /* src 2 */
1088 BYTE_MUL_x2 AT, s0, t0, t1, a3, a3, t9, t3, t4, t5, t6, 0
1091 lw t2, 0(a0) /* t2 = dest 1 */
1092 lw t3, 4(a0) /* t3 = dest 2 */
1096 srl t4, t4, 24 /* t4 = qAplpha(~(dest 1)) */
1100 addu t6, t6, s5 /* t6 = a = qAlpha(s1) + cia */
1104 INTERPOLATE_PIXEL_255 t2, t6, t0, t4, AT, t9, t8, s1, s2, s3, s4
1105 INTERPOLATE_PIXEL_255 t3, t7, t1, t5, s0, t9, t8, s1, s2, s3, s4
1115 /* part where const_alpha = 255 */
1117 lw t2, 0(a0) /* d1 */
1118 lw t3, 4(a0) /* d2 */
1119 lw t0, 0(a1) /* s1 */
1120 lw t1, 4(a1) /* s2 */
1121 srl t4, t0, 24 /* t4 = qAlpha(s1) */
1125 srl t6, t6, 24 /* qAlpha(~d1) */
1129 INTERPOLATE_PIXEL_255 t2, t4, t0, t6, AT, t9, t8, s1, s2, s3, s4
1130 INTERPOLATE_PIXEL_255 t3, t5, t1, t7, s0, t9, t8, s1, s2, s3, s4
1150 END(comp_func_DestinationAtop_dsp_asm_x2)
1152 LEAF_MIPS_DSP(comp_func_solid_XOR_dsp_asm_x2)
1165 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1167 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1169 lw t0, 0(a0) /* t0 = dest 1 */
1170 lw t1, 4(a0) /* t1 = dest 2 */
1174 srl t2, t2, 24 /* t2 = qAlpha(~(dest 1)) */
1175 srl t3, t3, 24 /* t3 = qAlpha(~(dest 2)) */
1177 INTERPOLATE_PIXEL_255 a2, t2, t0, a3, AT, t9, t8, t4, t5, t6, t7
1178 INTERPOLATE_PIXEL_255 a2, t3, t1, a3, s0, t9, t8, t4, t5, t6, t7
1191 END(comp_func_solid_XOR_dsp_asm_x2)
1193 LEAF_MIPS_DSP(comp_func_XOR_dsp_asm_x2)
1196 * a1 - const uint *src
1198 * a3 - uint const_alpha
1210 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1214 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1216 /* part where const_alpha != 255 */
1220 lw AT, 0(a1) /* src 1 */
1221 lw s0, 4(a1) /* src 2 */
1223 BYTE_MUL_x2 AT, s0, t0, t1, a3, a3, t9, t3, t4, t5, t6, 0
1227 lw t2, 0(a0) /* t2 = dest 1 */
1228 lw t3, 4(a0) /* t3 = dest 2 */
1232 srl t4, t4, 24 /* t4 = qAplpha(~(dest 1)) */
1236 srl t6, t6, 24 /* t6 = qAlpha(~s) */
1240 INTERPOLATE_PIXEL_255 t0, t4, t2, t6, AT, t9, t8, s1, s2, s3, s4
1241 INTERPOLATE_PIXEL_255 t1, t5, t3, t7, s0, t9, t8, s1, s2, s3, s4
1251 /* part where const_alpha = 255 */
1253 lw t2, 0(a0) /* d1 */
1254 lw t3, 4(a0) /* d2 */
1255 lw t0, 0(a1) /* s1 */
1256 lw t1, 4(a1) /* s2 */
1259 srl t4, t4, 24 /* t4 = qAlpha(~s1) */
1263 srl t6, t6, 24 /* qAlpha(~d1) */
1267 INTERPOLATE_PIXEL_255 t0, t6, t2, t4, AT, t9, t8, s1, s2, s3, s4
1268 INTERPOLATE_PIXEL_255 t1, t7, t3, t5, s0, t9, t8, s1, s2, s3, s4
1287 END(comp_func_XOR_dsp_asm_x2)
1289 LEAF_MIPS_DSP(comp_func_solid_SourceOut_dsp_asm_x2)
1294 * a3 - uint const_alpha
1304 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1308 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1310 /* part where const_alpha != 255 */
1314 BYTE_MUL a2, a2, t0, t9, t1, t2, t3, t4 /* a2 = color ( = BYTE_MUL(color, const_alpha)); */
1315 subu t1, t5, a3 /* t1 = cia = 255 - const_alpha */
1317 lw t2, 0(a0) /* t2 = d1 */
1318 lw s0, 4(a0) /* s0 = d2 */
1322 srl t3, t3, 24 /* t3 = qAlpha(~d1) */
1323 srl s2, s2, 24 /* s2 = qAlpha(~d2) */
1325 INTERPOLATE_PIXEL_255 a2, t3, t2, t1, AT, t9, t8, t4, t5, t6, t7
1326 INTERPOLATE_PIXEL_255 a2, s2, s0, t1, s1, t9, t8, t4, t5, t6, t7
1335 /* part where const_alpha = 255 */
1337 lw t0, 0(a0) /* dest 1 */
1338 lw t1, 4(a0) /* dest 2 */
1347 BYTE_MUL_x2 a2, a2, t8, AT, t2, t3, t9, t4, t5, t6, t7
1363 END(comp_func_solid_SourceOut_dsp_asm_x2)
1365 LEAF_MIPS_DSP(comp_func_SourceOut_dsp_asm_x2)
1368 * a1 - const uint *src
1370 * a3 - uint const_alpha
1381 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1385 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1387 /* part where const_alpha != 255 */
1390 subu t7, t5, a3 /* t7 = cia = 255 - const_alpha */
1393 lw t0, 0(a1) /* t0 = src 1 */
1394 lw t1, 4(a1) /* t1 = src 2 */
1397 BYTE_MUL_x2 t0, t1, AT, s0, a3, a3, t9, t3, t4, t5, t6, 0
1399 lw t0, 0(a0) /* t0 = dest 1 */
1400 lw t1, 4(a0) /* t1 = dest 2 */
1405 srl t2, t2, 24 /* t2 = qAlpha(~d1) */
1406 srl t3, t3, 24 /* t3 = qAlpha(~d2) */
1408 INTERPOLATE_PIXEL_255 AT, t2, t0, t7, s1, t9, t8, t4, t5, t6, s3
1409 INTERPOLATE_PIXEL_255 s0, t3, t1, t7, s2, t9, t8, t4, t5, t6, s3
1418 /* part where const_alpha = 255 */
1420 lw t2, 0(a0) /* dest 1 */
1421 lw t3, 4(a0) /* dest 2 */
1422 lw t0, 0(a1) /* src 1 */
1423 lw t1, 4(a1) /* src 2 */
1426 srl t4, t4, 24 /* qAlpha(~d1) */
1427 srl t5, t5, 24 /* qAlpha(~d2) */
1432 BYTE_MUL_x2 t0, t1, t8, AT, t2, t3, t9, t4, t5, t6, t7
1450 END(comp_func_SourceOut_dsp_asm_x2)
1452 LEAF_MIPS_DSP(comp_func_Source_dsp_asm_x2)
1455 * a1 - const uint *src
1457 * a3 - uint const_alpha
1466 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1468 ori t8, t8, 0xff00 /* t8 = 0xff00ff00 (andi_factor) */
1470 subu t7, t7, a3 /* t7 = ialpha */
1472 lw t0, 0(a0) /* t0 = dest 1 */
1473 lw t1, 4(a0) /* t1 = dest 2 */
1474 lw t2, 0(a1) /* t2 = src 1 */
1475 lw t3, 4(a1) /* t3 = src 2 */
1479 INTERPOLATE_PIXEL_255 t2, a3, t0, t7, AT, t9, t8, t4, t5, t6, s1
1480 INTERPOLATE_PIXEL_255 t3, a3, t1, t7, s0, t9, t8, t4, t5, t6, s1
1494 END(comp_func_Source_dsp_asm_x2)
1496 LEAF_MIPS_DSP(qt_blend_argb32_on_argb32_mips_dsp_asm_x2)
1499 * a1 - const uint *src
1501 * a3 - uint const_alpha
1512 li t9, 8388736 /* t9 = 0x800080 (rounding_factor) */
1515 lw t0, 0(a1) /* t0 = src 1 */
1516 lw t1, 4(a1) /* t1 = src 2 */
1519 BYTE_MUL_x2 t0, t1, AT, t7, a3, a3, t9, t3, t4, t5, t6, 0
1521 lw t0, 0(a0) /* t0 = dest 1 */
1522 lw t1, 4(a0) /* t1 = dest 2 */
1525 srl s1, s1, 24 /* s1 = qAlpha(~s1) */
1526 srl s2, s2, 24 /* s2 = qAlpha(~s2) */
1530 BYTE_MUL_x2 t0, t1, t2, t3, s1, s2, t9, t4, t5, t6, s0
1549 END(qt_blend_argb32_on_argb32_mips_dsp_asm_x2)
1551 LEAF_MIPS_DSP(qt_blend_argb32_on_argb32_const_alpha_256_mips_dsp_asm)
1554 * a1 - const uint *src
1560 li t7, 8388736 /* t7 = 0x800080 */
1569 lw t0, 0(a1) /* t0 = s = src[i] */
1572 srl t1, t1, 24 /* t1 = ~qAlpha(s) */
1575 sw t0, 0(a0) /* dst[i] = src[i] */
1583 replv.ph t6, t1 /* | 0 | qAlpha(~s) | 0 | qAlpha(~s) | */
1590 BYTE_MUL t4, t8, t6, t7, t1, t2, t3, t4
1592 addu t8, t0, t8 /* dst[i] =
1593 * s + BYTE_MUL(dst[i],~qAlpha(s)) */
1603 END(qt_blend_argb32_on_argb32_const_alpha_256_mips_dsp_asm)