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]

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

On 03/18/13 12:09, Kyrylo Tkachov wrote:
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?

Please file a ticket in bugzilla with this testcase and triage with respect to other release branches as well as this is likely to show up in 4.8 as well.

Can you please also check what happens with 4.6 and 4.7 ?

This is OK for trunk with the appropriate bug id in the changelog(s)



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.

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