This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Jun 2015 10:07:56 +0000
- Subject: [Bug tree-optimization/40073] Vector short/char shifts generate sub-optimal code
- Auto-submitted: auto-generated
- References: <bug-40073-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to alalaw01 from comment #6)
> Same problem on AArch64 (at -O3). We've decided the shift is to be done on
> integers, widening the arguments and then truncating, before we hit the
> vectorizer:
This is needed for correctness due to c/c++ promotion rules.
>
> int i;
> short unsigned int _4;
> int _5;
> int _8;
> short unsigned int _9;
> int pretmp_18;
> unsigned int ivtmp_21;
> unsigned int ivtmp_22;
>
> <bb 2>:
> pretmp_18 = (int) j_6(D);
>
> <bb 3>:
> # i_14 = PHI <i_11(4), 0(2)>
> # ivtmp_22 = PHI <ivtmp_21(4), 1024(2)>
> _4 = b[i_14];
> _5 = (int) _4;
> _8 = _5 << pretmp_18;
> _9 = (short unsigned int) _8;
> a[i_14] = _9;
> i_11 = i_14 + 1;
> ivtmp_21 = ivtmp_22 - 1;
> if (ivtmp_21 == 0)