annotate alpha/dsputil_alpha_asm.S @ 3715:cdaee53c5da1 libavcodec

replaces back some C code by dsp.put_pixels_tab[0][0] (revert r6231) but this time ensure proper alignment using av_malloc instead of av_realloc
author aurel
date Wed, 13 Sep 2006 20:16:33 +0000
parents 9361d38a3af0
children c8c591fe26f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
1 /*
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
2 * Alpha optimized DSP utils
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
3 * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
4 *
3130
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
5 * This library is free software; you can redistribute it and/or
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
7 * License as published by the Free Software Foundation; either
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
8 * version 2 of the License, or (at your option) any later version.
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
9 *
3130
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
10 * This library is distributed in the hope that it will be useful,
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3130
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
13 * Lesser General Public License for more details.
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
14 *
3130
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
16 * License along with this library; if not, write to the Free Software
9361d38a3af0 Change license header to LGPL for consistency.
mellum
parents: 2979
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
18 */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
19
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
20 /*
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
21 * These functions are scheduled for pca56. They should work
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
22 * reasonably on ev6, though.
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
23 */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
24
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
25 #include "regdef.h"
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
26
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
27 /* Some nicer register names. */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
28 #define ta t10
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
29 #define tb t11
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
30 #define tc t12
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
31 #define td AT
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
32 /* Danger: these overlap with the argument list and the return value */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
33 #define te a5
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
34 #define tf a4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
35 #define tg a3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
36 #define th v0
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
37
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
38 .set noat
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
39 .set noreorder
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
40 .arch pca56
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
41 .text
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
42
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
43 /************************************************************************
511
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
44 * void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
45 * int line_size, int h)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
46 */
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
47 .align 6
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
48 .globl put_pixels_axp_asm
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
49 .ent put_pixels_axp_asm
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
50 put_pixels_axp_asm:
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
51 .frame sp, 0, ra
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
52 .prologue 0
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
53
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
54 #ifdef HAVE_GPROF
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
55 lda AT, _mcount
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
56 jsr AT, (AT), _mcount
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
57 #endif
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
58
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
59 and a1, 7, t0
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
60 beq t0, $aligned
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
61
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
62 .align 4
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
63 $unaligned:
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
64 ldq_u t0, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
65 ldq_u t1, 8(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
66 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
67 nop
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
68
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
69 ldq_u t2, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
70 ldq_u t3, 8(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
71 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
72 nop
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
73
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
74 ldq_u t4, 0(a1)
511
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
75 ldq_u t5, 8(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
76 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
77 nop
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
78
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
79 ldq_u t6, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
80 ldq_u t7, 8(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
81 extql t0, a1, t0
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
82 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
83
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
84 extqh t1, a1, t1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
85 addq a0, a2, t8
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
86 extql t2, a1, t2
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
87 addq t8, a2, t9
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
88
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
89 extqh t3, a1, t3
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
90 addq t9, a2, ta
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
91 extql t4, a1, t4
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
92 or t0, t1, t0
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
93
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
94 extqh t5, a1, t5
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
95 or t2, t3, t2
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
96 extql t6, a1, t6
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
97 or t4, t5, t4
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
98
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
99 extqh t7, a1, t7
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
100 or t6, t7, t6
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
101 stq t0, 0(a0)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
102 stq t2, 0(t8)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
103
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
104 stq t4, 0(t9)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
105 subq a3, 4, a3
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
106 stq t6, 0(ta)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
107 addq ta, a2, a0
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
108
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
109 bne a3, $unaligned
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
110 ret
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
111
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
112 .align 4
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
113 $aligned:
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
114 ldq t0, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
115 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
116 ldq t1, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
117 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
118
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
119 ldq t2, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
120 addq a1, a2, a1
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
121 ldq t3, 0(a1)
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
122
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
123 addq a0, a2, t4
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
124 addq a1, a2, a1
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
125 addq t4, a2, t5
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
126 subq a3, 4, a3
511
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
127
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
128 stq t0, 0(a0)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
129 addq t5, a2, t6
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
130 stq t1, 0(t4)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
131 addq t6, a2, a0
511
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
132
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
133 stq t2, 0(t5)
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
134 stq t3, 0(t6)
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
135
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
136 bne a3, $aligned
511
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
137 ret
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
138 .end put_pixels_axp_asm
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
139
fa4425cf6b31 Assembly version of put_pixels. This is currently the function that
mellum
parents: 510
diff changeset
140 /************************************************************************
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
141 * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
142 * int line_size)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
143 */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
144 .align 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
145 .globl put_pixels_clamped_mvi_asm
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
146 .ent put_pixels_clamped_mvi_asm
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
147 put_pixels_clamped_mvi_asm:
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
148 .frame sp, 0, ra
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
149 .prologue 0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
150
510
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
151 #ifdef HAVE_GPROF
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
152 lda AT, _mcount
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
153 jsr AT, (AT), _mcount
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
154 #endif
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
155
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
156 lda t8, -1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
157 lda t9, 8 # loop counter
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
158 zap t8, 0xaa, t8 # 00ff00ff00ff00ff
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
159
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
160 .align 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
161 1: ldq t0, 0(a0)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
162 ldq t1, 8(a0)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
163 ldq t2, 16(a0)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
164 ldq t3, 24(a0)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
165
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
166 maxsw4 t0, zero, t0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
167 subq t9, 2, t9
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
168 maxsw4 t1, zero, t1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
169 lda a0, 32(a0)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
170
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
171 maxsw4 t2, zero, t2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
172 addq a1, a2, ta
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
173 maxsw4 t3, zero, t3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
174 minsw4 t0, t8, t0
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
175
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
176 minsw4 t1, t8, t1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
177 minsw4 t2, t8, t2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
178 minsw4 t3, t8, t3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
179 pkwb t0, t0
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
180
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
181 pkwb t1, t1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
182 pkwb t2, t2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
183 pkwb t3, t3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
184 stl t0, 0(a1)
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
185
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
186 stl t1, 4(a1)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
187 addq ta, a2, a1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
188 stl t2, 0(ta)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
189 stl t3, 4(ta)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
190
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
191 bne t9, 1b
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
192 ret
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
193 .end put_pixels_clamped_mvi_asm
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
194
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
195 /************************************************************************
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
196 * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
197 * int line_size)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
198 */
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
199 .align 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
200 .globl add_pixels_clamped_mvi_asm
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
201 .ent add_pixels_clamped_mvi_asm
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
202 add_pixels_clamped_mvi_asm:
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
203 .frame sp, 0, ra
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
204 .prologue 0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
205
510
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
206 #ifdef HAVE_GPROF
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
207 lda AT, _mcount
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
208 jsr AT, (AT), _mcount
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
209 #endif
ccd90a9cc09b Add profiling support.
mellum
parents: 509
diff changeset
210
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
211 lda t1, -1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
212 lda th, 8
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
213 zap t1, 0x33, tg
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
214 nop
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
215
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
216 srl tg, 1, t0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
217 xor tg, t0, tg # 0x8000800080008000
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
218 zap t1, 0xaa, tf # 0x00ff00ff00ff00ff
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
219
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
220 .align 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
221 1: ldl t1, 0(a1) # pix0 (try to hit cache line soon)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
222 ldl t4, 4(a1) # pix1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
223 addq a1, a2, te # pixels += line_size
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
224 ldq t0, 0(a0) # shorts0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
225
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
226 ldl t7, 0(te) # pix2 (try to hit cache line soon)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
227 ldl ta, 4(te) # pix3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
228 ldq t3, 8(a0) # shorts1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
229 ldq t6, 16(a0) # shorts2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
230
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
231 ldq t9, 24(a0) # shorts3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
232 unpkbw t1, t1 # 0 0 (quarter/op no.)
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
233 and t0, tg, t2 # 0 1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
234 unpkbw t4, t4 # 1 0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
235
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
236 bic t0, tg, t0 # 0 2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
237 unpkbw t7, t7 # 2 0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
238 and t3, tg, t5 # 1 1
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
239 addq t0, t1, t0 # 0 3
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
240
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
241 xor t0, t2, t0 # 0 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
242 unpkbw ta, ta # 3 0
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
243 and t6, tg, t8 # 2 1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
244 maxsw4 t0, zero, t0 # 0 5
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
245
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
246 bic t3, tg, t3 # 1 2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
247 bic t6, tg, t6 # 2 2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
248 minsw4 t0, tf, t0 # 0 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
249 addq t3, t4, t3 # 1 3
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
250
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
251 pkwb t0, t0 # 0 7
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
252 xor t3, t5, t3 # 1 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
253 maxsw4 t3, zero, t3 # 1 5
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
254 addq t6, t7, t6 # 2 3
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
255
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
256 xor t6, t8, t6 # 2 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
257 and t9, tg, tb # 3 1
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
258 minsw4 t3, tf, t3 # 1 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
259 bic t9, tg, t9 # 3 2
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
260
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
261 maxsw4 t6, zero, t6 # 2 5
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
262 addq t9, ta, t9 # 3 3
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
263 stl t0, 0(a1) # 0 8
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
264 minsw4 t6, tf, t6 # 2 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
265
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
266 xor t9, tb, t9 # 3 4
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
267 maxsw4 t9, zero, t9 # 3 5
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
268 lda a0, 32(a0) # block += 16;
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
269 pkwb t3, t3 # 1 7
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
270
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
271 minsw4 t9, tf, t9 # 3 6
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
272 subq th, 2, th
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
273 pkwb t6, t6 # 2 7
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
274 pkwb t9, t9 # 3 7
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
275
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
276 stl t3, 4(a1) # 1 8
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
277 addq te, a2, a1 # pixels += line_size
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
278 stl t6, 0(te) # 2 8
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
279 stl t9, 4(te) # 3 8
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
280
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
281 bne th, 1b
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2122
diff changeset
282 ret
509
cab79946302f Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff changeset
283 .end add_pixels_clamped_mvi_asm