diff options
author | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2020-05-11 16:16:15 -0500 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.ibm.com> | 2020-05-11 16:16:15 -0500 |
commit | 2202299c2aa69385ca5e7574914dabc84fb6a40a (patch) | |
tree | 7cccdff490d7f9d5c84abb870ceb17768020f0ee /gcc/config | |
parent | 25bf7d32c31bb45993a9c81dd01043e77c4a44ed (diff) |
rs6000: Add pdepd and pextd
Add scalar instructions for parallel bit deposit and extract, with
built-in function support.
[gcc]
2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-builtin.def (__builtin_pdepd): New built-in
function.
(__builtin_pextd): Likewise.
* config/rs6000/rs6000.md (UNSPEC_PDEPD): New constant.
(UNSPEC_PEXTD): Likewise.
(pdepd): New insn.
(pextd): Likewise.
* doc/extend.texi (Basic PowerPC Built-in Functions Available for
a Future Architecture): Add descriptions of __builtin_pdepd and
__builtin_pextd functions.
[gcc/testsuite]
2020-05-11 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/pdep-0.c: New.
* gcc.target/powerpc/pdep-1.c: New.
* gcc.target/powerpc/pextd-0.c: New.
* gcc.target/powerpc/pextd-1.c: New.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/rs6000/rs6000-builtin.def | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 39e7da5fa50..4b06323a07f 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -2577,6 +2577,8 @@ BU_P9_OVERLOAD_2 (CMPEQB, "byte_in_set") BU_FUTURE_MISC_2 (CFUGED, "cfuged", CONST, cfuged) BU_FUTURE_MISC_2 (CNTLZDM, "cntlzdm", CONST, cntlzdm) BU_FUTURE_MISC_2 (CNTTZDM, "cnttzdm", CONST, cnttzdm) +BU_FUTURE_MISC_2 (PDEPD, "pdepd", CONST, pdepd) +BU_FUTURE_MISC_2 (PEXTD, "pextd", CONST, pextd) /* Future architecture vector built-ins. */ BU_FUTURE_V_2 (VCLRLB, "vclrlb", CONST, vclrlb) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 6c9bae934d1..4fcd6a94022 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -151,6 +151,8 @@ UNSPEC_CFUGED UNSPEC_CNTLZDM UNSPEC_CNTTZDM + UNSPEC_PDEPD + UNSPEC_PEXTD ]) ;; @@ -2483,6 +2485,24 @@ "cnttzdm %0,%1,%2" [(set_attr "type" "integer")]) +(define_insn "pdepd" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "r") + (match_operand:DI 2 "gpc_reg_operand" "r")] + UNSPEC_PDEPD))] + "TARGET_FUTURE && TARGET_POWERPC64" + "pdepd %0,%1,%2" + [(set_attr "type" "integer")]) + +(define_insn "pextd" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "r") + (match_operand:DI 2 "gpc_reg_operand" "r")] + UNSPEC_PEXTD))] + "TARGET_FUTURE && TARGET_POWERPC64" + "pextd %0,%1,%2" + [(set_attr "type" "integer")]) + (define_insn "cmpb<mode>3" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r") |