00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVCODEC_MIPS_MMI_H
00022 #define AVCODEC_MIPS_MMI_H
00023
00024 #include <stdint.h>
00025
00026 #include "libavcodec/dsputil.h"
00027
00028 void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
00029 void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
00030 void ff_mmi_idct(DCTELEM *block);
00031
00032 #define align16 __attribute__ ((aligned (16)))
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #define lq(base, off, reg) \
00071 __asm__ volatile ("lq " #reg ", %0("#base ")" : : "i" (off) )
00072
00073 #define lq2(mem, reg) \
00074 __asm__ volatile ("lq " #reg ", %0" : : "r" (mem))
00075
00076 #define sq(reg, off, base) \
00077 __asm__ volatile ("sq " #reg ", %0("#base ")" : : "i" (off) )
00078
00079
00080
00081
00082
00083
00084 #define ld3(base, off, reg) \
00085 __asm__ volatile (".word %0" : : "i" ( 0xdc000000 | (base<<21) | (reg<<16) | (off)))
00086
00087 #define ldr3(base, off, reg) \
00088 __asm__ volatile (".word %0" : : "i" ( 0x6c000000 | (base<<21) | (reg<<16) | (off)))
00089
00090 #define ldl3(base, off, reg) \
00091 __asm__ volatile (".word %0" : : "i" ( 0x68000000 | (base<<21) | (reg<<16) | (off)))
00092
00093
00094
00095
00096
00097
00098 #define sd3(reg, off, base) \
00099 __asm__ volatile (".word %0" : : "i" ( 0xfc000000 | (base<<21) | (reg<<16) | (off)))
00100
00101 #define sw(reg, off, base) \
00102 __asm__ volatile ("sw " #reg ", " #off "("#base ")")
00103
00104 #define sq2(reg, mem) \
00105 __asm__ volatile ("sq " #reg ", %0" : : "m" (*(mem)))
00106
00107 #define pinth(rs, rt, rd) \
00108 __asm__ volatile ("pinth " #rd ", " #rs ", " #rt )
00109
00110 #define phmadh(rs, rt, rd) \
00111 __asm__ volatile ("phmadh " #rd ", " #rs ", " #rt )
00112
00113 #define pcpyud(rs, rt, rd) \
00114 __asm__ volatile ("pcpyud " #rd ", " #rs ", " #rt )
00115
00116 #define pcpyld(rs, rt, rd) \
00117 __asm__ volatile ("pcpyld " #rd ", " #rs ", " #rt )
00118
00119 #define pcpyh(rt, rd) \
00120 __asm__ volatile ("pcpyh " #rd ", " #rt )
00121
00122 #define paddw(rs, rt, rd) \
00123 __asm__ volatile ("paddw " #rd ", " #rs ", " #rt )
00124
00125 #define pextlw(rs, rt, rd) \
00126 __asm__ volatile ("pextlw " #rd ", " #rs ", " #rt )
00127
00128 #define pextuw(rs, rt, rd) \
00129 __asm__ volatile ("pextuw " #rd ", " #rs ", " #rt )
00130
00131 #define pextlh(rs, rt, rd) \
00132 __asm__ volatile ("pextlh " #rd ", " #rs ", " #rt )
00133
00134 #define pextuh(rs, rt, rd) \
00135 __asm__ volatile ("pextuh " #rd ", " #rs ", " #rt )
00136
00137 #define psubw(rs, rt, rd) \
00138 __asm__ volatile ("psubw " #rd ", " #rs ", " #rt )
00139
00140 #define psraw(rt, sa, rd) \
00141 __asm__ volatile ("psraw " #rd ", " #rt ", %0" : : "i"(sa) )
00142
00143 #define ppach(rs, rt, rd) \
00144 __asm__ volatile ("ppach " #rd ", " #rs ", " #rt )
00145
00146 #define ppacb(rs, rt, rd) \
00147 __asm__ volatile ("ppacb " #rd ", " #rs ", " #rt )
00148
00149 #define prevh(rt, rd) \
00150 __asm__ volatile ("prevh " #rd ", " #rt )
00151
00152 #define pmulth(rs, rt, rd) \
00153 __asm__ volatile ("pmulth " #rd ", " #rs ", " #rt )
00154
00155 #define pmaxh(rs, rt, rd) \
00156 __asm__ volatile ("pmaxh " #rd ", " #rs ", " #rt )
00157
00158 #define pminh(rs, rt, rd) \
00159 __asm__ volatile ("pminh " #rd ", " #rs ", " #rt )
00160
00161 #define pinteh(rs, rt, rd) \
00162 __asm__ volatile ("pinteh " #rd ", " #rs ", " #rt )
00163
00164 #define paddh(rs, rt, rd) \
00165 __asm__ volatile ("paddh " #rd ", " #rs ", " #rt )
00166
00167 #define psubh(rs, rt, rd) \
00168 __asm__ volatile ("psubh " #rd ", " #rs ", " #rt )
00169
00170 #define psrah(rt, sa, rd) \
00171 __asm__ volatile ("psrah " #rd ", " #rt ", %0" : : "i"(sa) )
00172
00173 #define pmfhl_uw(rd) \
00174 __asm__ volatile ("pmfhl.uw " #rd)
00175
00176 #define pextlb(rs, rt, rd) \
00177 __asm__ volatile ("pextlb " #rd ", " #rs ", " #rt )
00178
00179 #endif