This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][ARM] Handle unordered comparison cases in NEON vcond

Hi all,

Given code:

#define MAX(a, b) (a > b ? a : b)
void foo (int ilast, float* w, float* w2)
  int i;
  for (i = 0; i < ilast; ++i)
    w[i] = MAX (0.0f, w2[i]);

compiled with
-O1 -funsafe-math-optimizations -ftree-vectorize -mfpu=neon -mfloat-abi=hard
arm-none-eabi will cause an ICE when trying to expand the vcond pattern.
Looking at the vcond pattern in, the predicate for the
comparison operator (arm_comparison_operator) uses
 which is not needed for vcond since we don't care about the ARM condition
(we can handle all the comparison cases ourselves in the expander).

Changing the predicate to comparison_operator allows the expander to proceed
but it ICEs again because the pattern doesn't handle the floating point
unordered cases! (i.e. UNGT, UNORDERED, UNLE etc).

Adding support for the unordered cases is very similar to the aarch64 port
This patch adapts that code to the arm port.

Added the testcase that exposed the ICE initially and also the UNORDERED and
variations of it.

No regressions on arm-none-eabi.

Ok for trunk?


2013-03-18  Kyrylo Tkachov  <>

	* config/arm/ (v_cmp_result): New mode attribute.
	* config/arm/ (vcond<mode><mode>): Handle unordered cases.

2013-03-18  Kyrylo Tkachov  <>

	* New test.
	* Likewise.
	* Likewise.

Attachment: neon-vcond.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]