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: [Boolean Vector, patch 1/5] Introduce boolean vector to be used as a vector comparison type


On 10/29/2015 07:08 AM, Ilya Enkovich wrote:
On 28 Oct 22:37, Ilya Enkovich wrote:
Seems the problem occurs in this check in expand_vector_operations_1:

   /* 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;

This is to filter out scalar operations on boolean vectors.
The problem here is that TYPE_MODE (type) doesn't return
V4SImode assigned to the type but calls vector_type_mode
instead which tries to find an integer mode for it and returns
TImode. This causes function exit and we don't expand vector
comparison.

Suppose simple option to fix it is to change default get_mask_mode
hook to return BLKmode in case chosen integer vector mode is not
vector_mode_supported_p.

Thanks,
Ilya


Here is a patch which fixes the problem on ARM (and on i386 with -mno-sse also).  I checked it fixes the problem on ARM and also bootstrapped and checked it on x86_64-unknown-linux-gnu.  Is it OK?

Thanks,
Ilya
--
gcc/

2015-10-29  Ilya Enkovich  <enkovich.gnu@gmail.com>

	* targhooks.c (default_get_mask_mode): Use BLKmode in
	case target doesn't support required vector mode.
	* stor-layout.c (layout_type): Check for BLKmode.
VOIDmode would probably be a better choice than BLKmode to signal when the target doesn't support the required vector mode.


Jeff


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