rs6000: Add xxeval and vec_ternarylogic
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Mon, 11 May 2020 21:25:03 +0000 (16:25 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Mon, 11 May 2020 21:25:03 +0000 (16:25 -0500)
commit840ac85ced0695fefecee433327e4298b4adb20a
tree2ead3d269a344ed5865c2b409fdf5830c530eab1
parent2202299c2aa69385ca5e7574914dabc84fb6a40a
rs6000: Add xxeval and vec_ternarylogic

Add the xxeval insn and access it via the vec_ternarylogic built-in
function.  As part of this, add support to the built-in function
infrastructure for functions that take four arguments.

[gcc]

2020-05-11  Kelvin Nilsen  <wschmidt@linux.ibm.com>

* config/rs6000/altivec.h (vec_ternarylogic): New #define.
* config/rs6000/altivec.md (UNSPEC_XXEVAL): New constant.
(xxeval): New insn.
* config/rs6000/predicates.md (u8bit_cint_operand): New predicate.
* config/rs6000/rs6000-builtin.def: Add handling of new macro
RS6000_BUILTIN_4.
(BU_FUTURE_V_4): New macro. Use it.
(BU_FUTURE_OVERLOAD_4): Likewise.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Add
handling for quaternary built-in functions.
(altivec_resolve_overloaded_builtin): Add special-case handling
for __builtin_vec_xxeval.
* config/rs6000/rs6000-call.c: Add handling of new macro
RS6000_BUILTIN_4 in initialization of rs6000_builtin_info,
bdesc0_arg, bdesc1_arg, bdesc2_arg, bdesc_3arg,
bdesc_altivec_preds, bdesc_abs, and bdesc_htm arrays.
(altivec_overloaded_builtins): Add definitions for
FUTURE_BUILTIN_VEC_XXEVAL.
(bdesc_4arg): New array.
(htm_expand_builtin): Add handling for quaternary built-in
functions.
(rs6000_expand_quaternop_builtin): New function.
(rs6000_expand_builtin): Add handling for quaternary built-in
functions.
(rs6000_init_builtins): Initialize builtin_mode_to_type entries
for unsigned QImode and unsigned HImode.
(builtin_quaternary_function_type): New function.
(rs6000_common_init_builtins): Add handling of quaternary
operations.
* config/rs6000/rs6000.h (RS6000_BTC_QUATERNARY): New defined
constant.
(RS6000_BTC_PREDICATE): Change value of constant.
(RS6000_BTC_ABS): Likewise.
(rs6000_builtins): Add support for new macro RS6000_BUILTIN_4.
* doc/extend.texi (PowerPC AltiVec Built-In Functions Available
for a Future Architecture): Add description of vec_ternarylogic
built-in function.

[gcc/testsuite]

2020-05-11  Kelvin Nilsen  <wschmidt@linux.ibm.com>

* gcc.target/powerpc/vec-ternarylogic-0.c: New.
* gcc.target/powerpc/vec-ternarylogic-1.c: New.
* gcc.target/powerpc/vec-ternarylogic-10.c: New.
* gcc.target/powerpc/vec-ternarylogic-2.c: New.
* gcc.target/powerpc/vec-ternarylogic-3.c: New.
* gcc.target/powerpc/vec-ternarylogic-4.c: New.
* gcc.target/powerpc/vec-ternarylogic-5.c: New.
* gcc.target/powerpc/vec-ternarylogic-6.c: New.
* gcc.target/powerpc/vec-ternarylogic-7.c: New.
* gcc.target/powerpc/vec-ternarylogic-8.c: New.
* gcc.target/powerpc/vec-ternarylogic-9.c: New.
21 files changed:
gcc/ChangeLog
gcc/config/rs6000/altivec.h
gcc/config/rs6000/altivec.md
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000-call.c
gcc/config/rs6000/rs6000.h
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-ternarylogic-9.c [new file with mode: 0644]