diff options
Diffstat (limited to 'libavutil/ppc')
-rw-r--r-- | libavutil/ppc/cpu.c | 10 | ||||
-rw-r--r-- | libavutil/ppc/cpu.h | 8 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.c | 8 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.h | 8 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_init.c | 8 | ||||
-rw-r--r-- | libavutil/ppc/intreadwrite.h | 48 | ||||
-rw-r--r-- | libavutil/ppc/timer.h | 15 | ||||
-rw-r--r-- | libavutil/ppc/types_altivec.h | 8 | ||||
-rw-r--r-- | libavutil/ppc/util_altivec.h | 8 |
9 files changed, 66 insertions, 55 deletions
diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c index 50107e1fca..d51e3fa659 100644 --- a/libavutil/ppc/cpu.c +++ b/libavutil/ppc/cpu.c @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -62,7 +62,7 @@ int ff_get_cpu_flags_ppc(void) if (err == 0) return has_vu ? AV_CPU_FLAG_ALTIVEC : 0; return 0; -#elif CONFIG_RUNTIME_CPUDETECT +#elif CONFIG_RUNTIME_CPUDETECT && defined(__linux__) && !ARCH_PPC64 int proc_ver; // Support of mfspr PVR emulation added in Linux 2.6.17. __asm__ volatile("mfspr %0, 287" : "=r" (proc_ver)); diff --git a/libavutil/ppc/cpu.h b/libavutil/ppc/cpu.h index f8fae58698..0a212f33cb 100644 --- a/libavutil/ppc/cpu.h +++ b/libavutil/ppc/cpu.h @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libavutil/ppc/float_dsp_altivec.c b/libavutil/ppc/float_dsp_altivec.c index fee4e7c7db..8cee82c1c7 100644 --- a/libavutil/ppc/float_dsp_altivec.c +++ b/libavutil/ppc/float_dsp_altivec.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libavutil/ppc/float_dsp_altivec.h b/libavutil/ppc/float_dsp_altivec.h index 87d50a8878..e1d530afa5 100644 --- a/libavutil/ppc/float_dsp_altivec.h +++ b/libavutil/ppc/float_dsp_altivec.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libavutil/ppc/float_dsp_init.c b/libavutil/ppc/float_dsp_init.c index 60d0f19aca..9dd2072b7a 100644 --- a/libavutil/ppc/float_dsp_init.c +++ b/libavutil/ppc/float_dsp_init.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h index fec54e63c5..733c01e48f 100644 --- a/libavutil/ppc/intreadwrite.h +++ b/libavutil/ppc/intreadwrite.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -26,46 +26,60 @@ #if HAVE_XFORM_ASM -#define AV_RL16 AV_RL16 -static av_always_inline uint16_t AV_RL16(const void *p) +#if HAVE_BIGENDIAN +#define AV_RL16 AV_RX16 +#define AV_WL16 AV_WX16 +#define AV_RL32 AV_RX32 +#define AV_WL32 AV_WX32 +#else +#define AV_RB16 AV_RX16 +#define AV_WB16 AV_WX16 +#define AV_RB32 AV_RX32 +#define AV_WB32 AV_WX32 +#endif + +static av_always_inline uint16_t AV_RX16(const void *p) { uint16_t v; __asm__ ("lhbrx %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p)); return v; } -#define AV_WL16 AV_WL16 -static av_always_inline void AV_WL16(void *p, uint16_t v) +static av_always_inline void AV_WX16(void *p, uint16_t v) { __asm__ ("sthbrx %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v)); } -#define AV_RL32 AV_RL32 -static av_always_inline uint32_t AV_RL32(const void *p) +static av_always_inline uint32_t AV_RX32(const void *p) { uint32_t v; __asm__ ("lwbrx %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p)); return v; } -#define AV_WL32 AV_WL32 -static av_always_inline void AV_WL32(void *p, uint32_t v) +static av_always_inline void AV_WX32(void *p, uint32_t v) { __asm__ ("stwbrx %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v)); } #if HAVE_LDBRX -#define AV_RL64 AV_RL64 -static av_always_inline uint64_t AV_RL64(const void *p) +#if HAVE_BIGENDIAN +#define AV_RL64 AV_RX64 +#define AV_WL64 AV_WX64 +#else +#define AV_RB64 AV_RX64 +#define AV_WB64 AV_WX64 +#endif + +static av_always_inline uint64_t AV_RX64(const void *p) { uint64_t v; __asm__ ("ldbrx %0, %y1" : "=r"(v) : "Z"(*(const uint64_t*)p)); return v; } -#define AV_WL64 AV_WL64 -static av_always_inline void AV_WL64(void *p, uint64_t v) +static av_always_inline void AV_WX64(void *p, uint64_t v) { __asm__ ("stdbrx %1, %y0" : "=Z"(*(uint64_t*)p) : "r"(v)); } @@ -102,7 +116,9 @@ static av_always_inline void AV_WL64(void *p, uint64_t v) * default, so we override it here. */ +#if HAVE_BIGENDIAN #define AV_RB64(p) (*(const uint64_t *)(p)) #define AV_WB64(p, v) (*(uint64_t *)(p) = (v)) +#endif #endif /* AVUTIL_PPC_INTREADWRITE_H */ diff --git a/libavutil/ppc/timer.h b/libavutil/ppc/timer.h index 8d08d2835b..b28e624566 100644 --- a/libavutil/ppc/timer.h +++ b/libavutil/ppc/timer.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2005 Luca Barbato <lu_zero@gentoo.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -25,8 +25,6 @@ #include "config.h" -#if HAVE_INLINE_ASM_LABELS - #define AV_READ_TIME read_time static inline uint64_t read_time(void) @@ -35,12 +33,11 @@ static inline uint64_t read_time(void) /* from section 2.2.1 of the 32-bit PowerPC PEM */ __asm__ volatile( - "1:\n" "mftbu %2\n" "mftb %0\n" "mftbu %1\n" "cmpw %2,%1\n" - "bne 1b\n" + "bne $-0x10\n" : "=r"(tbl), "=r"(tbu), "=r"(temp) : : "cc"); @@ -48,6 +45,4 @@ static inline uint64_t read_time(void) return (((uint64_t)tbu)<<32) | (uint64_t)tbl; } -#endif /* HAVE_INLINE_ASM_LABELS */ - #endif /* AVUTIL_PPC_TIMER_H */ diff --git a/libavutil/ppc/types_altivec.h b/libavutil/ppc/types_altivec.h index 0a4eaf885f..69d8957509 100644 --- a/libavutil/ppc/types_altivec.h +++ b/libavutil/ppc/types_altivec.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2006 Guillaume Poirier <gpoirier@mplayerhq.hu> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libavutil/ppc/util_altivec.h b/libavutil/ppc/util_altivec.h index 5624ac5523..2c0ad5f6c6 100644 --- a/libavutil/ppc/util_altivec.h +++ b/libavutil/ppc/util_altivec.h @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ |