Mercurial > libavcodec.hg
comparison ps2/mmi.h @ 689:efcbfbd18864 libavcodec
ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
author | michaelni |
---|---|
date | Mon, 23 Sep 2002 08:44:24 +0000 |
parents | |
children | 71f669e9f633 |
comparison
equal
deleted
inserted
replaced
688:894b61908734 | 689:efcbfbd18864 |
---|---|
1 #ifndef __mmi_H | |
2 #define __mmi_H | |
3 | |
4 #define align16 __attribute__ ((aligned (16))) | |
5 | |
6 /* | |
7 #define r0 $zero | |
8 #define r1 $at //assembler! | |
9 #define r2 $v0 //return | |
10 #define r3 $v1 //return | |
11 #define r4 $a0 //arg | |
12 #define r5 $a1 //arg | |
13 #define r6 $a2 //arg | |
14 #define r7 $a3 //arg | |
15 #define r8 $t0 //temp | |
16 #define r9 $t1 //temp | |
17 #define r10 $t2 //temp | |
18 #define r11 $t3 //temp | |
19 #define r12 $t4 //temp | |
20 #define r13 $t5 //temp | |
21 #define r14 $t6 //temp | |
22 #define r15 $t7 //temp | |
23 #define r16 $s0 //saved temp | |
24 #define r17 $s1 //saved temp | |
25 #define r18 $s2 //saved temp | |
26 #define r19 $s3 //saved temp | |
27 #define r20 $s4 //saved temp | |
28 #define r21 $s5 //saved temp | |
29 #define r22 $s6 //saved temp | |
30 #define r23 $s7 //saved temp | |
31 #define r24 $t8 //temp | |
32 #define r25 $t9 //temp | |
33 #define r26 $k0 //kernel | |
34 #define r27 $k1 //kernel | |
35 #define r28 $gp //global ptr | |
36 #define r29 $sp //stack ptr | |
37 #define r30 $fp //frame ptr | |
38 #define r31 $ra //return addr | |
39 */ | |
40 | |
41 | |
42 #define lq(base, off, reg) \ | |
43 __asm__ __volatile__ ("lq " #reg ", %0("#base ")" : : "i" (off) ) | |
44 | |
45 #define lq2(mem, reg) \ | |
46 __asm__ __volatile__ ("lq " #reg ", %0" : : "r" (mem)) | |
47 | |
48 #define sq(reg, off, base) \ | |
49 __asm__ __volatile__ ("sq " #reg ", %0("#base ")" : : "i" (off) ) | |
50 | |
51 /* | |
52 #define sd(reg, off, base) \ | |
53 __asm__ __volatile__ ("sd " #reg ", " #off "("#base ")") | |
54 */ | |
55 //seems assembler has bug encoding mnemonic 'sd', so DIY | |
56 #define sd3(reg, off, base) \ | |
57 __asm__ __volatile__ (".word %0" : : "i" ( 0xfc000000 | (base<<21) | (reg<<16) | (off))) | |
58 | |
59 #define sw(reg, off, base) \ | |
60 __asm__ __volatile__ ("sw " #reg ", " #off "("#base ")") | |
61 | |
62 #define sq2(reg, mem) \ | |
63 __asm__ __volatile__ ("sq " #reg ", %0" : : "m" (*(mem))) | |
64 | |
65 #define pinth(rs, rt, rd) \ | |
66 __asm__ __volatile__ ("pinth " #rd ", " #rs ", " #rt ) | |
67 | |
68 #define phmadh(rs, rt, rd) \ | |
69 __asm__ __volatile__ ("phmadh " #rd ", " #rs ", " #rt ) | |
70 | |
71 #define pcpyud(rs, rt, rd) \ | |
72 __asm__ __volatile__ ("pcpyud " #rd ", " #rs ", " #rt ) | |
73 | |
74 #define pcpyld(rs, rt, rd) \ | |
75 __asm__ __volatile__ ("pcpyld " #rd ", " #rs ", " #rt ) | |
76 | |
77 #define pcpyh(rt, rd) \ | |
78 __asm__ __volatile__ ("pcpyh " #rd ", " #rt ) | |
79 | |
80 #define paddw(rs, rt, rd) \ | |
81 __asm__ __volatile__ ("paddw " #rd ", " #rs ", " #rt ) | |
82 | |
83 #define pextlw(rs, rt, rd) \ | |
84 __asm__ __volatile__ ("pextlw " #rd ", " #rs ", " #rt ) | |
85 | |
86 #define pextuw(rs, rt, rd) \ | |
87 __asm__ __volatile__ ("pextuw " #rd ", " #rs ", " #rt ) | |
88 | |
89 #define pextlh(rs, rt, rd) \ | |
90 __asm__ __volatile__ ("pextlh " #rd ", " #rs ", " #rt ) | |
91 | |
92 #define pextuh(rs, rt, rd) \ | |
93 __asm__ __volatile__ ("pextuh " #rd ", " #rs ", " #rt ) | |
94 | |
95 #define psubw(rs, rt, rd) \ | |
96 __asm__ __volatile__ ("psubw " #rd ", " #rs ", " #rt ) | |
97 | |
98 #define psraw(rt, sa, rd) \ | |
99 __asm__ __volatile__ ("psraw " #rd ", " #rt ", %0" : : "i"(sa) ) | |
100 | |
101 #define ppach(rs, rt, rd) \ | |
102 __asm__ __volatile__ ("ppach " #rd ", " #rs ", " #rt ) | |
103 | |
104 #define ppacb(rs, rt, rd) \ | |
105 __asm__ __volatile__ ("ppacb " #rd ", " #rs ", " #rt ) | |
106 | |
107 #define prevh(rt, rd) \ | |
108 __asm__ __volatile__ ("prevh " #rd ", " #rt ) | |
109 | |
110 #define pmulth(rs, rt, rd) \ | |
111 __asm__ __volatile__ ("pmulth " #rd ", " #rs ", " #rt ) | |
112 | |
113 #define pmaxh(rs, rt, rd) \ | |
114 __asm__ __volatile__ ("pmaxh " #rd ", " #rs ", " #rt ) | |
115 | |
116 #define pminh(rs, rt, rd) \ | |
117 __asm__ __volatile__ ("pminh " #rd ", " #rs ", " #rt ) | |
118 | |
119 | |
120 #endif |