This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 871 - gcc fail to compile PacketMath.h
Summary: gcc fail to compile PacketMath.h
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: ARM - NEON All
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-30 12:25 UTC by phil.wang
Modified: 2019-12-04 13:41 UTC (History)
4 users (show)



Attachments

Description phil.wang 2014-08-30 12:25:36 UTC
In file included from ../eigen/Eigen/Core:293:0,
                 from ../eigen/Eigen/Dense:1,

../eigen/Eigen/src/Core/arch/NEON/PacketMath.h:55:45: error: missing binary operator before token "("
 #if (defined(__has_builtin) && __has_builtin(__builtin_prefetch)) || defined(__GNUC__)

I am using arm-linux-gcc 4.8.
Comment 1 Jitse Niesen 2014-08-31 01:16:53 UTC
According to http://stackoverflow.com/questions/25584920/how-to-fix-error-in-eigen-for-arm-neon , this is the same issue as discussed on the mailing list in the thread starting at http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2013/11/msg00011.html , but it looks like the solution proposed by Christoph in http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2013/11/msg00048.html was never acted on. Time to revisit this?
Comment 2 phil.wang 2014-08-31 05:04:48 UTC
I modified PacketMath.h according to msg00048, and it did pass compiling. However, the output assembly code was not as I expected.

Example code:
Eigen::Vector4f X, Y;
// X = ...
// Y = ...
X = X + Y;

There were four fadds instead of one vadd.

(In reply to Jitse Niesen from comment #1)
> According to
> http://stackoverflow.com/questions/25584920/how-to-fix-error-in-eigen-for-
> arm-neon , this is the same issue as discussed on the mailing list in the
> thread starting at
> http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2013/11/msg00011.
> html , but it looks like the solution proposed by Christoph in
> http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2013/11/msg00048.
> html was never acted on. Time to revisit this?
Comment 3 Gael Guennebaud 2014-09-01 11:00:09 UTC
I applied the needed changes:

https://bitbucket.org/eigen/eigen/commits/7829fa7c91cf/
https://bitbucket.org/eigen/eigen/commits/e6b961139761/


@phil.wang, make sure you compiled with neon enabled, for instance with "-mfpu=neon -mcpu=cortex-a8".
Comment 4 phil.wang 2014-09-01 11:47:26 UTC
I have a file name eigen-neon-example.cpp:

https://gist.github.com/Phillip-Wang/f729b26ab61dadc2a865

I compile it with arm-linux-gcc, with flags "-mfpu=neon -mcpu=cortex-a8".
Output assembly shows that addition between Eigen::Vector4f has not been parallelized.
Comment 5 Nobody 2019-12-04 13:41:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/871.

Note You need to log in before you can comment on or make changes to this bug.