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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux