comparison alpha/asm.h @ 10072:0a3bf7990e39 libavcodec

Replace redundant GNUC_PREREQ macro by AV_GCC_VERSION_AT_LEAST from libavutil.
author diego
date Fri, 21 Aug 2009 10:10:42 +0000
parents 206d0cfa3163
children
comparison
equal deleted inserted replaced
10071:6ac0d4957d35 10072:0a3bf7990e39
22 #ifndef AVCODEC_ALPHA_ASM_H 22 #ifndef AVCODEC_ALPHA_ASM_H
23 #define AVCODEC_ALPHA_ASM_H 23 #define AVCODEC_ALPHA_ASM_H
24 24
25 #include <inttypes.h> 25 #include <inttypes.h>
26 26
27 #if defined __GNUC__ 27 #include "libavutil/common.h"
28 # define GNUC_PREREQ(maj, min) \
29 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
30 #else
31 # define GNUC_PREREQ(maj, min) 0
32 #endif
33 28
34 #if GNUC_PREREQ(2,96) 29 #if AV_GCC_VERSION_AT_LEAST(2,96)
35 # define likely(x) __builtin_expect((x) != 0, 1) 30 # define likely(x) __builtin_expect((x) != 0, 1)
36 # define unlikely(x) __builtin_expect((x) != 0, 0) 31 # define unlikely(x) __builtin_expect((x) != 0, 0)
37 #else 32 #else
38 # define likely(x) (x) 33 # define likely(x) (x)
39 # define unlikely(x) (x) 34 # define unlikely(x) (x)
87 } while (0) 82 } while (0)
88 struct unaligned_long { uint64_t l; } __attribute__((packed)); 83 struct unaligned_long { uint64_t l; } __attribute__((packed));
89 #define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul)) 84 #define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
90 #define uldq(a) (((const struct unaligned_long *) (a))->l) 85 #define uldq(a) (((const struct unaligned_long *) (a))->l)
91 86
92 #if GNUC_PREREQ(3,3) 87 #if AV_GCC_VERSION_AT_LEAST(3,3)
93 #define prefetch(p) __builtin_prefetch((p), 0, 1) 88 #define prefetch(p) __builtin_prefetch((p), 0, 1)
94 #define prefetch_en(p) __builtin_prefetch((p), 0, 0) 89 #define prefetch_en(p) __builtin_prefetch((p), 0, 0)
95 #define prefetch_m(p) __builtin_prefetch((p), 1, 1) 90 #define prefetch_m(p) __builtin_prefetch((p), 1, 1)
96 #define prefetch_men(p) __builtin_prefetch((p), 1, 0) 91 #define prefetch_men(p) __builtin_prefetch((p), 1, 0)
97 #define cmpbge __builtin_alpha_cmpbge 92 #define cmpbge __builtin_alpha_cmpbge
119 #define implver() ({ uint64_t __r; __asm__ ("implver %0" : "=r" (__r)); __r; }) 114 #define implver() ({ uint64_t __r; __asm__ ("implver %0" : "=r" (__r)); __r; })
120 #define rpcc() ({ uint64_t __r; __asm__ volatile ("rpcc %0" : "=r" (__r)); __r; }) 115 #define rpcc() ({ uint64_t __r; __asm__ volatile ("rpcc %0" : "=r" (__r)); __r; })
121 #endif 116 #endif
122 #define wh64(p) __asm__ volatile("wh64 (%0)" : : "r"(p) : "memory") 117 #define wh64(p) __asm__ volatile("wh64 (%0)" : : "r"(p) : "memory")
123 118
124 #if GNUC_PREREQ(3,3) && defined(__alpha_max__) 119 #if AV_GCC_VERSION_AT_LEAST(3,3) && defined(__alpha_max__)
125 #define minub8 __builtin_alpha_minub8 120 #define minub8 __builtin_alpha_minub8
126 #define minsb8 __builtin_alpha_minsb8 121 #define minsb8 __builtin_alpha_minsb8
127 #define minuw4 __builtin_alpha_minuw4 122 #define minuw4 __builtin_alpha_minuw4
128 #define minsw4 __builtin_alpha_minsw4 123 #define minsw4 __builtin_alpha_minsw4
129 #define maxub8 __builtin_alpha_maxub8 124 #define maxub8 __builtin_alpha_maxub8