This is the mail archive of the gcc-patches@gcc.gnu.org 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, PR middle-end/68134] Reject scalar modes in default get_mask_mode hook


On 20/02/16 09:29, Ilya Enkovich wrote:
2016-02-19 20:36 GMT+03:00 Alan Lawrence <alan.lawrence@foss.arm.com>:
Mostly this is fairly straightforward, relatively little midend code is
required, and the backend cleans up quite a bit. However, I get stuck on the
case of singleton vectors (64x1). No surprises there, then...

The PR/68134 fix, makes the 'mask mode' for comparing 64x1 vectors, into
BLKmode, so that we get past this in expand_vector_operations:

/* A scalar operation pretending to be a vector one.  */
   if (VECTOR_BOOLEAN_TYPE_P (type)
       && !VECTOR_MODE_P (TYPE_MODE (type))
       && TYPE_MODE (type) != BLKmode)
     return;

and we do the operation piecewise. (Which is what we want; there is only one
piece!)

However, with my vec_cmp + vcond_mask changes, dropping vconddidi, this
means we look for a vcond_maskdiblk and vec_cmpdiblk. Which doesn't really
feel right - it feels like the 64x1 mask should be a DImode, just like other
64x1 vectors.

The problem here is to distinguish vector mask of one DI element and
DI scalar mask.  We don't want to lower scalar mask manipulations
because they are simple integer operations, not vector ones. Probably
vector of a single DI should have V1DI mode and not pretend to be a
scalar?  This would make things easier.

Thanks for the quick reply, Ilya.

What's the difference between, as you say, a "simple integer operation" and a "vector" operation of just one element?

This is why we do *not* have V1DImode in the AArch64 (or ARM) backends, but instead treat 64x1 vectors as DImode - the operations are the same; so keeping them as the same mode, enables CSE and lots of other optimizations, plus we don't have to have two near-identical copies (DI + V1DI) for many patterns, etc...

If the operations were on a "DI scalar mask", when would the first part of that test, VECTOR_BOOLEAN_TYPE_P, hold?

Thanks, Alan


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