This bugzilla service is closed. All entries have been migrated to
Bug 1059 - maxcoeff() on integer arrays produces incorrect results on NEON
Summary: maxcoeff() on integer arrays produces incorrect results on NEON
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - vectorization (show other bugs)
Version: 3.2
Hardware: All All
: Normal Wrong Result
Assignee: Nobody
Depends on:
Reported: 2015-08-26 06:13 UTC by Akira MAEZAWA
Modified: 2019-12-04 14:52 UTC (History)
4 users (show)

Patch for Eigen/src/Core/arch/NEON/PacketMath.h (336 bytes, text/plain)
2015-08-26 06:13 UTC, Akira MAEZAWA
no flags Details

Description Akira MAEZAWA 2015-08-26 06:13:33 UTC
Created attachment 601 [details]
Patch for Eigen/src/Core/arch/NEON/PacketMath.h

Using maxcoeff() on integer arrays (or vectors, etc) produces incorrect result.

To reproduce the error, put the maximum element on either 3+4n th or 2+4n th (n>0 integer) index on 4byte-aligned Array.

The error is due to a bug in predux_max<Packet4i>(const Packet4i& a) found in Core/arch/NEON/PacketMath.h , where it is missing 
  max = vpmax_s32(max, max);

The patch is attached.
Comment 1 Christoph Hertzberg 2015-08-31 12:10:38 UTC
Makes sense to me. Can someone with access to a NEON CPU confirm this and apply it to 3.2 and the devel-branch?
If nobody does, and no objections arise, I'll apply this myself within the next days.
Comment 2 Gael Guennebaud 2015-09-01 14:31:43 UTC
Thank you for noticing this issue. It was already fixed in the default branch.
Comment 3 Nobody 2019-12-04 14:52:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to'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:

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