diff options
author | Måns Rullgård <mans@mansr.com> | 2010-07-04 18:33:40 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-07-04 18:33:40 +0000 |
commit | fe3d2e4b02155d67805f3d3cf54231278d56719c (patch) | |
tree | 760c1e5bc7aa067586da6863a1f3879fcda1b707 /libavcodec | |
parent | 11d788cadef7454bdb1ff43d73efbcaf33a4b01f (diff) | |
download | ffmpeg-streaming-fe3d2e4b02155d67805f3d3cf54231278d56719c.zip ffmpeg-streaming-fe3d2e4b02155d67805f3d3cf54231278d56719c.tar.gz |
PPC: add some asm support macros
Originally committed as revision 24042 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ppc/asm.S | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libavcodec/ppc/asm.S b/libavcodec/ppc/asm.S index abf63b1..e372d53 100644 --- a/libavcodec/ppc/asm.S +++ b/libavcodec/ppc/asm.S @@ -20,6 +20,62 @@ #include "config.h" +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) +#define X(s) JOIN(EXTERN_ASM, s) + +#if ARCH_PPC64 + +#define PTR .quad +#define lp ld +#define lpx ldx +#define stp std +#define stpu stdu +#define PS 8 +#define L(s) JOIN(., s) + +.macro extfunc name + .global X(\name) + .section .opd, "aw" +X(\name): + .quad L(\name), .TOC.@tocbase, 0 + .previous + .type X(\name), STT_FUNC +L(\name): +.endm + +.macro movrel rd, sym + ld \rd, \sym@got(r2) +.endm + +#else /* ARCH_PPC64 */ + +#define PTR .int +#define lp lwz +#define lpx lwzx +#define stp stw +#define stpu stwu +#define PS 4 +#define L(s) s + +.macro extfunc name + .global X(\name) + .type X(\name), STT_FUNC +X(\name): +\name: +.endm + +.macro movrel rd, sym +#if CONFIG_PIC + lwz \rd, \sym@got(r2) +#else + lis \rd, \sym@ha + la \rd, \sym@l(\rd) +#endif +.endm + +#endif /* ARCH_PPC64 */ + #if HAVE_IBM_ASM .macro DEFINE_REG n |