[Boolean Vector, patch 1/5] Introduce boolean vector to be used as a vector comparison type

Jeff Law law@redhat.com
Tue Nov 3 16:02:00 GMT 2015


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.
And just to be clear, since Richi pointed out that we're already using 
BLKmode for this kind of situation, this patch is OK.

Jeff



More information about the Gcc-patches mailing list