RS6000, add VSX mask manipulation support
authorCarl Love <cel@us.ibm.com>
Thu, 9 Jan 2020 19:37:18 +0000 (13:37 -0600)
committerCarl Love <cel@us.ibm.com>
Fri, 10 Jul 2020 15:18:26 +0000 (10:18 -0500)
commit02ef74bad652522a2e424f3ffafff2452c4da105
treea7184ef4ad23f840fa4b5cfe077a78f6b8641ee8
parent6f5b4b64d25a36f085ab90efc3d54c025a7fff49
RS6000, add VSX mask manipulation support

gcc/ChangeLog

2020-07-09  Carl Love  <cel@us.ibm.com>

* config/rs6000/vsx.md  (VSX_MM): New define_mode_iterator.
(VSX_MM4): New define_mode_iterator.
(vec_mtvsrbmi): New define_insn.
(vec_mtvsr_<mode>): New define_insn.
(vec_cntmb_<mode>): New define_insn.
(vec_extract_<mode>): New define_insn.
(vec_expand_<mode>): New define_insn.
(define_c_enum unspec): Add entries UNSPEC_MTVSBM, UNSPEC_VCNTMB,
UNSPEC_VEXTRACT, UNSPEC_VEXPAND.
* config/rs6000/altivec.h ( vec_genbm, vec_genhm, vec_genwm,
vec_gendm, vec_genqm, vec_cntm, vec_expandm, vec_extractm): Add
defines.
* config/rs6000/rs6000-builtin.def: Add defines BU_P10_2, BU_P10_1.
(BU_P10_1): Add definitions for mtvsrbm, mtvsrhm, mtvsrwm,
mtvsrdm, mtvsrqm, vexpandmb, vexpandmh, vexpandmw, vexpandmd,
vexpandmq, vextractmb, vextractmh, vextractmw, vextractmd, vextractmq.
(BU_P10_2): Add definitions for cntmbb, cntmbh, cntmbw, cntmbd.
(BU_P10_OVERLOAD_1): Add definitions for mtvsrbm, mtvsrhm,
mtvsrwm, mtvsrdm, mtvsrqm, vexpandm, vextractm.
(BU_P10_OVERLOAD_2): Add defition for cntm.
* config/rs6000/rs6000-call.c (rs6000_expand_binop_builtin): Add
checks for CODE_FOR_vec_cntmbb_v16qi, CODE_FOR_vec_cntmb_v8hi,
CODE_FOR_vec_cntmb_v4si, CODE_FOR_vec_cntmb_v2di.
(altivec_overloaded_builtins): Add overloaded argument entries for
P10_BUILTIN_VEC_MTVSRBM, P10_BUILTIN_VEC_MTVSRHM,
P10_BUILTIN_VEC_MTVSRWM, P10_BUILTIN_VEC_MTVSRDM,
P10_BUILTIN_VEC_MTVSRQM, P10_BUILTIN_VEC_VCNTMBB,
P10_BUILTIN_VCNTMBB, P10_BUILTIN_VCNTMBH,
P10_BUILTIN_VCNTMBW, P10_BUILTIN_VCNTMBD,
P10_BUILTIN_VEXPANDMB, P10_BUILTIN_VEXPANDMH,
P10_BUILTIN_VEXPANDMW, P10_BUILTIN_VEXPANDMD,
P10_BUILTIN_VEXPANDMQ, P10_BUILTIN_VEXTRACTMB,
P10_BUILTIN_VEXTRACTMH, P10_BUILTIN_VEXTRACTMW,
P10_BUILTIN_VEXTRACTMD, P10_BUILTIN_VEXTRACTMQ.
(builtin_function_type): Add case entries for P10_BUILTIN_MTVSRBM,
P10_BUILTIN_MTVSRHM, P10_BUILTIN_MTVSRWM, P10_BUILTIN_MTVSRDM,
P10_BUILTIN_MTVSRQM, P10_BUILTIN_VCNTMBB, P10_BUILTIN_VCNTMBH,
P10_BUILTIN_VCNTMBW, P10_BUILTIN_VCNTMBD,
P10_BUILTIN_VEXPANDMB, P10_BUILTIN_VEXPANDMH,
P10_BUILTIN_VEXPANDMW, P10_BUILTIN_VEXPANDMD,
P10_BUILTIN_VEXPANDMQ.
* config/rs6000/rs6000-builtin.def (altivec_overloaded_builtins): Add
entries for MTVSRBM, MTVSRHM, MTVSRWM, MTVSRDM, MTVSRQM, VCNTM,
VEXPANDM, VEXTRACTM.

gcc/testsuite/ChangeLog

2020-07-09  Carl Love  <cel@us.ibm.com>
* gcc.target/powerpc/vsx_mask-count-runnable.c: New test case.
* gcc.target/powerpc/vsx_mask-expand-runnable.c: New test case.
* gcc.target/powerpc/vsx_mask-extract-runnable.c: New test case.
* gcc.target/powerpc/vsx_mask-move-runnable.c: New test case.
gcc/config/rs6000/altivec.h
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000-call.c
gcc/config/rs6000/vsx.md
gcc/testsuite/gcc.target/powerpc/vsx_mask-count-runnable.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx_mask-expand-runnable.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx_mask-extract-runnable.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx_mask-move-runnable.c [new file with mode: 0644]