annotate libmpeg2/mmx.h @ 21996:05d024607a60

Clarify -delay.
author diego
date Thu, 25 Jan 2007 17:44:29 +0000
parents d0a8810e155c
children 2506f1b0bdbe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * mmx.h
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9852
diff changeset
3 * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
7 * See http://libmpeg2.sourceforge.net/ for updates.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 * (at your option) any later version.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * GNU General Public License for more details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 * The type of an value that fits in an MMX register (note that long
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 * long constant values MUST be suffixed by LL and unsigned long long
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 * values by ULL, lest they be truncated by the compiler)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 typedef union {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 long long q; /* Quadword (64-bit) value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 unsigned long long uq; /* Unsigned Quadword */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 int d[2]; /* 2 Doubleword (32-bit) values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 unsigned int ud[2]; /* 2 Unsigned Doubleword */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 short w[4]; /* 4 Word (16-bit) values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 unsigned short uw[4]; /* 4 Unsigned Word */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 char b[8]; /* 8 Byte (8-bit) values */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 unsigned char ub[8]; /* 8 Unsigned Byte */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 float s[2]; /* Single-precision (32-bit) value */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 } ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 #define mmx_i2r(op,imm,reg) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 __asm__ __volatile__ (#op " %0, %%" #reg \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 : /* nothing */ \
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
46 : "i" (imm) )
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 #define mmx_m2r(op,mem,reg) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 __asm__ __volatile__ (#op " %0, %%" #reg \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 : /* nothing */ \
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
51 : "m" (mem))
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 #define mmx_r2m(op,reg,mem) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 __asm__ __volatile__ (#op " %%" #reg ", %0" \
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
55 : "=m" (mem) \
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 : /* nothing */ )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 #define mmx_r2r(op,regs,regd) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 __asm__ __volatile__ (#op " %" #regs ", %" #regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 #define emms() __asm__ __volatile__ ("emms")
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 #define movd_m2r(var,reg) mmx_m2r (movd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 #define movd_r2m(reg,var) mmx_r2m (movd, reg, var)
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
66 #define movd_v2r(var,reg) __asm__ __volatile__ ("movd %0, %%" #reg \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
67 : /* nothing */ \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
68 : "rm" (var))
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
69 #define movd_r2v(reg,var) __asm__ __volatile__ ("movd %%" #reg ", %0" \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
70 : "=rm" (var) \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
71 : /* nothing */ )
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 #define movq_m2r(var,reg) mmx_m2r (movq, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 #define movq_r2m(reg,var) mmx_r2m (movq, reg, var)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 #define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 #define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 #define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 #define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 #define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 #define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 #define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 #define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 #define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 #define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 #define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 #define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 #define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 #define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 #define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 #define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 #define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 #define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 #define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 #define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 #define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 #define pand_m2r(var,reg) mmx_m2r (pand, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 #define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 #define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 #define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 #define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 #define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 #define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 #define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 #define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 #define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 #define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 #define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 #define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 #define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 #define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 #define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 #define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 #define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 #define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 #define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 #define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 #define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 #define por_m2r(var,reg) mmx_m2r (por, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 #define por_r2r(regs,regd) mmx_r2r (por, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 #define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 #define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 #define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 #define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 #define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 #define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 #define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 #define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 #define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 #define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 #define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 #define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 #define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 #define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 #define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 #define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 #define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 #define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 #define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 #define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 #define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 #define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 #define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 #define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 #define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 #define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 #define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 #define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 #define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 #define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 #define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 #define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 #define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 #define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 #define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 #define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 #define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 #define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 #define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 #define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 #define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 #define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 #define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 #define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185 #define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 #define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 #define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 #define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 #define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 #define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 #define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 #define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 /* 3DNOW extensions */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 #define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 #define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 /* AMD MMX extensions - also available in intel SSE */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 #define mmx_m2ri(op,mem,reg,imm) \
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
206 __asm__ __volatile__ (#op " %1, %0, %%" #reg \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
207 : /* nothing */ \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
208 : "m" (mem), "i" (imm))
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
209
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 #define mmx_r2ri(op,regs,regd,imm) \
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
211 __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
212 : /* nothing */ \
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
213 : "i" (imm) )
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 #define mmx_fetch(mem,hint) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 __asm__ __volatile__ ("prefetch" #hint " %0" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 : /* nothing */ \
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 36
diff changeset
218 : "m" (mem))
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 #define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 #define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 #define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 #define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 #define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 #define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 #define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 #define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 #define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235 #define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 #define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 #define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 #define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 #define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 #define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 #define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 #define pmovmskb(mmreg,reg) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 #define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 #define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 #define prefetcht0(mem) mmx_fetch (mem, t0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 #define prefetcht1(mem) mmx_fetch (mem, t1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 #define prefetcht2(mem) mmx_fetch (mem, t2)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 #define prefetchnta(mem) mmx_fetch (mem, nta)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 #define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 #define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 #define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 #define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 #define sfence() __asm__ __volatile__ ("sfence\n\t")