[RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Mon Mar 6 12:03:00 GMT 2017


Hi Jakub,

On 06/03/17 11:48, Jakub Jelinek wrote:
> Hi!
>
> CCing also arm, aarch64 and mips maintainers on the issues in their
> backends.  It is likely if such VEC_SELECTs are visible to simplify-rtx.c,
> it would ICE on them.
>
> On Fri, Mar 03, 2017 at 05:28:27PM +0100, Jakub Jelinek wrote:
>> ../../gcc/config/aarch64/aarch64-simd.md:79:1: DImode of first vec_select operand is not a vector mode
>> ../../gcc/config/aarch64/aarch64-simd.md:79:1: DFmode of first vec_select operand is not a vector mode
>> ../../gcc/config/aarch64/aarch64-simd.md:588:1: DImode of first vec_select operand is not a vector mode
>> ../../gcc/config/aarch64/aarch64-simd.md:588:1: DFmode of first vec_select operand is not a vector mode
>> ../../gcc/config/aarch64/aarch64-simd.md:3192:1: DFmode of first vec_select operand is not a vector mode
>>
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select HImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select SImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select QImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select SImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select QImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1338:1: element mode mismatch between vec_select HImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select HImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select SImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select QImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select SImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select QImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1353:1: element mode mismatch between vec_select HImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select HImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select SImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select QImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select SImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select QImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1407:1: element mode mismatch between vec_select HImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select HImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select SImode and its operand QImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select QImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select SImode and its operand HImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select QImode and its operand SImode
>> ../../gcc/config/arm/neon.md:1422:1: element mode mismatch between vec_select HImode and its operand SImode

Could you file a PR for these please?
I think I see the issue with some of the NEON patterns (using VW and VQI iterators simultaneously I think)
but it'd take some time to do the testing for the fixes properly.

Thanks,
Kyrill

>> ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1307:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1307:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1307:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1307:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1401:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1401:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1401:1: vec_select parallel with 2 elements, expected 4
>> ../../gcc/config/mips/mips-msa.md:1401:1: vec_select parallel with 2 elements, expected 4
>>
>> 2017-03-03  Jakub Jelinek  <jakub@redhat.com>
>>
>> 	* genrecog.c (validate_pattern): Add VEC_SELECT validation.
>> 	* genmodes.c (emit_min_insn_modes_c): Call emit_mode_nunits
>> 	and emit_mode_inner.
> 	Jakub



More information about the Gcc-patches mailing list