Mercurial > libavcodec.hg
annotate alpha/dsputil_alpha_asm.S @ 1706:3ba5c493db6f libavcodec
motion vector vissualization improvements patch by (Wolfgang Hesseler <qv at multimediaware dot com>)
author | michael |
---|---|
date | Tue, 30 Dec 2003 02:12:12 +0000 |
parents | acd1a808343b |
children | 503496800167 |
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 * |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
8 * (at your option) any later version. |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
9 * |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
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 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
14 * |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
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" |
510 | 26 #ifdef HAVE_AV_CONFIG_H |
27 #include "config.h" | |
28 #endif | |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
29 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
30 /* Some nicer register names. */ |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
31 #define ta t10 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
32 #define tb t11 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
33 #define tc t12 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
34 #define td AT |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
35 /* 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
|
36 #define te a5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
37 #define tf a4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
38 #define tg a3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
39 #define th v0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
40 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
41 .set noat |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
42 .set noreorder |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
43 .arch pca56 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
44 .text |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
45 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
46 /************************************************************************ |
511
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
47 * 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
|
48 * int line_size, int h) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
49 */ |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
50 .align 6 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
51 .globl put_pixels_axp_asm |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
52 .ent put_pixels_axp_asm |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
53 put_pixels_axp_asm: |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
54 .frame sp, 0, ra |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
55 .prologue 0 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
56 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
57 #ifdef HAVE_GPROF |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
58 lda AT, _mcount |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
59 jsr AT, (AT), _mcount |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
60 #endif |
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 and a1, 7, t0 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
63 beq t0, $aligned |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
64 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
65 .align 4 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
66 $unaligned: |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
67 ldq_u t0, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
68 ldq_u t1, 8(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
69 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
70 nop |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
71 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
72 ldq_u t2, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
73 ldq_u t3, 8(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
74 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
75 nop |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
76 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
77 ldq_u t4, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
78 ldq_u t5, 8(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
79 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
80 nop |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
81 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
82 ldq_u t6, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
83 ldq_u t7, 8(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
84 extql t0, a1, t0 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
85 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
86 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
87 extqh t1, a1, t1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
88 addq a0, a2, t8 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
89 extql t2, a1, t2 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
90 addq t8, a2, t9 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
91 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
92 extqh t3, a1, t3 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
93 addq t9, a2, ta |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
94 extql t4, a1, t4 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
95 or t0, t1, t0 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
96 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
97 extqh t5, a1, t5 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
98 or t2, t3, t2 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
99 extql t6, a1, t6 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
100 or t4, t5, t4 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
101 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
102 extqh t7, a1, t7 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
103 or t6, t7, t6 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
104 stq t0, 0(a0) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
105 stq t2, 0(t8) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
106 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
107 stq t4, 0(t9) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
108 subq a3, 4, a3 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
109 stq t6, 0(ta) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
110 addq ta, a2, a0 |
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 bne a3, $unaligned |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
113 ret |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
114 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
115 .align 4 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
116 $aligned: |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
117 ldq t0, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
118 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
119 ldq t1, 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 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
122 ldq t2, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
123 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
124 ldq t3, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
125 |
668 | 126 addq a0, a2, t4 |
127 addq a1, a2, a1 | |
128 addq t4, a2, t5 | |
129 subq a3, 4, a3 | |
511
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
130 |
668 | 131 stq t0, 0(a0) |
132 addq t5, a2, t6 | |
133 stq t1, 0(t4) | |
134 addq t6, a2, a0 | |
511
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
135 |
668 | 136 stq t2, 0(t5) |
137 stq t3, 0(t6) | |
138 | |
139 bne a3, $aligned | |
511
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
140 ret |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
141 .end put_pixels_axp_asm |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
142 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
143 /************************************************************************ |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
144 * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
145 * int line_size) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
146 */ |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
147 .align 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
148 .globl put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
149 .ent put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
150 put_pixels_clamped_mvi_asm: |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
151 .frame sp, 0, ra |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
152 .prologue 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
153 |
510 | 154 #ifdef HAVE_GPROF |
155 lda AT, _mcount | |
156 jsr AT, (AT), _mcount | |
157 #endif | |
158 | |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
159 lda t8, -1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
160 lda t9, 8 # loop counter |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
161 zap t8, 0xaa, t8 # 00ff00ff00ff00ff |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
162 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
163 .align 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
164 1: ldq t0, 0(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
165 ldq t1, 8(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
166 ldq t2, 16(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
167 ldq t3, 24(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
168 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
169 maxsw4 t0, zero, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
170 subq t9, 2, t9 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
171 maxsw4 t1, zero, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
172 lda a0, 32(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
173 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
174 maxsw4 t2, zero, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
175 addq a1, a2, ta |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
176 maxsw4 t3, zero, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
177 minsw4 t0, t8, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
178 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
179 minsw4 t1, t8, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
180 minsw4 t2, t8, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
181 minsw4 t3, t8, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
182 pkwb t0, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
183 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
184 pkwb t1, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
185 pkwb t2, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
186 pkwb t3, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
187 stl t0, 0(a1) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
188 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
189 stl t1, 4(a1) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
190 addq ta, a2, a1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
191 stl t2, 0(ta) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
192 stl t3, 4(ta) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
193 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
194 bne t9, 1b |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
195 ret |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
196 .end put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
197 |
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 * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
200 * int line_size) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
201 */ |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
202 .align 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
203 .globl add_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
204 .ent add_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
205 add_pixels_clamped_mvi_asm: |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
206 .frame sp, 0, ra |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
207 .prologue 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
208 |
510 | 209 #ifdef HAVE_GPROF |
210 lda AT, _mcount | |
211 jsr AT, (AT), _mcount | |
212 #endif | |
213 | |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
214 lda t1, -1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
215 lda th, 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
216 zap t1, 0x33, tg |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
217 nop |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
218 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
219 srl tg, 1, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
220 xor tg, t0, tg # 0x8000800080008000 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
221 zap t1, 0xaa, tf # 0x00ff00ff00ff00ff |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
222 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
223 .align 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
224 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
|
225 ldl t4, 4(a1) # pix1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
226 addq a1, a2, te # pixels += line_size |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
227 ldq t0, 0(a0) # shorts0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
228 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
229 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
|
230 ldl ta, 4(te) # pix3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
231 ldq t3, 8(a0) # shorts1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
232 ldq t6, 16(a0) # shorts2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
233 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
234 ldq t9, 24(a0) # shorts3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
235 unpkbw t1, t1 # 0 0 (quarter/op no.) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
236 and t0, tg, t2 # 0 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
237 unpkbw t4, t4 # 1 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
238 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
239 bic t0, tg, t0 # 0 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
240 unpkbw t7, t7 # 2 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
241 and t3, tg, t5 # 1 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
242 addq t0, t1, t0 # 0 3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
243 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
244 xor t0, t2, t0 # 0 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
245 unpkbw ta, ta # 3 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
246 and t6, tg, t8 # 2 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
247 maxsw4 t0, zero, t0 # 0 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
248 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
249 bic t3, tg, t3 # 1 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
250 bic t6, tg, t6 # 2 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
251 minsw4 t0, tf, t0 # 0 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
252 addq t3, t4, t3 # 1 3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
253 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
254 pkwb t0, t0 # 0 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
255 xor t3, t5, t3 # 1 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
256 maxsw4 t3, zero, t3 # 1 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
257 addq t6, t7, t6 # 2 3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
258 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
259 xor t6, t8, t6 # 2 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
260 and t9, tg, tb # 3 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
261 minsw4 t3, tf, t3 # 1 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
262 bic t9, tg, t9 # 3 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
263 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
264 maxsw4 t6, zero, t6 # 2 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
265 addq t9, ta, t9 # 3 3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
266 stl t0, 0(a1) # 0 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
267 minsw4 t6, tf, t6 # 2 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
268 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
269 xor t9, tb, t9 # 3 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
270 maxsw4 t9, zero, t9 # 3 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
271 lda a0, 32(a0) # block += 16; |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
272 pkwb t3, t3 # 1 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
273 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
274 minsw4 t9, tf, t9 # 3 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
275 subq th, 2, th |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
276 pkwb t6, t6 # 2 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
277 pkwb t9, t9 # 3 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
278 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
279 stl t3, 4(a1) # 1 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
280 addq te, a2, a1 # pixels += line_size |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
281 stl t6, 0(te) # 2 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
282 stl t9, 4(te) # 3 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
283 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
284 bne th, 1b |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
285 ret |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
286 .end add_pixels_clamped_mvi_asm |