https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86987

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Tue Sep 25 22:09:38 2018
New Revision: 264584

URL: https://gcc.gnu.org/viewcvs?rev=264584&root=gcc&view=rev
Log:
rs6000: Do not allow out of range immediate in vsplt[bhw] (PR86987)

The original AltiVec manuals had the immediate lane number in the
splat instructions as a 5-bit number, but anything too big has no
defined meaning, and gas will choke on it too.  This patch disallows
it in the instruction patterns as well as in the builtins.  This
solves PR86987.


        PR target/86987
        * config/rs6000/altivec.md (altivec_vspltb): Use
        const_0_to_15_operand instead of u5bit_cint_operand.
        (*altivec_vspltb_internal): Ditto.
        (altivec_vspltb_direct): Ditto.
        (altivec_vsplth): Use const_0_to_7_operand instead of
        u5bit_cint_operand.
        (*altivec_vsplth_internal): Ditto.
        (altivec_vsplth_direct): Ditto.
        (altivec_vspltw): Use const_0_to_3_operand instead of
        u5bit_cint_operand.
        (*altivec_vspltw_internal): Ditto.
        (altivec_vspltw_direct): Ditto.
        (altivec_vspltsf): Ditto.
        (*altivec_vspltsf_internal): Ditto.
        * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Handle the
        various splats with the proper size immediate.  Reorder the various
        cases by ascending size of immediate, and put all such together.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/altivec.md
    trunk/gcc/config/rs6000/rs6000.c

Reply via email to