annotate alpha/asm.h @ 11682:5173cc26d42f libavcodec

schroenc: Set keyframe interval
author conrad
date Wed, 05 May 2010 21:02:45 +0000
parents 0a3bf7990e39
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
1 /*
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
2 * Alpha optimized DSP utils
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
3 * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
4 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
429
718a22dc121f license/copyright change
glantau
parents: 214
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 214
diff changeset
9 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
429
718a22dc121f license/copyright change
glantau
parents: 214
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
718a22dc121f license/copyright change
glantau
parents: 214
diff changeset
15 * Lesser General Public License for more details.
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
16 *
429
718a22dc121f license/copyright change
glantau
parents: 214
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3036
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2979
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
20 */
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
21
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 5830
diff changeset
22 #ifndef AVCODEC_ALPHA_ASM_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 5830
diff changeset
23 #define AVCODEC_ALPHA_ASM_H
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
24
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
25 #include <inttypes.h>
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
26
10072
0a3bf7990e39 Replace redundant GNUC_PREREQ macro by AV_GCC_VERSION_AT_LEAST from libavutil.
diego
parents: 8994
diff changeset
27 #include "libavutil/common.h"
728
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
28
10072
0a3bf7990e39 Replace redundant GNUC_PREREQ macro by AV_GCC_VERSION_AT_LEAST from libavutil.
diego
parents: 8994
diff changeset
29 #if AV_GCC_VERSION_AT_LEAST(2,96)
728
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
30 # define likely(x) __builtin_expect((x) != 0, 1)
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
31 # define unlikely(x) __builtin_expect((x) != 0, 0)
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
32 #else
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
33 # define likely(x) (x)
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
34 # define unlikely(x) (x)
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
35 #endif
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
36
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
37 #define AMASK_BWX (1 << 0)
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
38 #define AMASK_FIX (1 << 1)
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
39 #define AMASK_CIX (1 << 2)
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
40 #define AMASK_MVI (1 << 8)
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
41
1378
1831d86117a3 warning fixes
al3x
parents: 728
diff changeset
42 static inline uint64_t BYTE_VEC(uint64_t x)
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
43 {
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
44 x |= x << 8;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
45 x |= x << 16;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
46 x |= x << 32;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
47 return x;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
48 }
1378
1831d86117a3 warning fixes
al3x
parents: 728
diff changeset
49 static inline uint64_t WORD_VEC(uint64_t x)
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
50 {
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
51 x |= x << 16;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
52 x |= x << 32;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
53 return x;
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
54 }
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
55
728
9cda14fe33d9 Some nifty stuff for upcoming patches.
mellum
parents: 665
diff changeset
56 #define sextw(x) ((int16_t) (x))
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
57
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
58 #ifdef __GNUC__
2765
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
59 #define ldq(p) \
8618
178755e9663d Alpha: add some const, kill some warnings
mru
parents: 8031
diff changeset
60 (((const union { \
2765
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
61 uint64_t __l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
62 __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
63 } *) (p))->__l)
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
64 #define ldl(p) \
8618
178755e9663d Alpha: add some const, kill some warnings
mru
parents: 8031
diff changeset
65 (((const union { \
2765
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
66 int32_t __l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
67 __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
68 } *) (p))->__l)
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
69 #define stq(l, p) \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
70 do { \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
71 (((union { \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
72 uint64_t __l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
73 __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
74 } *) (p))->__l) = l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
75 } while (0)
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
76 #define stl(l, p) \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
77 do { \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
78 (((union { \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
79 int32_t __l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
80 __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
81 } *) (p))->__l) = l; \
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
82 } while (0)
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
83 struct unaligned_long { uint64_t l; } __attribute__((packed));
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
84 #define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
85 #define uldq(a) (((const struct unaligned_long *) (a))->l)
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
86
10072
0a3bf7990e39 Replace redundant GNUC_PREREQ macro by AV_GCC_VERSION_AT_LEAST from libavutil.
diego
parents: 8994
diff changeset
87 #if AV_GCC_VERSION_AT_LEAST(3,3)
1465
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
88 #define prefetch(p) __builtin_prefetch((p), 0, 1)
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
89 #define prefetch_en(p) __builtin_prefetch((p), 0, 0)
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
90 #define prefetch_m(p) __builtin_prefetch((p), 1, 1)
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
91 #define prefetch_men(p) __builtin_prefetch((p), 1, 0)
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
92 #define cmpbge __builtin_alpha_cmpbge
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
93 /* Avoid warnings. */
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
94 #define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
95 #define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
96 #define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
97 #define zap __builtin_alpha_zap
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
98 #define zapnot __builtin_alpha_zapnot
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
99 #define amask __builtin_alpha_amask
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
100 #define implver __builtin_alpha_implver
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
101 #define rpcc __builtin_alpha_rpcc
1465
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
102 #else
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
103 #define prefetch(p) __asm__ volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
104 #define prefetch_en(p) __asm__ volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
105 #define prefetch_m(p) __asm__ volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
106 #define prefetch_men(p) __asm__ volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
107 #define cmpbge(a, b) ({ uint64_t __r; __asm__ ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
108 #define extql(a, b) ({ uint64_t __r; __asm__ ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
109 #define extwl(a, b) ({ uint64_t __r; __asm__ ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
110 #define extqh(a, b) ({ uint64_t __r; __asm__ ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
111 #define zap(a, b) ({ uint64_t __r; __asm__ ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
112 #define zapnot(a, b) ({ uint64_t __r; __asm__ ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
113 #define amask(a) ({ uint64_t __r; __asm__ ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
114 #define implver() ({ uint64_t __r; __asm__ ("implver %0" : "=r" (__r)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
115 #define rpcc() ({ uint64_t __r; __asm__ volatile ("rpcc %0" : "=r" (__r)); __r; })
1465
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
116 #endif
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
117 #define wh64(p) __asm__ volatile("wh64 (%0)" : : "r"(p) : "memory")
1465
52254c2f9cae Use asms instead of builtins when compiling for generic Alpha. Less
mellum
parents: 1378
diff changeset
118
10072
0a3bf7990e39 Replace redundant GNUC_PREREQ macro by AV_GCC_VERSION_AT_LEAST from libavutil.
diego
parents: 8994
diff changeset
119 #if AV_GCC_VERSION_AT_LEAST(3,3) && defined(__alpha_max__)
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
120 #define minub8 __builtin_alpha_minub8
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
121 #define minsb8 __builtin_alpha_minsb8
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
122 #define minuw4 __builtin_alpha_minuw4
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
123 #define minsw4 __builtin_alpha_minsw4
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
124 #define maxub8 __builtin_alpha_maxub8
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
125 #define maxsb8 __builtin_alpha_maxsb8
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
126 #define maxuw4 __builtin_alpha_maxuw4
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
127 #define maxsw4 __builtin_alpha_maxsw4
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
128 #define perr __builtin_alpha_perr
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
129 #define pklb __builtin_alpha_pklb
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
130 #define pkwb __builtin_alpha_pkwb
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
131 #define unpkbl __builtin_alpha_unpkbl
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
132 #define unpkbw __builtin_alpha_unpkbw
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
133 #else
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
134 #define minub8(a, b) ({ uint64_t __r; __asm__ (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
135 #define minsb8(a, b) ({ uint64_t __r; __asm__ (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
136 #define minuw4(a, b) ({ uint64_t __r; __asm__ (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
137 #define minsw4(a, b) ({ uint64_t __r; __asm__ (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
138 #define maxub8(a, b) ({ uint64_t __r; __asm__ (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
139 #define maxsb8(a, b) ({ uint64_t __r; __asm__ (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
140 #define maxuw4(a, b) ({ uint64_t __r; __asm__ (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
141 #define maxsw4(a, b) ({ uint64_t __r; __asm__ (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
142 #define perr(a, b) ({ uint64_t __r; __asm__ (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
143 #define pklb(a) ({ uint64_t __r; __asm__ (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
144 #define pkwb(a) ({ uint64_t __r; __asm__ (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
145 #define unpkbl(a) ({ uint64_t __r; __asm__ (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7760
diff changeset
146 #define unpkbw(a) ({ uint64_t __r; __asm__ (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
147 #endif
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
148
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
149 #elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
150
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
151 #include <c_asm.h>
2765
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
152 #define ldq(p) (*(const uint64_t *) (p))
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
153 #define ldl(p) (*(const int32_t *) (p))
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
154 #define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
e44ff53b1c85 Communicate proper aliasing to gcc (needed for 4.1).
mellum
parents: 1465
diff changeset
155 #define stl(l, p) do { *(int32_t *) (p) = (l); } while (0)
8994
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
156 #define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
157 #define uldq(a) (*(const __unaligned uint64_t *) (a))
8994
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
158 #define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
159 #define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
160 #define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
161 #define extqh(a, b) asm ("extqh %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
162 #define zap(a, b) asm ("zap %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
163 #define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
164 #define amask(a) asm ("amask %a0,%v0", a)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
165 #define implver() asm ("implver %v0")
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
166 #define rpcc() asm ("rpcc %v0")
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
167 #define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
168 #define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
169 #define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
170 #define minsw4(a, b) asm ("minsw4 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
171 #define maxub8(a, b) asm ("maxub8 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
172 #define maxsb8(a, b) asm ("maxsb8 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
173 #define maxuw4(a, b) asm ("maxuw4 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
174 #define maxsw4(a, b) asm ("maxsw4 %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
175 #define perr(a, b) asm ("perr %a0,%a1,%v0", a, b)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
176 #define pklb(a) asm ("pklb %a0,%v0", a)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
177 #define pkwb(a) asm ("pkwb %a0,%v0", a)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
178 #define unpkbl(a) asm ("unpkbl %a0,%v0", a)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
179 #define unpkbw(a) asm ("unpkbw %a0,%v0", a)
206d0cfa3163 Alpha: fix inline asm with DEC/Compaq/HP compiler
mru
parents: 8618
diff changeset
180 #define wh64(a) asm ("wh64 %a0", a)
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
181
504
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
182 #else
4aa1ff2acc74 * Fixed constraints
mellum
parents: 429
diff changeset
183 #error "Unknown compiler!"
214
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
184 #endif
73df666cacc7 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
nickols_k
parents:
diff changeset
185
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 5830
diff changeset
186 #endif /* AVCODEC_ALPHA_ASM_H */