aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000-call.c
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2020-05-26 14:13:29 -0500
committerCarl Love <carll@us.ibm.com>2020-08-04 23:09:58 -0500
commit530e90952574febf1fa51639b08bd6b3f188b0b0 (patch)
tree3d728a2340192aa982c62ad02e440dde65c743ce /gcc/config/rs6000/rs6000-call.c
parent30d02149ea4baeea9045e07354a152a68e120fec (diff)
downloadgcc-530e90952574febf1fa51639b08bd6b3f188b0b0.zip
gcc-530e90952574febf1fa51639b08bd6b3f188b0b0.tar.gz
gcc-530e90952574febf1fa51639b08bd6b3f188b0b0.tar.bz2
rs6000 Add vector insert builtin support
GCC maintainers: This patch adds support for vec_insertl and vec_inserth 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_insertl, vec_inserth): New defines. * config/rs6000/rs6000-builtin.def (VINSERTGPRBL, VINSERTGPRHL, VINSERTGPRWL, VINSERTGPRDL, VINSERTVPRBL, VINSERTVPRHL, VINSERTVPRWL, VINSERTGPRBR, VINSERTGPRHR, VINSERTGPRWR, VINSERTGPRDR, VINSERTVPRBR, VINSERTVPRHR, VINSERTVPRWR): New builtins. (INSERTL, INSERTH): New builtins. * config/rs6000/rs6000-call.c (P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VEC_INSERTH): New overloaded definitions. (P10_BUILTIN_VINSERTGPRBL, P10_BUILTIN_VINSERTGPRHL, P10_BUILTIN_VINSERTGPRWL, P10_BUILTIN_VINSERTGPRDL, P10_BUILTIN_VINSERTVPRBL, P10_BUILTIN_VINSERTVPRHL, P10_BUILTIN_VINSERTVPRWL): Add case entries. * config/rs6000/vsx.md (define_c_enum): Add UNSPEC_INSERTL, UNSPEC_INSERTR. (define_expand): Add vinsertvl_<mode>, vinsertvr_<mode>, vinsertgl_<mode>, vinsertgr_<mode>, mode is VI2. (define_ins): vinsertvl_internal_<mode>, vinsertvr_internal_<mode>, vinsertgl_internal_<mode>, vinsertgr_internal_<mode>, mode VEC_I. * doc/extend.texi: Add documentation for vec_insertl, vec_inserth. gcc/testsuite/ChangeLog 2020-08-04 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/vec-insert-word-runnable.c: New test case.
Diffstat (limited to 'gcc/config/rs6000/rs6000-call.c')
-rw-r--r--gcc/config/rs6000/rs6000-call.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index ff4c253..574f718 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -5582,6 +5582,28 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTGPRBL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTGPRHL,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTHI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTGPRWL,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTSI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTGPRDL,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTDI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTVPRBL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTVPRHL,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTL, P10_BUILTIN_VINSERTVPRWL,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTQI },
+
{ P10_BUILTIN_VEC_EXTRACTH, P10_BUILTIN_VEXTRACTBR,
RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V16QI,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI },
@@ -5595,6 +5617,28 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTGPRBR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTGPRHR,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTHI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTGPRWR,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTSI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTGPRDR,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTDI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_UINTSI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTVPRBR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTVPRHR,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_UINTQI },
+ { P10_BUILTIN_VEC_INSERTH, P10_BUILTIN_VINSERTVPRWR,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_UINTQI },
+
{ P10_BUILTIN_VEC_VSTRIL, P10_BUILTIN_VSTRIBL,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
{ P10_BUILTIN_VEC_VSTRIL, P10_BUILTIN_VSTRIBL,
@@ -13861,6 +13905,13 @@ builtin_function_type (machine_mode mode_ret, machine_mode mode_arg0,
case P10_BUILTIN_VEXTRACTHR:
case P10_BUILTIN_VEXTRACTWR:
case P10_BUILTIN_VEXTRACTDR:
+ case P10_BUILTIN_VINSERTGPRBL:
+ case P10_BUILTIN_VINSERTGPRHL:
+ case P10_BUILTIN_VINSERTGPRWL:
+ case P10_BUILTIN_VINSERTGPRDL:
+ case P10_BUILTIN_VINSERTVPRBL:
+ case P10_BUILTIN_VINSERTVPRHL:
+ case P10_BUILTIN_VINSERTVPRWL:
h.uns_p[0] = 1;
h.uns_p[1] = 1;
h.uns_p[2] = 1;