Skip to content

Commit 896a5bf

Browse files
author
Janne Grunau
committed
arm: check if AS supports .dn
Move the GNU as check before the arch specific asm checks since the .dn check requires gas compatible assembler. Disable the VC-1 motion compensation NEON asm which is the only part using that directive. The integrated assembler in the upcoming clang 3.5 does not support .dn/.qn without plans to change that. Too much effort to implement it while it is rarely used. http://llvm.org/bugs/show_bug.cgi?id=18199.
1 parent 68a06b3 commit 896a5bf

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

configure

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,7 @@ SYSTEM_FUNCS="
14671467
"
14681468

14691469
TOOLCHAIN_FEATURES="
1470+
as_dn_directive
14701471
asm_mod_q
14711472
attribute_may_alias
14721473
attribute_packed
@@ -3721,6 +3722,20 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
37213722
EOF
37223723
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
37233724

3725+
3726+
if enabled asm; then
3727+
enabled arm && nogas=die
3728+
enabled_all ppc altivec && nogas=warn
3729+
as=${gas:=$as}
3730+
check_as <<EOF && enable gnu_as || \
3731+
$nogas "GNU assembler not found, install gas-preprocessor"
3732+
.macro m n
3733+
\n: .int 0
3734+
.endm
3735+
m x
3736+
EOF
3737+
fi
3738+
37243739
check_inline_asm inline_asm_labels '"1:\n"'
37253740

37263741
if enabled aarch64; then
@@ -3739,7 +3754,6 @@ elif enabled arm; then
37393754

37403755
check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
37413756
enabled thumb && check_cflags -mthumb || check_cflags -marm
3742-
nogas=die
37433757

37443758
if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
37453759
enable vfp_args
@@ -3767,6 +3781,11 @@ EOF
37673781

37683782
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
37693783

3784+
check_as <<EOF && enable as_dn_directive
3785+
ra .dn d0.i16
3786+
.unreq ra
3787+
EOF
3788+
37703789
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
37713790

37723791
elif enabled mips; then
@@ -3792,7 +3811,6 @@ elif enabled ppc; then
37923811

37933812
# AltiVec flags: The FSF version of GCC differs from the Apple version
37943813
if enabled altivec; then
3795-
nogas=warn
37963814
check_cflags -maltivec -mabi=altivec &&
37973815
{ check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
37983816
check_cflags -faltivec
@@ -3872,17 +3890,6 @@ EOF
38723890

38733891
fi
38743892

3875-
if enabled asm; then
3876-
as=${gas:=$as}
3877-
check_as <<EOF && enable gnu_as || \
3878-
$nogas "GNU assembler not found, install gas-preprocessor"
3879-
.macro m n
3880-
\n: .int 0
3881-
.endm
3882-
m x
3883-
EOF
3884-
fi
3885-
38863893
check_ldflags -Wl,--as-needed
38873894

38883895
if check_func dlopen; then

libavcodec/arm/vc1dsp_init_neon.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "libavcodec/vc1dsp.h"
2323
#include "vc1dsp.h"
2424

25+
#include "config.h"
26+
2527
void ff_vc1_inv_trans_8x8_neon(int16_t *block);
2628
void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block);
2729
void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block);
@@ -91,6 +93,7 @@ av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
9193
dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_neon;
9294

9395
dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_pixels8x8_neon;
96+
if (HAVE_AS_DN_DIRECTIVE) {
9497
dsp->put_vc1_mspel_pixels_tab[ 1] = ff_put_vc1_mspel_mc10_neon;
9598
dsp->put_vc1_mspel_pixels_tab[ 2] = ff_put_vc1_mspel_mc20_neon;
9699
dsp->put_vc1_mspel_pixels_tab[ 3] = ff_put_vc1_mspel_mc30_neon;
@@ -106,6 +109,7 @@ av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
106109
dsp->put_vc1_mspel_pixels_tab[13] = ff_put_vc1_mspel_mc13_neon;
107110
dsp->put_vc1_mspel_pixels_tab[14] = ff_put_vc1_mspel_mc23_neon;
108111
dsp->put_vc1_mspel_pixels_tab[15] = ff_put_vc1_mspel_mc33_neon;
112+
}
109113

110114
dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
111115
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;

libavcodec/arm/vc1dsp_neon.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "libavutil/arm/asm.S"
2525
#include "neon.S"
2626

27+
#include "config.h"
28+
2729
@ Transpose rows into columns of a matrix of 16-bit elements. For 4x4, pass
2830
@ double-word registers, for 8x4, pass quad-word registers.
2931
.macro transpose16 r0, r1, r2, r3
@@ -661,6 +663,7 @@ function ff_vc1_inv_trans_4x4_neon, export=1
661663
bx lr
662664
endfunc
663665

666+
#if HAVE_AS_DN_DIRECTIVE
664667
@ The absolute value of multiplication constants from vc1_mspel_filter and vc1_mspel_{ver,hor}_filter_16bits.
665668
@ The sign is embedded in the code below that carries out the multiplication (mspel_filter{,.16}).
666669
#define MSPEL_MODE_1_MUL_CONSTANTS 4 53 18 3
@@ -984,6 +987,7 @@ PUT_VC1_MSPEL_MC_V_ONLY(2)
984987
PUT_VC1_MSPEL_MC_V_ONLY(3)
985988

986989
#undef PUT_VC1_MSPEL_MC_V_ONLY
990+
#endif
987991

988992
function ff_put_pixels8x8_neon, export=1
989993
vld1.64 {d0}, [r1], r2

0 commit comments

Comments
 (0)