Re: [eigen] arm/neon inside eigen internals |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
On Thursday 04 March 2010 09:36:08 Thomas Capricelli wrote:
> (mostly aimed at Konstantinos I guess)
>
> In the recent patch providing Neon support (Thanks!), i have some questions
> regarding the use of __ARM_NEON__
>
> 1) Detection of architecture should be done in Core only, and in other
> files, we should only use things like EIGEN_VECTORIZE_NEON. This allows,
> for example, the user to define EIGEN_DONT_VECTORIZE and have indeed his
> code not making use of simd
well, the use of EIGEN_VECTORIZE_NEON is equivalent to __ARM_NEON__, ie both
are defined or not defined at the same time -at least right now, I can think
of no case where one compiles with -mfpu=neon but requires no vectorization,
one would use -mfpu=vfp instead. So perhaps I can replace __ARM_NEON__ with
EIGEN_VECTORIZE_NEON, no problem in that.
> 2) For ABI reason, as explained in Eigen/src/Core/util/Macros.h:40, i think
> the line 42 should use __arm__ instead of __ARM_NEON__ or
> EIGEN_VECTORIZE_NEON
>
> I first thought about patching/cleaning this myself, but i feel
> uncomfortable doing so because:
>
> 1) I want to know what Konstantinos thinks about it
> 2) I'm not sure ABI compatibility is such a hard requirement on embedded
> platforms such as ARM 3) in some places (like
> Eigen/src/Core/util/Memory.h:426 or Eigen/src/Core/util/XprHelper.h:92)
> i'm not sure whether __ARM_NEON__ should be replaced by __arm__ or
> EIGEN_VECTORIZE_NEON. That is, should this codepath be used on all arm
> platforms (think 'abi') or only in the neon case.
Regarding use of __arm__ instead:
These #ifdefs exists only because GCC on ARM cannot guarrantee that
__attribute__((aligned(16))) will be honoured (sometimes it is, sometimes it
is not). This is a bug, and I am actually discussing it (via email) right now
with the GCC ARM developers. Unaligned loads/stores is irrelevant if one is
not using vectorization so there is no need to force these ifdefs on all arm
platforms -in fact, I don't think it makes any difference whatsoever. I could
replace it with EIGEN_VECTORIZE_NEON, though.
Either way, I didn't put that much thought in it, I still have a few issues to
fix wrt to the NEON port anyway. I'm willing to fix it in anyway Benoit or
Gael see as more proper.
Konstantinos