rs6000, Add vector shift double builtin support
authorCarl Love <cel@us.ibm.com>
Wed, 27 May 2020 03:44:50 +0000 (22:44 -0500)
committerCarl Love <carll@us.ibm.com>
Wed, 5 Aug 2020 04:12:43 +0000 (23:12 -0500)
commit82f10dee344bf0807cab9f32745b35af3f2139d8
treee25d1489b98335599f579a606919e0cf3c104819
parent3f029aea51a9b48b03a0671e445339a5ab1607eb
rs6000, Add vector shift double builtin support

GCC maintainers:

The following patch adds support for the vector shift double builtins.

The patch has been compiled and tested on

  powerpc64le-unknown-linux-gnu (Power 8 LE)
  powerpc64le-unknown-linux-gnu (Power 9 LE)

and Mambo with no regression errors.

Please let me know if this patch is acceptable for the mainline branch.

Thanks.

                         Carl Love

-------------------------------------------------------

gcc/ChangeLog

    2020-08-04  Carl Love  <cel@us.ibm.com>

* config/rs6000/altivec.h (vec_sldb, vec_srdb): New defines.
* config/rs6000/altivec.md (UNSPEC_SLDB, UNSPEC_SRDB): New.
(SLDB_lr): New attribute.
(VSHIFT_DBL_LR): New iterator.
(vs<SLDB_lr>db_<mode>): New define_insn.
* config/rs6000/rs6000-builtin.def (VSLDB_V16QI, VSLDB_V8HI,
VSLDB_V4SI, VSLDB_V2DI, VSRDB_V16QI, VSRDB_V8HI, VSRDB_V4SI,
VSRDB_V2DI): New BU_P10V_3 definitions.
(SLDB, SRDB): New BU_P10_OVERLOAD_3 definitions.
* config/rs6000/rs6000-call.c (P10_BUILTIN_VEC_SLDB,
P10_BUILTIN_VEC_SRDB): New definitions.
(rs6000_expand_ternop_builtin) [CODE_FOR_vsldb_v16qi,
CODE_FOR_vsldb_v8hi, CODE_FOR_vsldb_v4si, CODE_FOR_vsldb_v2di,
CODE_FOR_vsrdb_v16qi, CODE_FOR_vsrdb_v8hi, CODE_FOR_vsrdb_v4si,
CODE_FOR_vsrdb_v2di]: Add clauses.
* doc/extend.texi: Add description for vec_sldb and vec_srdb.

gcc/testsuite/ChangeLog

    2020-08-04  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/vec-shift-double-runnable.c:  New test file.
gcc/config/rs6000/altivec.h
gcc/config/rs6000/altivec.md
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000-call.c
gcc/doc/extend.texi
gcc/testsuite/gcc.target/powerpc/vec-shift-double-runnable.c [new file with mode: 0644]