annotate libmpeg2/alpha_asm.h @ 26489:925b2b7a1f34

dependency generation infrastructure for C++ files
author diego
date Thu, 24 Apr 2008 21:46:50 +0000
parents d0a8810e155c
children da2271c341ee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9857
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
1 /*
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
2 * Alpha assembly macros
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
3 * Copyright (c) 2002-2003 Falk Hueffner <falk@debian.org>
9857
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
4 *
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
5 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
6 * See http://libmpeg2.sourceforge.net/ for updates.
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
7 *
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
8 * mpeg2dec is free software; you can redistribute it and/or modify
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
11 * (at your option) any later version.
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
12 *
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
13 * mpeg2dec is distributed in the hope that it will be useful,
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
16 * GNU General Public License for more details.
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
17 *
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
21 */
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
22
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
23 #ifndef ALPHA_ASM_H
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
24 #define ALPHA_ASM_H
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
25
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
26 #include <inttypes.h>
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
27
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
28 #if defined __GNUC__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
29 # define GNUC_PREREQ(maj, min) \
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
30 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
31 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
32 # define GNUC_PREREQ(maj, min) 0
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
33 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
34
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
35 #define AMASK_BWX (1 << 0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
36 #define AMASK_FIX (1 << 1)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
37 #define AMASK_CIX (1 << 2)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
38 #define AMASK_MVI (1 << 8)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
39
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
40 #ifdef __alpha_bwx__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
41 # define HAVE_BWX() 1
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
42 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
43 # define HAVE_BWX() (amask(AMASK_BWX) == 0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
44 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
45 #ifdef __alpha_fix__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
46 # define HAVE_FIX() 1
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
47 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
48 # define HAVE_FIX() (amask(AMASK_FIX) == 0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
49 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
50 #ifdef __alpha_max__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
51 # define HAVE_MVI() 1
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
52 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
53 # define HAVE_MVI() (amask(AMASK_MVI) == 0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
54 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
55 #ifdef __alpha_cix__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
56 # define HAVE_CIX() 1
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
57 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
58 # define HAVE_CIX() (amask(AMASK_CIX) == 0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
59 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
60
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
61 inline static uint64_t BYTE_VEC(uint64_t x)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
62 {
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
63 x |= x << 8;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
64 x |= x << 16;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
65 x |= x << 32;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
66 return x;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
67 }
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
68 inline static uint64_t WORD_VEC(uint64_t x)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
69 {
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
70 x |= x << 16;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
71 x |= x << 32;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
72 return x;
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
73 }
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
74
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
75 #define ldq(p) (*(const uint64_t *) (p))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
76 #define ldl(p) (*(const int32_t *) (p))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
77 #define stl(l, p) do { *(uint32_t *) (p) = (l); } while (0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
78 #define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
79 #define sextw(x) ((int16_t) (x))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
80
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
81 #ifdef __GNUC__
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
82 struct unaligned_long { uint64_t l; } __attribute__((packed));
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
83 #define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
84 #define uldq(a) (((const struct unaligned_long *) (a))->l)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
85
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
86 #if GNUC_PREREQ(3,3)
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
87 #define prefetch(p) __builtin_prefetch((p), 0, 1)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
88 #define prefetch_en(p) __builtin_prefetch((p), 0, 0)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
89 #define prefetch_m(p) __builtin_prefetch((p), 1, 1)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
90 #define prefetch_men(p) __builtin_prefetch((p), 1, 0)
9857
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
91 #define cmpbge __builtin_alpha_cmpbge
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
92 /* Avoid warnings. */
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
93 #define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
94 #define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
95 #define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
96 #define zap __builtin_alpha_zap
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
97 #define zapnot __builtin_alpha_zapnot
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
98 #define amask __builtin_alpha_amask
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
99 #define implver __builtin_alpha_implver
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
100 #define rpcc __builtin_alpha_rpcc
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
101 #else
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
102 #define prefetch(p) asm volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
103 #define prefetch_en(p) asm volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
104 #define prefetch_m(p) asm volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
105 #define prefetch_men(p) asm volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
106 #define cmpbge(a, b) ({ uint64_t __r; asm ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
107 #define extql(a, b) ({ uint64_t __r; asm ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
108 #define extwl(a, b) ({ uint64_t __r; asm ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
109 #define extqh(a, b) ({ uint64_t __r; asm ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
110 #define zap(a, b) ({ uint64_t __r; asm ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
111 #define zapnot(a, b) ({ uint64_t __r; asm ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
112 #define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
113 #define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
114 #define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
115 #endif
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
116 #define wh64(p) asm volatile("wh64 (%0)" : : "r"(p) : "memory")
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
117
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
118 #if GNUC_PREREQ(3,3) && defined(__alpha_max__)
9857
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
119 #define minub8 __builtin_alpha_minub8
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
120 #define minsb8 __builtin_alpha_minsb8
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
121 #define minuw4 __builtin_alpha_minuw4
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
122 #define minsw4 __builtin_alpha_minsw4
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
123 #define maxub8 __builtin_alpha_maxub8
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
124 #define maxsb8 __builtin_alpha_maxsb8
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
125 #define maxuw4 __builtin_alpha_maxuw4
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
126 #define maxsw4 __builtin_alpha_maxsw4
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
127 #define perr __builtin_alpha_perr
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
128 #define pklb __builtin_alpha_pklb
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
129 #define pkwb __builtin_alpha_pkwb
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
130 #define unpkbl __builtin_alpha_unpkbl
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
131 #define unpkbw __builtin_alpha_unpkbw
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
132 #else
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
133 #define minub8(a, b) ({ uint64_t __r; asm (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
134 #define minsb8(a, b) ({ uint64_t __r; asm (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
135 #define minuw4(a, b) ({ uint64_t __r; asm (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
136 #define minsw4(a, b) ({ uint64_t __r; asm (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
137 #define maxub8(a, b) ({ uint64_t __r; asm (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
138 #define maxsb8(a, b) ({ uint64_t __r; asm (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
139 #define maxuw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
140 #define maxsw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
141 #define perr(a, b) ({ uint64_t __r; asm (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
142 #define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
143 #define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
144 #define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents: 9857
diff changeset
145 #define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
9857
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
146 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
147
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
148 #elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
149
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
150 #include <c_asm.h>
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
151 #define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
152 #define uldq(a) (*(const __unaligned uint64_t *) (a))
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
153 #define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
154 #define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
155 #define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
156 #define extqh(a, b) asm ("extqh %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
157 #define zap(a, b) asm ("zap %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
158 #define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
159 #define amask(a) asm ("amask %a0,%v0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
160 #define implver() asm ("implver %v0")
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
161 #define rpcc() asm ("rpcc %v0")
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
162 #define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
163 #define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
164 #define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
165 #define minsw4(a, b) asm ("minsw4 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
166 #define maxub8(a, b) asm ("maxub8 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
167 #define maxsb8(a, b) asm ("maxsb8 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
168 #define maxuw4(a, b) asm ("maxuw4 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
169 #define maxsw4(a, b) asm ("maxsw4 %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
170 #define perr(a, b) asm ("perr %a0,%a1,%v0", a, b)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
171 #define pklb(a) asm ("pklb %a0,%v0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
172 #define pkwb(a) asm ("pkwb %a0,%v0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
173 #define unpkbl(a) asm ("unpkbl %a0,%v0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
174 #define unpkbw(a) asm ("unpkbw %a0,%v0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
175 #define wh64(a) asm ("wh64 %a0", a)
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
176
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
177 #else
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
178 #error "Unknown compiler!"
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
179 #endif
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
180
89b48bc6c441 Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents:
diff changeset
181 #endif /* ALPHA_ASM_H */