Mercurial > libavcodec.hg
annotate alpha/dsputil_alpha_asm.S @ 637:de12d5b9c9ad libavcodec
higher accuracy
author | michaelni |
---|---|
date | Sun, 01 Sep 2002 20:54:38 +0000 |
parents | fa4425cf6b31 |
children | acd1a808343b |
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 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
126 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
127 ldq t4, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
128 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
129 ldq t5, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
130 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
131 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
132 ldq t6, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
133 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
134 ldq t7, 0(a1) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
135 addq a1, a2, a1 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
136 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
137 addq a0, a2, t8 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
138 stq t0, 0(a0) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
139 addq t8, a2, t9 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
140 stq t1, 0(t8) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
141 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
142 addq t9, a2, ta |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
143 stq t2, 0(t9) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
144 addq ta, a2, tb |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
145 stq t3, 0(ta) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
146 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
147 addq tb, a2, tc |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
148 stq t4, 0(tb) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
149 addq tc, a2, td |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
150 stq t5, 0(tc) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
151 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
152 addq td, a2, te |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
153 stq t6, 0(td) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
154 addq te, a2, a0 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
155 stq t7, 0(te) |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
156 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
157 subq a3, 8, a3 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
158 bne a3, $aligned |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
159 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
160 ret |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
161 .end put_pixels_axp_asm |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
162 |
fa4425cf6b31
Assembly version of put_pixels. This is currently the function that
mellum
parents:
510
diff
changeset
|
163 /************************************************************************ |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
164 * 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
|
165 * int line_size) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
166 */ |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
167 .align 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
168 .globl put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
169 .ent put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
170 put_pixels_clamped_mvi_asm: |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
171 .frame sp, 0, ra |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
172 .prologue 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
173 |
510 | 174 #ifdef HAVE_GPROF |
175 lda AT, _mcount | |
176 jsr AT, (AT), _mcount | |
177 #endif | |
178 | |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
179 lda t8, -1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
180 lda t9, 8 # loop counter |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
181 zap t8, 0xaa, t8 # 00ff00ff00ff00ff |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
182 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
183 .align 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
184 1: ldq t0, 0(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
185 ldq t1, 8(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
186 ldq t2, 16(a0) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
187 ldq t3, 24(a0) |
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 maxsw4 t0, zero, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
190 subq t9, 2, t9 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
191 maxsw4 t1, zero, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
192 lda a0, 32(a0) |
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 maxsw4 t2, zero, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
195 addq a1, a2, ta |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
196 maxsw4 t3, zero, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
197 minsw4 t0, t8, t0 |
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 minsw4 t1, t8, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
200 minsw4 t2, t8, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
201 minsw4 t3, t8, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
202 pkwb t0, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
203 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
204 pkwb t1, t1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
205 pkwb t2, t2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
206 pkwb t3, t3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
207 stl t0, 0(a1) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
208 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
209 stl t1, 4(a1) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
210 addq ta, a2, a1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
211 stl t2, 0(ta) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
212 stl t3, 4(ta) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
213 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
214 bne t9, 1b |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
215 ret |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
216 .end put_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
217 |
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 * 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
|
220 * int line_size) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
221 */ |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
222 .align 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
223 .globl add_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
224 .ent add_pixels_clamped_mvi_asm |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
225 add_pixels_clamped_mvi_asm: |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
226 .frame sp, 0, ra |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
227 .prologue 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
228 |
510 | 229 #ifdef HAVE_GPROF |
230 lda AT, _mcount | |
231 jsr AT, (AT), _mcount | |
232 #endif | |
233 | |
509
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
234 lda t1, -1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
235 lda th, 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
236 zap t1, 0x33, tg |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
237 nop |
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 srl tg, 1, t0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
240 xor tg, t0, tg # 0x8000800080008000 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
241 zap t1, 0xaa, tf # 0x00ff00ff00ff00ff |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
242 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
243 .align 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
244 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
|
245 ldl t4, 4(a1) # pix1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
246 addq a1, a2, te # pixels += line_size |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
247 ldq t0, 0(a0) # shorts0 |
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 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
|
250 ldl ta, 4(te) # pix3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
251 ldq t3, 8(a0) # shorts1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
252 ldq t6, 16(a0) # shorts2 |
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 ldq t9, 24(a0) # shorts3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
255 unpkbw t1, t1 # 0 0 (quarter/op no.) |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
256 and t0, tg, t2 # 0 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
257 unpkbw t4, t4 # 1 0 |
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 bic t0, tg, t0 # 0 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
260 unpkbw t7, t7 # 2 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
261 and t3, tg, t5 # 1 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
262 addq t0, t1, t0 # 0 3 |
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 xor t0, t2, t0 # 0 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
265 unpkbw ta, ta # 3 0 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
266 and t6, tg, t8 # 2 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
267 maxsw4 t0, zero, t0 # 0 5 |
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 bic t3, tg, t3 # 1 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
270 bic t6, tg, t6 # 2 2 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
271 minsw4 t0, tf, t0 # 0 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
272 addq t3, t4, t3 # 1 3 |
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 pkwb t0, t0 # 0 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
275 xor t3, t5, t3 # 1 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
276 maxsw4 t3, zero, t3 # 1 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
277 addq t6, t7, t6 # 2 3 |
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 xor t6, t8, t6 # 2 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
280 and t9, tg, tb # 3 1 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
281 minsw4 t3, tf, t3 # 1 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
282 bic t9, tg, t9 # 3 2 |
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 maxsw4 t6, zero, t6 # 2 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
285 addq t9, ta, t9 # 3 3 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
286 stl t0, 0(a1) # 0 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
287 minsw4 t6, tf, t6 # 2 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
288 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
289 xor t9, tb, t9 # 3 4 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
290 maxsw4 t9, zero, t9 # 3 5 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
291 lda a0, 32(a0) # block += 16; |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
292 pkwb t3, t3 # 1 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
293 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
294 minsw4 t9, tf, t9 # 3 6 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
295 subq th, 2, th |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
296 pkwb t6, t6 # 2 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
297 pkwb t9, t9 # 3 7 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
298 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
299 stl t3, 4(a1) # 1 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
300 addq te, a2, a1 # pixels += line_size |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
301 stl t6, 0(te) # 2 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
302 stl t9, 4(te) # 3 8 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
303 |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
304 bne th, 1b |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
305 ret |
cab79946302f
Implement put_pixels_clamped and add_pixels_clamped in Assembler. This
mellum
parents:
diff
changeset
|
306 .end add_pixels_clamped_mvi_asm |