On Mon, 24 Mar 2014, Janne Grunau wrote:

On 2014-03-24 14:49:34 +0200, Martin Storsjö wrote:
On Mon, 24 Mar 2014, Janne Grunau wrote:

On 2014-03-24 14:12:47 +0200, Martin Storsjö wrote:
On Thu, 20 Mar 2014, Ben Avison wrote:

+function ff_mlp_pack_output_inorder_\channels\()ch_mixedshift_armv6, export=1
+ .if SAMPLES_PER_LOOP > 1
+        tst     COUNT, #SAMPLES_PER_LOOP - 1  // always seems to be in practice
+        bne     X(ff_mlp_pack_output)         // but just in case, branch to C 
implementation if not
+ .endif

This (and a few similar occurrances further below) is lacking the
"it ne" in order to be able to build it in thumb mode.

Does it fail to build? branch is the only instruction with conditional
encodings in thumb mode. The encodings which require an 'it' only allow
a larger immediate offset.

Yes, it fails to build. Building with apple tools fails simply like this:

libavcodec/arm/mlpdsp_armv6.S:-915:9: error: unsupported relocation on symbol
        bne _ff_mlp_pack_output

Building with proper binutils on linux fails at the linking stage:

libavcodec/libavcodec.a(mlpdsp_armv6.o): In function 
`ff_mlp_pack_output_inorder_2ch_0shift_armv6':
libavcodec/arm/mlpdsp_armv6.S:353:(.text+0x4): relocation truncated to fit:
R_ARM_THM_JUMP19 against symbol `ff_mlp_pack_output' defined in
.text section in libavcodec/libavcodec.a(mlpdsp.o)

ok, the label is out of range and the additional 4 bits for the offset
we gain by using 'it' fixes it. I guess it could be either fixed by
making sure arm/mlpdsp_armv6.o and mlpdsp.o are placed close together
in the link command, using 'it' or not branching into the C function.
Enforcing an order on the link command is unfortunately quite hard since
we rely on $(sort) to filter out duplicates. I guess the easiest fix is
using 'it'.

Yes, and in the apple/iOS case, it even fails at compile time before the actual distance is known - apparently it doesn't support relocations in conditional thumb branches at all, so moving them closer in the link wouldn't help.

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to