FFmpeg
Data Structures | Macros | Functions
asm.h File Reference
#include <inttypes.h>
#include "libavutil/common.h"

Go to the source code of this file.

Data Structures

struct  unaligned_long
 

Macros

#define likely(x)   (x)
 
#define unlikely(x)   (x)
 
#define AMASK_BWX   (1 << 0)
 
#define AMASK_FIX   (1 << 1)
 
#define AMASK_CIX   (1 << 2)
 
#define AMASK_MVI   (1 << 8)
 
#define sextw(x)   ((int16_t) (x))
 
#define ldq(p)
 
#define ldl(p)
 
#define stq(l, p)
 
#define stl(l, p)
 
#define ldq_u(p)   (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
 
#define uldq(a)   (((const struct unaligned_long *) (a))->l)
 
#define prefetch(p)   __asm__ volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
 
#define prefetch_en(p)   __asm__ volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
 
#define prefetch_m(p)   __asm__ volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")
 
#define prefetch_men(p)   __asm__ volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")
 
#define cmpbge(a, b)   ({ uint64_t __r; __asm__ ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define extql(a, b)   ({ uint64_t __r; __asm__ ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define extwl(a, b)   ({ uint64_t __r; __asm__ ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define extqh(a, b)   ({ uint64_t __r; __asm__ ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define zap(a, b)   ({ uint64_t __r; __asm__ ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define zapnot(a, b)   ({ uint64_t __r; __asm__ ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
 
#define amask(a)   ({ uint64_t __r; __asm__ ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
 
#define implver()   ({ uint64_t __r; __asm__ ("implver %0" : "=r" (__r)); __r; })
 
#define rpcc()   ({ uint64_t __r; __asm__ volatile ("rpcc %0" : "=r" (__r)); __r; })
 
#define wh64(p)   __asm__ volatile("wh64 (%0)" : : "r"(p) : "memory")
 
#define minub8(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define minsb8(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define minuw4(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define minsw4(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define maxub8(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define maxsb8(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define maxuw4(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define maxsw4(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
 
#define perr(a, b)   ({ uint64_t __r; __asm__ (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
 
#define pklb(a)   ({ uint64_t __r; __asm__ (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
 
#define pkwb(a)   ({ uint64_t __r; __asm__ (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
 
#define unpkbl(a)   ({ uint64_t __r; __asm__ (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
 
#define unpkbw(a)   ({ uint64_t __r; __asm__ (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
 

Functions

static uint64_t BYTE_VEC (uint64_t x)
 
static uint64_t WORD_VEC (uint64_t x)
 

Macro Definition Documentation

◆ likely

#define likely (   x)    (x)

Definition at line 33 of file asm.h.

◆ unlikely

#define unlikely (   x)    (x)

Definition at line 34 of file asm.h.

◆ AMASK_BWX

#define AMASK_BWX   (1 << 0)

Definition at line 37 of file asm.h.

◆ AMASK_FIX

#define AMASK_FIX   (1 << 1)

Definition at line 38 of file asm.h.

◆ AMASK_CIX

#define AMASK_CIX   (1 << 2)

Definition at line 39 of file asm.h.

◆ AMASK_MVI

#define AMASK_MVI   (1 << 8)

Definition at line 40 of file asm.h.

◆ sextw

#define sextw (   x)    ((int16_t) (x))

Definition at line 56 of file asm.h.

◆ ldq

#define ldq (   p)
Value:
(((const union { \
uint64_t __l; \
__typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
} *) (p))->__l)

Definition at line 59 of file asm.h.

◆ ldl

#define ldl (   p)
Value:
(((const union { \
int32_t __l; \
__typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
} *) (p))->__l)

Definition at line 64 of file asm.h.

◆ stq

#define stq (   l,
 
)
Value:
do { \
(((union { \
uint64_t __l; \
__typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
} *) (p))->__l) = l; \
} while (0)

Definition at line 69 of file asm.h.

◆ stl

#define stl (   l,
 
)
Value:
do { \
(((union { \
int32_t __l; \
__typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
} *) (p))->__l) = l; \
} while (0)

Definition at line 76 of file asm.h.

◆ ldq_u

#define ldq_u (   p)    (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))

Definition at line 84 of file asm.h.

◆ uldq

#define uldq (   a)    (((const struct unaligned_long *) (a))->l)

Definition at line 85 of file asm.h.

◆ prefetch

#define prefetch (   p)    __asm__ volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")

Definition at line 103 of file asm.h.

◆ prefetch_en

#define prefetch_en (   p)    __asm__ volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")

Definition at line 104 of file asm.h.

◆ prefetch_m

#define prefetch_m (   p)    __asm__ volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")

Definition at line 105 of file asm.h.

◆ prefetch_men

#define prefetch_men (   p)    __asm__ volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")

Definition at line 106 of file asm.h.

◆ cmpbge

#define cmpbge (   a,
  b 
)    ({ uint64_t __r; __asm__ ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 107 of file asm.h.

◆ extql

#define extql (   a,
  b 
)    ({ uint64_t __r; __asm__ ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 108 of file asm.h.

◆ extwl

#define extwl (   a,
  b 
)    ({ uint64_t __r; __asm__ ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 109 of file asm.h.

◆ extqh

#define extqh (   a,
  b 
)    ({ uint64_t __r; __asm__ ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 110 of file asm.h.

◆ zap

#define zap (   a,
  b 
)    ({ uint64_t __r; __asm__ ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 111 of file asm.h.

◆ zapnot

#define zapnot (   a,
  b 
)    ({ uint64_t __r; __asm__ ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })

Definition at line 112 of file asm.h.

◆ amask

#define amask (   a)    ({ uint64_t __r; __asm__ ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })

Definition at line 113 of file asm.h.

◆ implver

#define implver ( )    ({ uint64_t __r; __asm__ ("implver %0" : "=r" (__r)); __r; })

Definition at line 114 of file asm.h.

◆ rpcc

#define rpcc ( )    ({ uint64_t __r; __asm__ volatile ("rpcc %0" : "=r" (__r)); __r; })

Definition at line 115 of file asm.h.

◆ wh64

#define wh64 (   p)    __asm__ volatile("wh64 (%0)" : : "r"(p) : "memory")

Definition at line 117 of file asm.h.

◆ minub8

#define minub8 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 134 of file asm.h.

◆ minsb8

#define minsb8 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 135 of file asm.h.

◆ minuw4

#define minuw4 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 136 of file asm.h.

◆ minsw4

#define minsw4 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 137 of file asm.h.

◆ maxub8

#define maxub8 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 138 of file asm.h.

◆ maxsb8

#define maxsb8 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 139 of file asm.h.

◆ maxuw4

#define maxuw4 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 140 of file asm.h.

◆ maxsw4

#define maxsw4 (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })

Definition at line 141 of file asm.h.

◆ perr

#define perr (   a,
  b 
)    ({ uint64_t __r; __asm__ (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })

Definition at line 142 of file asm.h.

◆ pklb

#define pklb (   a)    ({ uint64_t __r; __asm__ (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })

Definition at line 143 of file asm.h.

◆ pkwb

#define pkwb (   a)    ({ uint64_t __r; __asm__ (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })

Definition at line 144 of file asm.h.

◆ unpkbl

#define unpkbl (   a)    ({ uint64_t __r; __asm__ (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })

Definition at line 145 of file asm.h.

◆ unpkbw

#define unpkbw (   a)    ({ uint64_t __r; __asm__ (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })

Definition at line 146 of file asm.h.

Function Documentation

◆ BYTE_VEC()

static uint64_t BYTE_VEC ( uint64_t  x)
inlinestatic

Definition at line 42 of file asm.h.

Referenced by avg2(), avg2_no_rnd(), and avg4().

◆ WORD_VEC()

static uint64_t WORD_VEC ( uint64_t  x)
inlinestatic

Definition at line 49 of file asm.h.

Referenced by dct_unquantize_h263_axp().

int32_t
int32_t
Definition: audio_convert.c:194