Mercurial > libavcodec.hg
annotate ps2/mmi.h @ 3795:edd600ba1cc7 libavcodec
ignore sub_id
author | michael |
---|---|
date | Sat, 30 Sep 2006 11:45:09 +0000 |
parents | c537a97eec66 |
children | c8c591fe26f8 |
rev | line source |
---|---|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
1 /* |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
2 * copyright (c) 2002 Leon van Stuivenberg |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
3 * |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
4 * This library is free software; you can redistribute it and/or |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
5 * modify it under the terms of the GNU Lesser General Public |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
6 * License as published by the Free Software Foundation; either |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
7 * version 2 of the License, or (at your option) any later version. |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
8 * |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
9 * This library is distributed in the hope that it will be useful, |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
12 * Lesser General Public License for more details. |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
13 * |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
14 * You should have received a copy of the GNU Lesser General Public |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
15 * License along with this library; if not, write to the Free Software |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
17 */ |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
2979
diff
changeset
|
18 |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
19 #ifndef __mmi_H |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
20 #define __mmi_H |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
21 |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
22 #define align16 __attribute__ ((aligned (16))) |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
23 |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
24 /* |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
25 #define r0 $zero |
2979 | 26 #define r1 $at //assembler! |
27 #define r2 $v0 //return | |
28 #define r3 $v1 //return | |
29 #define r4 $a0 //arg | |
30 #define r5 $a1 //arg | |
31 #define r6 $a2 //arg | |
32 #define r7 $a3 //arg | |
33 #define r8 $t0 //temp | |
34 #define r9 $t1 //temp | |
35 #define r10 $t2 //temp | |
36 #define r11 $t3 //temp | |
37 #define r12 $t4 //temp | |
38 #define r13 $t5 //temp | |
39 #define r14 $t6 //temp | |
40 #define r15 $t7 //temp | |
41 #define r16 $s0 //saved temp | |
42 #define r17 $s1 //saved temp | |
43 #define r18 $s2 //saved temp | |
44 #define r19 $s3 //saved temp | |
45 #define r20 $s4 //saved temp | |
46 #define r21 $s5 //saved temp | |
47 #define r22 $s6 //saved temp | |
48 #define r23 $s7 //saved temp | |
49 #define r24 $t8 //temp | |
50 #define r25 $t9 //temp | |
51 #define r26 $k0 //kernel | |
52 #define r27 $k1 //kernel | |
53 #define r28 $gp //global ptr | |
54 #define r29 $sp //stack ptr | |
55 #define r30 $fp //frame ptr | |
56 #define r31 $ra //return addr | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
57 */ |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
58 |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
59 |
2979 | 60 #define lq(base, off, reg) \ |
61 __asm__ __volatile__ ("lq " #reg ", %0("#base ")" : : "i" (off) ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
62 |
2979 | 63 #define lq2(mem, reg) \ |
64 __asm__ __volatile__ ("lq " #reg ", %0" : : "r" (mem)) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
65 |
2979 | 66 #define sq(reg, off, base) \ |
67 __asm__ __volatile__ ("sq " #reg ", %0("#base ")" : : "i" (off) ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
68 |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
69 /* |
2979 | 70 #define ld(base, off, reg) \ |
71 __asm__ __volatile__ ("ld " #reg ", " #off "("#base ")") | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
72 */ |
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
73 |
2979 | 74 #define ld3(base, off, reg) \ |
75 __asm__ __volatile__ (".word %0" : : "i" ( 0xdc000000 | (base<<21) | (reg<<16) | (off))) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
76 |
2979 | 77 #define ldr3(base, off, reg) \ |
78 __asm__ __volatile__ (".word %0" : : "i" ( 0x6c000000 | (base<<21) | (reg<<16) | (off))) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
79 |
2979 | 80 #define ldl3(base, off, reg) \ |
81 __asm__ __volatile__ (".word %0" : : "i" ( 0x68000000 | (base<<21) | (reg<<16) | (off))) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
82 |
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
83 /* |
2979 | 84 #define sd(reg, off, base) \ |
85 __asm__ __volatile__ ("sd " #reg ", " #off "("#base ")") | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
86 */ |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
87 //seems assembler has bug encoding mnemonic 'sd', so DIY |
2979 | 88 #define sd3(reg, off, base) \ |
89 __asm__ __volatile__ (".word %0" : : "i" ( 0xfc000000 | (base<<21) | (reg<<16) | (off))) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
90 |
2979 | 91 #define sw(reg, off, base) \ |
92 __asm__ __volatile__ ("sw " #reg ", " #off "("#base ")") | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
93 |
2979 | 94 #define sq2(reg, mem) \ |
95 __asm__ __volatile__ ("sq " #reg ", %0" : : "m" (*(mem))) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
96 |
2979 | 97 #define pinth(rs, rt, rd) \ |
98 __asm__ __volatile__ ("pinth " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
99 |
2979 | 100 #define phmadh(rs, rt, rd) \ |
101 __asm__ __volatile__ ("phmadh " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
102 |
2979 | 103 #define pcpyud(rs, rt, rd) \ |
104 __asm__ __volatile__ ("pcpyud " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
105 |
2979 | 106 #define pcpyld(rs, rt, rd) \ |
107 __asm__ __volatile__ ("pcpyld " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
108 |
2979 | 109 #define pcpyh(rt, rd) \ |
110 __asm__ __volatile__ ("pcpyh " #rd ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
111 |
2979 | 112 #define paddw(rs, rt, rd) \ |
113 __asm__ __volatile__ ("paddw " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
114 |
2979 | 115 #define pextlw(rs, rt, rd) \ |
116 __asm__ __volatile__ ("pextlw " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
117 |
2979 | 118 #define pextuw(rs, rt, rd) \ |
119 __asm__ __volatile__ ("pextuw " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
120 |
2979 | 121 #define pextlh(rs, rt, rd) \ |
122 __asm__ __volatile__ ("pextlh " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
123 |
2979 | 124 #define pextuh(rs, rt, rd) \ |
125 __asm__ __volatile__ ("pextuh " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
126 |
2979 | 127 #define psubw(rs, rt, rd) \ |
128 __asm__ __volatile__ ("psubw " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
129 |
2979 | 130 #define psraw(rt, sa, rd) \ |
131 __asm__ __volatile__ ("psraw " #rd ", " #rt ", %0" : : "i"(sa) ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
132 |
2979 | 133 #define ppach(rs, rt, rd) \ |
134 __asm__ __volatile__ ("ppach " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
135 |
2979 | 136 #define ppacb(rs, rt, rd) \ |
137 __asm__ __volatile__ ("ppacb " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
138 |
2979 | 139 #define prevh(rt, rd) \ |
140 __asm__ __volatile__ ("prevh " #rd ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
141 |
2979 | 142 #define pmulth(rs, rt, rd) \ |
143 __asm__ __volatile__ ("pmulth " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
144 |
2979 | 145 #define pmaxh(rs, rt, rd) \ |
146 __asm__ __volatile__ ("pmaxh " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
147 |
2979 | 148 #define pminh(rs, rt, rd) \ |
149 __asm__ __volatile__ ("pminh " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
150 |
2979 | 151 #define pinteh(rs, rt, rd) \ |
152 __asm__ __volatile__ ("pinteh " #rd ", " #rs ", " #rt ) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
153 |
2979 | 154 #define paddh(rs, rt, rd) \ |
155 __asm__ __volatile__ ("paddh " #rd ", " #rs ", " #rt ) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
156 |
2979 | 157 #define psubh(rs, rt, rd) \ |
158 __asm__ __volatile__ ("psubh " #rd ", " #rs ", " #rt ) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
159 |
2979 | 160 #define psrah(rt, sa, rd) \ |
161 __asm__ __volatile__ ("psrah " #rd ", " #rt ", %0" : : "i"(sa) ) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
162 |
2979 | 163 #define pmfhl_uw(rd) \ |
164 __asm__ __volatile__ ("pmfhl.uw " #rd) | |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
165 |
2979 | 166 #define pextlb(rs, rt, rd) \ |
167 __asm__ __volatile__ ("pextlb " #rd ", " #rs ", " #rt ) | |
689
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
168 |
efcbfbd18864
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
diff
changeset
|
169 #endif |
721
71f669e9f633
ps2 optimizations update patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
michaelni
parents:
689
diff
changeset
|
170 |