[pulseaudio-discuss] [PATCH 1/6 v3] core: Initialize ARM NEON code if available

Rémi Denis-Courmont remi at remlab.net
Wed Oct 17 01:53:50 PDT 2012


On Tue, 16 Oct 2012 10:49:34 +0530, Arun Raghavan
<arun.raghavan at collabora.co.uk> wrote:
> 3. How shall we go about enabling this code? Have a configure time check
> for some instructions that are needed, build it in if available, and
> then run-time detection should pick the right code path?

GCC does not support the target function attribute on ARM, so NEON cannot
be enabled selectively, on a per function basis.  As a consequence,
intrinsics and inline assembler cannot be used for run-time-conditional
NEON code: the code will only compile if NEON is enabled in CFLAGS. Yet if
NEON is enabled in CFLAGS, the compiler may emit NEON instruction for plain
C code such that the code will not run at all on processors without NEON.

So .S/.s assembler source files constitute the only way to write
run-time-conditional NEON code for the time being. Just make sure you did
_not_ enable NEON in the CFLAGS and enable it manually with the ".fpu neon"
assembler directive.

Personally, I much prefer .S/.s file over inline asm because I find them
more readable, but it's a matter of taste.

-- 
Rémi Denis-Courmont
Sent from my collocated server


More information about the pulseaudio-discuss mailing list