History

avr32: remove explicit support

The vendor has long since switched to Arm, with the last product reaching their official end-of-life over 11 years ago. Linux support for the ISA was dropped 7 years ago. More importantly, this architecture was never supported by upstream GCC, and the vendor fork is stuck at version 4.2, which FFmpeg no longer supports (as per C11 requirement). Presumably, this is still the case given the lack of vendor support. Indeed all of the code being removed here consisted of inline assembler scalar optimisations. A sane C compiler should be able to perform those automatically nowadays (with the sole exception of fast CLZ detection), but this is moot as this architecture is evidently dead.

Rémi Denis-Courmont committed 2 years ago

Commit 4819aee1 parent be2cabc5 files · +2 −313Browse files

Unified · Split

5 files
  1. configure +1 −25
  2. libavcodec/avr32/mathops.h +0 −101
  3. libavcodec/mathops.h +0 −2
  4. libavutil/avr32/intreadwrite.h +0 −182
  5. libavutil/intreadwrite.h +1 −3
configure+1−25
@@ -2129,9 +2129,6 @@ AUTODETECT_LIBS=" · 2128 unmodified lines
2129ARCH_LIST="2129ARCH_LIST="
2130 aarch642130 aarch64
2131 arm2131 arm
2132 avr32
2133 avr32_ap
2134 avr32_uc
2135 bfin2132 bfin
2136 ia642133 ia64
2137 loongarch2134 loongarch
@@ -2815,7 +2812,7 @@ done · 677 unmodified lines
2815 2812
2816aligned_stack_if_any="aarch64 ppc x86"2813aligned_stack_if_any="aarch64 ppc x86"
2817fast_64bit_if_any="aarch64 ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"2814fast_64bit_if_any="aarch64 ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
2818fast_clz_if_any="aarch64 avr32 mips ppc x86"2815fast_clz_if_any="aarch64 mips ppc x86"
2819fast_unaligned_if_any="aarch64 ppc x86"2816fast_unaligned_if_any="aarch64 ppc x86"
2820simd_align_16_if_any="altivec neon sse"2817simd_align_16_if_any="altivec neon sse"
2821simd_align_32_if_any="avx"2818simd_align_32_if_any="avx"
@@ -5339,27 +5336,6 @@ elif enabled arm; then · 2517 unmodified lines
5339 5336
5340 test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee5337 test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
5341 5338
5342elif enabled avr32; then
5343
5344 case $cpu in
5345 ap7[02]0[0-2])
5346 subarch="avr32_ap"
5347 cpuflags="-mpart=$cpu"
5348 ;;
5349 ap)
5350 subarch="avr32_ap"
5351 cpuflags="-march=$cpu"
5352 ;;
5353 uc3[ab]*)
5354 subarch="avr32_uc"
5355 cpuflags="-mcpu=$cpu"
5356 ;;
5357 uc)
5358 subarch="avr32_uc"
5359 cpuflags="-march=$cpu"
5360 ;;
5361 esac
5362
5363elif enabled bfin; then5339elif enabled bfin; then
5364 5340
5365 cpuflags="-mcpu=$cpu"5341 cpuflags="-mcpu=$cpu"
libavcodec/avr32/mathops.h+0−101
@@ -1,101 +0,0 @@
1/*
2 * Simple math operations
3 * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef AVCODEC_AVR32_MATHOPS_H
23#define AVCODEC_AVR32_MATHOPS_H
24
25#include <stdint.h>
26#include "config.h"
27#include "libavutil/common.h"
28
29#if HAVE_INLINE_ASM
30
31#define MULL MULL
32static inline av_const int MULL(int a, int b, unsigned shift)
33{
34 union { int64_t x; int hl[2]; } x;
35 __asm__ ("muls.d %0, %1, %2 \n\t"
36 "lsr %0, %3 \n\t"
37 "or %0, %0, %m0<<%4 \n\t"
38 : "=r"(x) : "r"(b), "r"(a), "i"(shift), "i"(32-shift));
39 return x.hl[1];
40}
41
42#define MULH MULH
43static inline av_const int MULH(int a, int b)
44{
45 union { int64_t x; int hl[2]; } x;
46 __asm__ ("muls.d %0, %1, %2" : "=r"(x.x) : "r"(a), "r"(b));
47 return x.hl[0];
48}
49
50#define MUL64 MUL64
51static inline av_const int64_t MUL64(int a, int b)
52{
53 int64_t x;
54 __asm__ ("muls.d %0, %1, %2" : "=r"(x) : "r"(a), "r"(b));
55 return x;
56}
57
58static inline av_const int64_t MAC64(int64_t d, int a, int b)
59{
60 __asm__ ("macs.d %0, %1, %2" : "+r"(d) : "r"(a), "r"(b));
61 return d;
62}
63#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
64#define MLS64(d, a, b) MAC64(d, -(a), b)
65
66static inline av_const int MAC16(int d, int a, int b)
67{
68 __asm__ ("machh.w %0, %1:b, %2:b" : "+r"(d) : "r"(a), "r"(b));
69 return d;
70}
71#define MAC16(d, a, b) ((d) = MAC16(d, a, b))
72#define MLS16(d, a, b) MAC16(d, -(a), b)
73
74#define MUL16 MUL16
75static inline av_const int MUL16(int a, int b)
76{
77 int d;
78 __asm__ ("mulhh.w %0, %1:b, %2:b" : "=r"(d) : "r"(a), "r"(b));
79 return d;
80}
81
82#define mid_pred mid_pred
83static inline av_const int mid_pred(int a, int b, int c)
84{
85 int m;
86 __asm__ ("mov %0, %2 \n\t"
87 "cp.w %1, %2 \n\t"
88 "movgt %0, %1 \n\t"
89 "movgt %1, %2 \n\t"
90 "cp.w %1, %3 \n\t"
91 "movle %1, %3 \n\t"
92 "cp.w %0, %1 \n\t"
93 "movgt %0, %1 \n\t"
94 : "=&r"(m), "+r"(a)
95 : "r"(b), "r"(c));
96 return m;
97}
98
99#endif /* HAVE_INLINE_ASM */
100
101#endif /* AVCODEC_AVR32_MATHOPS_H */
libavcodec/mathops.h+0−2
@@ -39,8 +39,6 @@ extern const uint8_t ff_zigzag_scan[16+1]; · 38 unmodified lines
39 39
40#if ARCH_ARM40#if ARCH_ARM
41# include "arm/mathops.h"41# include "arm/mathops.h"
42#elif ARCH_AVR32
43# include "avr32/mathops.h"
44#elif ARCH_MIPS42#elif ARCH_MIPS
45# include "mips/mathops.h"43# include "mips/mathops.h"
46#elif ARCH_PPC44#elif ARCH_PPC
libavutil/avr32/intreadwrite.h+0−182
@@ -1,182 +0,0 @@
1/*
2 * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef AVUTIL_AVR32_INTREADWRITE_H
22#define AVUTIL_AVR32_INTREADWRITE_H
23
24#include <stdint.h>
25#include "config.h"
26#include "libavutil/bswap.h"
27
28/*
29 * AVR32 does not support unaligned memory accesses, except for the AP
30 * series which supports unaligned 32-bit loads and stores. 16-bit
31 * and 64-bit accesses must be aligned to 16 and 32 bits, respectively.
32 * This means we cannot use the byte-swapping load/store instructions
33 * here.
34 *
35 * For 16-bit, 24-bit, and (on UC series) 32-bit loads, we instead use
36 * the LDINS.B instruction, which gcc fails to utilise with the
37 * generic code. GCC also fails to use plain LD.W and ST.W even for
38 * AP processors, so we override the generic code. The 64-bit
39 * versions are improved by using our optimised 32-bit functions.
40 */
41
42#define AV_RL16 AV_RL16
43static av_always_inline uint16_t AV_RL16(const void *p)
44{
45 uint16_t v;
46 __asm__ ("ld.ub %0, %1 \n\t"
47 "ldins.b %0:l, %2 \n\t"
48 : "=&r"(v)
49 : "m"(*(const uint8_t*)p), "RKs12"(*((const uint8_t*)p+1)));
50 return v;
51}
52
53#define AV_RB16 AV_RB16
54static av_always_inline uint16_t AV_RB16(const void *p)
55{
56 uint16_t v;
57 __asm__ ("ld.ub %0, %2 \n\t"
58 "ldins.b %0:l, %1 \n\t"
59 : "=&r"(v)
60 : "RKs12"(*(const uint8_t*)p), "m"(*((const uint8_t*)p+1)));
61 return v;
62}
63
64#define AV_RB24 AV_RB24
65static av_always_inline uint32_t AV_RB24(const void *p)
66{
67 uint32_t v;
68 __asm__ ("ld.ub %0, %3 \n\t"
69 "ldins.b %0:l, %2 \n\t"
70 "ldins.b %0:u, %1 \n\t"
71 : "=&r"(v)
72 : "RKs12"(* (const uint8_t*)p),
73 "RKs12"(*((const uint8_t*)p+1)),
74 "m" (*((const uint8_t*)p+2)));
75 return v;
76}
77
78#define AV_RL24 AV_RL24
79static av_always_inline uint32_t AV_RL24(const void *p)
80{
81 uint32_t v;
82 __asm__ ("ld.ub %0, %1 \n\t"
83 "ldins.b %0:l, %2 \n\t"
84 "ldins.b %0:u, %3 \n\t"
85 : "=&r"(v)
86 : "m" (* (const uint8_t*)p),
87 "RKs12"(*((const uint8_t*)p+1)),
88 "RKs12"(*((const uint8_t*)p+2)));
89 return v;
90}
91
92#if ARCH_AVR32_AP
93
94#define AV_RB32 AV_RB32
95static av_always_inline uint32_t AV_RB32(const void *p)
96{
97 uint32_t v;
98 __asm__ ("ld.w %0, %1" : "=r"(v) : "m"(*(const uint32_t*)p));
99 return v;
100}
101
102#define AV_WB32 AV_WB32
103static av_always_inline void AV_WB32(void *p, uint32_t v)
104{
105 __asm__ ("st.w %0, %1" : "=m"(*(uint32_t*)p) : "r"(v));
106}
107
108/* These two would be defined by generic code, but we need them sooner. */
109#define AV_RL32(p) av_bswap32(AV_RB32(p))
110#define AV_WL32(p, v) AV_WB32(p, av_bswap32(v))
111
112#define AV_WB64 AV_WB64
113static av_always_inline void AV_WB64(void *p, uint64_t v)
114{
115 union { uint64_t v; uint32_t hl[2]; } vv = { v };
116 AV_WB32(p, vv.hl[0]);
117 AV_WB32((uint32_t*)p+1, vv.hl[1]);
118}
119
120#define AV_WL64 AV_WL64
121static av_always_inline void AV_WL64(void *p, uint64_t v)
122{
123 union { uint64_t v; uint32_t hl[2]; } vv = { v };
124 AV_WL32(p, vv.hl[1]);
125 AV_WL32((uint32_t*)p+1, vv.hl[0]);
126}
127
128#else /* ARCH_AVR32_AP */
129
130#define AV_RB32 AV_RB32
131static av_always_inline uint32_t AV_RB32(const void *p)
132{
133 uint32_t v;
134 __asm__ ("ld.ub %0, %4 \n\t"
135 "ldins.b %0:l, %3 \n\t"
136 "ldins.b %0:u, %2 \n\t"
137 "ldins.b %0:t, %1 \n\t"
138 : "=&r"(v)
139 : "RKs12"(* (const uint8_t*)p),
140 "RKs12"(*((const uint8_t*)p+1)),
141 "RKs12"(*((const uint8_t*)p+2)),
142 "m" (*((const uint8_t*)p+3)));
143 return v;
144}
145
146#define AV_RL32 AV_RL32
147static av_always_inline uint32_t AV_RL32(const void *p)
148{
149 uint32_t v;
150 __asm__ ("ld.ub %0, %1 \n\t"
151 "ldins.b %0:l, %2 \n\t"
152 "ldins.b %0:u, %3 \n\t"
153 "ldins.b %0:t, %4 \n\t"
154 : "=&r"(v)
155 : "m" (* (const uint8_t*)p),
156 "RKs12"(*((const uint8_t*)p+1)),
157 "RKs12"(*((const uint8_t*)p+2)),
158 "RKs12"(*((const uint8_t*)p+3)));
159 return v;
160}
161
162#endif /* ARCH_AVR32_AP */
163
164#define AV_RB64 AV_RB64
165static av_always_inline uint64_t AV_RB64(const void *p)
166{
167 union { uint64_t v; uint32_t hl[2]; } v;
168 v.hl[0] = AV_RB32(p);
169 v.hl[1] = AV_RB32((const uint32_t*)p+1);
170 return v.v;
171}
172
173#define AV_RL64 AV_RL64
174static av_always_inline uint64_t AV_RL64(const void *p)
175{
176 union { uint64_t v; uint32_t hl[2]; } v;
177 v.hl[1] = AV_RL32(p);
178 v.hl[0] = AV_RL32((const uint32_t*)p+1);
179 return v.v;
180}
181
182#endif /* AVUTIL_AVR32_INTREADWRITE_H */
libavutil/intreadwrite.h+1−3
@@ -64,9 +64,7 @@ typedef union { · 63 unmodified lines
64 64
65#include "config.h"65#include "config.h"
66 66
67#if ARCH_AVR3267#if ARCH_MIPS
68# include "avr32/intreadwrite.h"
69#elif ARCH_MIPS
70# include "mips/intreadwrite.h"68# include "mips/intreadwrite.h"
71#elif ARCH_PPC69#elif ARCH_PPC
72# include "ppc/intreadwrite.h"70# include "ppc/intreadwrite.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t