From 5a3a6a5eaed91e241fe879af65162507eafd6e5f Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Thu, 30 Jun 2016 15:59:44 +0000 Subject: [PATCH] altivec.md (darn_32): Change the condition to TARGET_P9_MISC instead of TARGET_MODULO. gcc/ChangeLog: 2016-06-30 Kelvin Nilsen * config/rs6000/altivec.md (darn_32): Change the condition to TARGET_P9_MISC instead of TARGET_MODULO. (darn_raw): Replace TARGET_MODULO with TARGET_P9_MISC in the condition expression. (darn): Replace TARGET_MODULO with TARGET_P9_MISC in the condition expression. * config/rs6000/dfp.md (UNSPEC_DTSTSFI): New unspec constant. (DFP_TEST): New code iterator. (dfptstsfi__mode>): New define_expand. (*dfp_sgnfcnc_): New define_insn. * config/rs6000/rs6000-builtin.def (BU_P9_MISC_0): Move this macro definition next to BU_P9_MISC_1 definition and change the MASK value to RS6000_BTM_P9_MISC. (BU_P9_MISC_1): Change the MASK value to RS6000_BTM_P9_MISC. (BU_P9_64BIT_MISC_0): Likewise. (BU_P9_DFP_MISC_0): New macro definition. (BU_P9_DFP_MISC_1): New macro definition. (BU_P9_DFP_MISC_2): New macro definition. (BU_P9_DFP_OVERLOAD_1): New macro definition. (BU_P9_DFP_OVERLOAD_2): New macro definition. (BU_P9_DFP_OVERLOAD_3): New macro definition. (TSTSFI_LT_DD): New BU_P9_DFP_MISC_2. (TSTSFI_LT_TD): Likewise. (TSTSFI_EQ_DD): Likewise. (TSTSFI_EQ_TD): Likewise. (TSTSFI_GT_DD): Likewise. (TSTSFI_GT_TD): Likewise. (TSTSFI_OV_DD): Likewise. (TSTSFI_OV_TD): Likewise. (TSTSFI_LT): New BU_P9_DFP_OVERLOAD_2. (TSTSFI_LT_DD): Likewise. (TSTSFI_LT_TD): Likewise. (TSTSFI_EQ): Likewise. (TSTSFI_EQ_DD): Likewise. (TSTSFI_EQ_TD): Likewise. (TSTSFI_GT): Likewise. (TSTSFI_GT_DD): Likewise. (TSTSFI_GT_TD): Likewise. (TSTSFI_OV): Likewise. (TSTSFI_OV_DD): Likewise. (TSTSFI_OV_TD): Likewise. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add overloaded test significance functions. * config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add OPTION_MASK_P9_MISC into the representation of this mask. (POWERPC_MASKS): Add OPTION_MASK_P9_MISC into the representation of this mask. * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Set the RS6000_BTM_P9_MISC flag in the return value if TARGET_P9_MISC is non-zero. (rs6000_expand_binop_builtin): Enforce that argument 0 of the exp argument is a 6-bit unsigned literal value if the icode argument represents a DFP test significance built-in call. (rs6000_invalid_builtin): Add support for the RS6000_BTM_P9_MISC flag used independently and in combination with the RS6000_BTM_64BIT flag. (rs6000_opt_masks): Add entry for power9-misc command-line option. (rs6000_builtin_mask_names): Add entry for power9-misc command-line option. * config/rs6000/rs6000.h: Redefine TARGET_P9_MISC as 0 if HAVE_AS_POWER9 is not a defined macro. Define MASK_P9_MISC and RS6000_BTM_P9_MISC macros. * config/rs6000/rs6000.opt: Add support for the -mpower9-misc option and change the description of the -mpower9-vector option to enable only vector instructions, removing its erroneously claimed support for scalar instructions. * doc/extend.texi (PowerPC AltiVec Built-in Functions): Document the ISA 3.0 digital floating point test significance built-in functions. gcc/testsuite/ChangeLog: 2016-06-30 Kelvin Nilsen * gcc.target/powerpc/dfp/dfp.exp: New dejagnu test script. * gcc.target/powerpc/dfp/dtstsfi-0.c: New test. * gcc.target/powerpc/dfp/dtstsfi-1.c: New test. * gcc.target/powerpc/dfp/dtstsfi-10.c: New test. * gcc.target/powerpc/dfp/dtstsfi-11.c: New test. * gcc.target/powerpc/dfp/dtstsfi-12.c: New test. * gcc.target/powerpc/dfp/dtstsfi-13.c: New test. * gcc.target/powerpc/dfp/dtstsfi-14.c: New test. * gcc.target/powerpc/dfp/dtstsfi-15.c: New test. * gcc.target/powerpc/dfp/dtstsfi-16.c: New test. * gcc.target/powerpc/dfp/dtstsfi-17.c: New test. * gcc.target/powerpc/dfp/dtstsfi-18.c: New test. * gcc.target/powerpc/dfp/dtstsfi-19.c: New test. * gcc.target/powerpc/dfp/dtstsfi-2.c: New test. * gcc.target/powerpc/dfp/dtstsfi-20.c: New test. * gcc.target/powerpc/dfp/dtstsfi-21.c: New test. * gcc.target/powerpc/dfp/dtstsfi-22.c: New test. * gcc.target/powerpc/dfp/dtstsfi-23.c: New test. * gcc.target/powerpc/dfp/dtstsfi-24.c: New test. * gcc.target/powerpc/dfp/dtstsfi-25.c: New test. * gcc.target/powerpc/dfp/dtstsfi-26.c: New test. * gcc.target/powerpc/dfp/dtstsfi-27.c: New test. * gcc.target/powerpc/dfp/dtstsfi-28.c: New test. * gcc.target/powerpc/dfp/dtstsfi-29.c: New test. * gcc.target/powerpc/dfp/dtstsfi-3.c: New test. * gcc.target/powerpc/dfp/dtstsfi-30.c: New test. * gcc.target/powerpc/dfp/dtstsfi-31.c: New test. * gcc.target/powerpc/dfp/dtstsfi-32.c: New test. * gcc.target/powerpc/dfp/dtstsfi-33.c: New test. * gcc.target/powerpc/dfp/dtstsfi-34.c: New test. * gcc.target/powerpc/dfp/dtstsfi-35.c: New test. * gcc.target/powerpc/dfp/dtstsfi-36.c: New test. * gcc.target/powerpc/dfp/dtstsfi-37.c: New test. * gcc.target/powerpc/dfp/dtstsfi-38.c: New test. * gcc.target/powerpc/dfp/dtstsfi-39.c: New test. * gcc.target/powerpc/dfp/dtstsfi-4.c: New test. * gcc.target/powerpc/dfp/dtstsfi-40.c: New test. * gcc.target/powerpc/dfp/dtstsfi-41.c: New test. * gcc.target/powerpc/dfp/dtstsfi-42.c: New test. * gcc.target/powerpc/dfp/dtstsfi-43.c: New test. * gcc.target/powerpc/dfp/dtstsfi-44.c: New test. * gcc.target/powerpc/dfp/dtstsfi-45.c: New test. * gcc.target/powerpc/dfp/dtstsfi-46.c: New test. * gcc.target/powerpc/dfp/dtstsfi-47.c: New test. * gcc.target/powerpc/dfp/dtstsfi-48.c: New test. * gcc.target/powerpc/dfp/dtstsfi-49.c: New test. * gcc.target/powerpc/dfp/dtstsfi-5.c: New test. * gcc.target/powerpc/dfp/dtstsfi-50.c: New test. * gcc.target/powerpc/dfp/dtstsfi-51.c: New test. * gcc.target/powerpc/dfp/dtstsfi-52.c: New test. * gcc.target/powerpc/dfp/dtstsfi-53.c: New test. * gcc.target/powerpc/dfp/dtstsfi-54.c: New test. * gcc.target/powerpc/dfp/dtstsfi-55.c: New test. * gcc.target/powerpc/dfp/dtstsfi-56.c: New test. * gcc.target/powerpc/dfp/dtstsfi-57.c: New test. * gcc.target/powerpc/dfp/dtstsfi-58.c: New test. * gcc.target/powerpc/dfp/dtstsfi-59.c: New test. * gcc.target/powerpc/dfp/dtstsfi-6.c: New test. * gcc.target/powerpc/dfp/dtstsfi-60.c: New test. * gcc.target/powerpc/dfp/dtstsfi-61.c: New test. * gcc.target/powerpc/dfp/dtstsfi-62.c: New test. * gcc.target/powerpc/dfp/dtstsfi-63.c: New test. * gcc.target/powerpc/dfp/dtstsfi-64.c: New test. * gcc.target/powerpc/dfp/dtstsfi-65.c: New test. * gcc.target/powerpc/dfp/dtstsfi-66.c: New test. * gcc.target/powerpc/dfp/dtstsfi-67.c: New test. * gcc.target/powerpc/dfp/dtstsfi-68.c: New test. * gcc.target/powerpc/dfp/dtstsfi-69.c: New test. * gcc.target/powerpc/dfp/dtstsfi-7.c: New test. * gcc.target/powerpc/dfp/dtstsfi-70.c: New test. * gcc.target/powerpc/dfp/dtstsfi-71.c: New test. * gcc.target/powerpc/dfp/dtstsfi-72.c: New test. * gcc.target/powerpc/dfp/dtstsfi-73.c: New test. * gcc.target/powerpc/dfp/dtstsfi-74.c: New test. * gcc.target/powerpc/dfp/dtstsfi-75.c: New test. * gcc.target/powerpc/dfp/dtstsfi-76.c: New test. * gcc.target/powerpc/dfp/dtstsfi-77.c: New test. * gcc.target/powerpc/dfp/dtstsfi-78.c: New test. * gcc.target/powerpc/dfp/dtstsfi-79.c: New test. * gcc.target/powerpc/dfp/dtstsfi-8.c: New test. * gcc.target/powerpc/dfp/dtstsfi-9.c: New test. From-SVN: r237885 --- gcc/ChangeLog | 72 ++++++++++++++ gcc/config/rs6000/altivec.md | 6 +- gcc/config/rs6000/dfp.md | 39 ++++++++ gcc/config/rs6000/rs6000-builtin.def | 94 +++++++++++++++++-- gcc/config/rs6000/rs6000-c.c | 40 ++++++++ gcc/config/rs6000/rs6000-cpus.def | 2 + gcc/config/rs6000/rs6000.c | 27 ++++++ gcc/config/rs6000/rs6000.h | 5 + gcc/config/rs6000/rs6000.opt | 6 +- gcc/doc/extend.texi | 55 ++++++++++- gcc/testsuite/ChangeLog | 84 +++++++++++++++++ gcc/testsuite/gcc.target/powerpc/dfp/dfp.exp | 39 ++++++++ .../gcc.target/powerpc/dfp/dtstsfi-0.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-1.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-10.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-11.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-12.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-13.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-14.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-15.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-16.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-17.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-18.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-19.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-2.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-20.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-21.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-22.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-23.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-24.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-25.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-26.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-27.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-28.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-29.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-3.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-30.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-31.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-32.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-33.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-34.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-35.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-36.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-37.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-38.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-39.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-4.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-40.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-41.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-42.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-43.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-44.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-45.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-46.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-47.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-48.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-49.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-5.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-50.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-51.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-52.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-53.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-54.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-55.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-56.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-57.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-58.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-59.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-6.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-60.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-61.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-62.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-63.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-64.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-65.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-66.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-67.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-68.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-69.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-7.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-70.c | 17 ++++ .../gcc.target/powerpc/dfp/dtstsfi-71.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-72.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-73.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-74.c | 15 +++ .../gcc.target/powerpc/dfp/dtstsfi-75.c | 18 ++++ .../gcc.target/powerpc/dfp/dtstsfi-76.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-77.c | 16 ++++ .../gcc.target/powerpc/dfp/dtstsfi-78.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-79.c | 14 +++ .../gcc.target/powerpc/dfp/dtstsfi-8.c | 20 ++++ .../gcc.target/powerpc/dfp/dtstsfi-9.c | 14 +++ 92 files changed, 1782 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dfp.exp create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-0.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-10.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-11.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-12.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-13.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-14.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-15.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-16.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-17.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-18.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-19.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-2.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-20.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-21.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-22.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-23.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-24.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-25.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-26.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-27.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-28.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-29.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-3.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-30.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-31.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-32.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-33.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-34.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-35.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-36.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-37.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-38.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-39.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-4.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-40.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-41.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-42.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-43.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-44.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-45.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-46.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-47.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-48.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-49.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-5.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-50.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-51.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-52.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-53.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-54.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-55.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-56.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-57.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-58.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-59.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-6.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-60.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-61.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-62.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-63.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-64.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-65.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-66.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-67.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-68.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-69.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-7.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-70.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-71.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-72.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-73.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-74.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-75.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-76.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-77.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-78.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-79.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-8.c create mode 100644 gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-9.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88cab9847da..2b27fabe422 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,75 @@ +2016-06-30 Kelvin Nilsen + + * config/rs6000/altivec.md (darn_32): Change the condition to + TARGET_P9_MISC instead of TARGET_MODULO. + (darn_raw): Replace TARGET_MODULO with TARGET_P9_MISC in the + condition expression. + (darn): Replace TARGET_MODULO with TARGET_P9_MISC in the + condition expression. + * config/rs6000/dfp.md (UNSPEC_DTSTSFI): New unspec constant. + (DFP_TEST): New code iterator. + (dfptstsfi__mode>): New define_expand. + (*dfp_sgnfcnc_): New define_insn. + * config/rs6000/rs6000-builtin.def (BU_P9_MISC_0): Move this macro + definition next to BU_P9_MISC_1 definition and change the MASK + value to RS6000_BTM_P9_MISC. + (BU_P9_MISC_1): Change the MASK value to RS6000_BTM_P9_MISC. + (BU_P9_64BIT_MISC_0): Likewise. + (BU_P9_DFP_MISC_0): New macro definition. + (BU_P9_DFP_MISC_1): New macro definition. + (BU_P9_DFP_MISC_2): New macro definition. + (BU_P9_DFP_OVERLOAD_1): New macro definition. + (BU_P9_DFP_OVERLOAD_2): New macro definition. + (BU_P9_DFP_OVERLOAD_3): New macro definition. + (TSTSFI_LT_DD): New BU_P9_DFP_MISC_2. + (TSTSFI_LT_TD): Likewise. + (TSTSFI_EQ_DD): Likewise. + (TSTSFI_EQ_TD): Likewise. + (TSTSFI_GT_DD): Likewise. + (TSTSFI_GT_TD): Likewise. + (TSTSFI_OV_DD): Likewise. + (TSTSFI_OV_TD): Likewise. + (TSTSFI_LT): New BU_P9_DFP_OVERLOAD_2. + (TSTSFI_LT_DD): Likewise. + (TSTSFI_LT_TD): Likewise. + (TSTSFI_EQ): Likewise. + (TSTSFI_EQ_DD): Likewise. + (TSTSFI_EQ_TD): Likewise. + (TSTSFI_GT): Likewise. + (TSTSFI_GT_DD): Likewise. + (TSTSFI_GT_TD): Likewise. + (TSTSFI_OV): Likewise. + (TSTSFI_OV_DD): Likewise. + (TSTSFI_OV_TD): Likewise. + * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add + overloaded test significance functions. + * config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add + OPTION_MASK_P9_MISC into the representation of this mask. + (POWERPC_MASKS): Add OPTION_MASK_P9_MISC into the representation + of this mask. + * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Set the + RS6000_BTM_P9_MISC flag in the return value if TARGET_P9_MISC is + non-zero. + (rs6000_expand_binop_builtin): Enforce that argument 0 of the exp + argument is a 6-bit unsigned literal value if the icode argument + represents a DFP test significance built-in call. + (rs6000_invalid_builtin): Add support for the RS6000_BTM_P9_MISC + flag used independently and in combination with the + RS6000_BTM_64BIT flag. + (rs6000_opt_masks): Add entry for power9-misc command-line option. + (rs6000_builtin_mask_names): Add entry for power9-misc + command-line option. + * config/rs6000/rs6000.h: Redefine TARGET_P9_MISC as 0 if + HAVE_AS_POWER9 is not a defined macro. Define MASK_P9_MISC and + RS6000_BTM_P9_MISC macros. + * config/rs6000/rs6000.opt: Add support for the -mpower9-misc + option and change the description of the -mpower9-vector option to + enable only vector instructions, removing its erroneously claimed + support for scalar instructions. + * doc/extend.texi (PowerPC AltiVec Built-in Functions): Document + the ISA 3.0 digital floating point test significance built-in + functions. + 2016-06-30 Wilco Dijkstra * config/aarch64/aarch64.c (cortexa35_tunings): diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index fcc00b515bb..b45b86f4e7b 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -3680,21 +3680,21 @@ (define_insn "darn_32" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(const_int 0)] UNSPEC_DARN_32))] - "TARGET_MODULO" + "TARGET_P9_MISC" "darn %0,0" [(set_attr "type" "integer")]) (define_insn "darn_raw" [(set (match_operand:DI 0 "register_operand" "=r") (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))] - "TARGET_MODULO && TARGET_64BIT" + "TARGET_P9_MISC && TARGET_64BIT" "darn %0,2" [(set_attr "type" "integer")]) (define_insn "darn" [(set (match_operand:DI 0 "register_operand" "=r") (unspec:DI [(const_int 0)] UNSPEC_DARN))] - "TARGET_MODULO && TARGET_64BIT" + "TARGET_P9_MISC && TARGET_64BIT" "darn %0,1" [(set_attr "type" "integer")]) diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md index e3a29878cea..e52a011e008 100644 --- a/gcc/config/rs6000/dfp.md +++ b/gcc/config/rs6000/dfp.md @@ -319,8 +319,11 @@ UNSPEC_DXEX UNSPEC_DIEX UNSPEC_DSCLI + UNSPEC_DTSTSFI UNSPEC_DSCRI]) +(define_code_iterator DFP_TEST [eq lt gt unordered]) + (define_mode_iterator D64_D128 [DD TD]) (define_mode_attr dfp_suffix [(DD "") @@ -361,6 +364,42 @@ "diex %0,%1,%2" [(set_attr "type" "dfp")]) +(define_expand "dfptstsfi__" + [(set (match_dup 3) + (compare:CCFP + (unspec:D64_D128 + [(match_operand:SI 1 "const_int_operand" "n") + (match_operand:D64_D128 2 "gpc_reg_operand" "d")] + UNSPEC_DTSTSFI) + (match_dup 4))) + (set (match_operand:SI 0 "register_operand" "") + (DFP_TEST:SI (match_dup 3) + (const_int 0))) + ] + "TARGET_P9_MISC" +{ + operands[3] = gen_reg_rtx (CCFPmode); + operands[4] = const0_rtx; +}) + +(define_insn "*dfp_sgnfcnc_" + [(set (match_operand:CCFP 0 "" "=y") + (compare:CCFP + (unspec:D64_D128 [(match_operand:SI 1 "const_int_operand" "n") + (match_operand:D64_D128 2 "gpc_reg_operand" "d")] + UNSPEC_DTSTSFI) + (match_operand:SI 3 "zero_constant" "j")))] + "TARGET_P9_MISC" +{ + /* If immediate operand is greater than 63, it will behave as if + the value had been 63. The code generator does not support + immediate operand values greater than 63. */ + if (!(IN_RANGE (INTVAL (operands[1]), 0, 63))) + operands[1] = GEN_INT (63); + return "dtstsfi %0,%1,%2"; +} + [(set_attr "type" "fp")]) + (define_insn "dfp_dscli_" [(set (match_operand:D64_D128 0 "gpc_reg_operand" "=d") (unspec:D64_D128 [(match_operand:D64_D128 1 "gpc_reg_operand" "d") diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 533f77120d3..fef3fd4b496 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -672,10 +672,18 @@ /* Miscellaneous builtins for instructions added in ISA 3.0. These instructions don't require either the DFP or VSX options, just the basic ISA 3.0 enablement since they operate on general purpose registers. */ +#define BU_P9_MISC_0(ENUM, NAME, ATTR, ICODE) \ + RS6000_BUILTIN_0 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ + "__builtin_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_ ## ATTR /* ATTR */ \ + | RS6000_BTC_SPECIAL), \ + CODE_FOR_ ## ICODE) /* ICODE */ + #define BU_P9_MISC_1(ENUM, NAME, ATTR, ICODE) \ RS6000_BUILTIN_1 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ "__builtin_" NAME, /* NAME */ \ - RS6000_BTM_MODULO, /* MASK */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ (RS6000_BTC_ ## ATTR /* ATTR */ \ | RS6000_BTC_UNARY), \ CODE_FOR_ ## ICODE) /* ICODE */ @@ -687,23 +695,65 @@ #define BU_P9_64BIT_MISC_0(ENUM, NAME, ATTR, ICODE) \ RS6000_BUILTIN_0 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ "__builtin_" NAME, /* NAME */ \ - RS6000_BTM_MODULO \ + RS6000_BTM_P9_MISC \ | RS6000_BTM_64BIT, /* MASK */ \ (RS6000_BTC_ ## ATTR /* ATTR */ \ | RS6000_BTC_SPECIAL), \ CODE_FOR_ ## ICODE) /* ICODE */ -/* Miscellaneous builtins for instructions added in ISA 3.0. These - instructions don't require either the DFP or VSX options, just the basic - ISA 3.0 enablement since they operate on general purpose registers. */ -#define BU_P9_MISC_0(ENUM, NAME, ATTR, ICODE) \ +/* Miscellaneous builtins for decimal floating point instructions + added in ISA 3.0. These instructions don't require the VSX + options, just the basic ISA 3.0 enablement since they operate on + general purpose registers. */ +#define BU_P9_DFP_MISC_0(ENUM, NAME, ATTR, ICODE) \ RS6000_BUILTIN_0 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ "__builtin_" NAME, /* NAME */ \ - RS6000_BTM_MODULO, /* MASK */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ (RS6000_BTC_ ## ATTR /* ATTR */ \ | RS6000_BTC_SPECIAL), \ CODE_FOR_ ## ICODE) /* ICODE */ +#define BU_P9_DFP_MISC_1(ENUM, NAME, ATTR, ICODE) \ + RS6000_BUILTIN_1 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ + "__builtin_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_ ## ATTR /* ATTR */ \ + | RS6000_BTC_SPECIAL), \ + CODE_FOR_ ## ICODE) /* ICODE */ + +#define BU_P9_DFP_MISC_2(ENUM, NAME, ATTR, ICODE) \ + RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ + "__builtin_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_ ## ATTR /* ATTR */ \ + | RS6000_BTC_SPECIAL), \ + CODE_FOR_ ## ICODE) /* ICODE */ + +/* Decimal floating point overloaded functions added in ISA 3.0 */ +#define BU_P9_DFP_OVERLOAD_1(ENUM, NAME) \ + RS6000_BUILTIN_1 (P9_BUILTIN_DFP_ ## ENUM, /* ENUM */ \ + "__builtin_dfp_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_OVERLOADED /* ATTR */ \ + | RS6000_BTC_UNARY), \ + CODE_FOR_nothing) /* ICODE */ + +#define BU_P9_DFP_OVERLOAD_2(ENUM, NAME) \ + RS6000_BUILTIN_2 (P9_BUILTIN_DFP_ ## ENUM, /* ENUM */ \ + "__builtin_dfp_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_OVERLOADED /* ATTR */ \ + | RS6000_BTC_BINARY), \ + CODE_FOR_nothing) /* ICODE */ + +#define BU_P9_DFP_OVERLOAD_3(ENUM, NAME) \ + RS6000_BUILTIN_3 (P9_BUILTIN_DFP_ ## ENUM, /* ENUM */ \ + "__builtin_dfp_" NAME, /* NAME */ \ + RS6000_BTM_P9_MISC, /* MASK */ \ + (RS6000_BTC_OVERLOADED /* ATTR */ \ + | RS6000_BTC_TERNARY), \ + CODE_FOR_nothing) /* ICODE */ + /* ISA 3.0 (power9) vector convenience macros. */ /* For the instructions that are encoded as altivec instructions use __builtin_altivec_ as the builtin name. */ @@ -1810,6 +1860,36 @@ BU_LDBL128_2 (UNPACK_TF, "unpack_longdouble", CONST, unpacktf) BU_P7_MISC_2 (PACK_V1TI, "pack_vector_int128", CONST, packv1ti) BU_P7_MISC_2 (UNPACK_V1TI, "unpack_vector_int128", CONST, unpackv1ti) +/* 2 argument DFP (Decimal Floating Point) functions added in ISA 3.0. */ +BU_P9_DFP_MISC_2 (TSTSFI_LT_DD, "dtstsfi_lt_dd", CONST, dfptstsfi_lt_dd) +BU_P9_DFP_MISC_2 (TSTSFI_LT_TD, "dtstsfi_lt_td", CONST, dfptstsfi_lt_td) + +BU_P9_DFP_MISC_2 (TSTSFI_EQ_DD, "dtstsfi_eq_dd", CONST, dfptstsfi_eq_dd) +BU_P9_DFP_MISC_2 (TSTSFI_EQ_TD, "dtstsfi_eq_td", CONST, dfptstsfi_eq_td) + +BU_P9_DFP_MISC_2 (TSTSFI_GT_DD, "dtstsfi_gt_dd", CONST, dfptstsfi_gt_dd) +BU_P9_DFP_MISC_2 (TSTSFI_GT_TD, "dtstsfi_gt_td", CONST, dfptstsfi_gt_td) + +BU_P9_DFP_MISC_2 (TSTSFI_OV_DD, "dtstsfi_ov_dd", CONST, dfptstsfi_unordered_dd) +BU_P9_DFP_MISC_2 (TSTSFI_OV_TD, "dtstsfi_ov_td", CONST, dfptstsfi_unordered_td) + +/* 2 argument overloaded DFP functions added in ISA 3.0. */ +BU_P9_DFP_OVERLOAD_2 (TSTSFI_LT, "dtstsfi_lt") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_LT_DD, "dtstsfi_lt_dd") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_LT_TD, "dtstsfi_lt_td") + +BU_P9_DFP_OVERLOAD_2 (TSTSFI_EQ, "dtstsfi_eq") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_EQ_DD, "dtstsfi_eq_dd") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_EQ_TD, "dtstsfi_eq_td") + +BU_P9_DFP_OVERLOAD_2 (TSTSFI_GT, "dtstsfi_gt") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_GT_DD, "dtstsfi_gt_dd") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_GT_TD, "dtstsfi_gt_td") + +BU_P9_DFP_OVERLOAD_2 (TSTSFI_OV, "dtstsfi_ov") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_OV_DD, "dtstsfi_ov_dd") +BU_P9_DFP_OVERLOAD_2 (TSTSFI_OV_TD, "dtstsfi_ov_td") + /* 1 argument vector functions added in ISA 3.0 (power9). */ BU_P9V_AV_1 (VCTZB, "vctzb", CONST, ctzv16qi2) BU_P9V_AV_1 (VCTZH, "vctzh", CONST, ctzv8hi2) diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 79a7e88a5ee..4500668ed9f 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -4203,6 +4203,46 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = { { P8V_BUILTIN_VEC_VCLZD, P8V_BUILTIN_VCLZD, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0, 0 }, + { P9_BUILTIN_DFP_TSTSFI_LT, MISC_BUILTIN_TSTSFI_LT_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_LT, MISC_BUILTIN_TSTSFI_LT_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_LT_TD, MISC_BUILTIN_TSTSFI_LT_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_LT_DD, MISC_BUILTIN_TSTSFI_LT_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_EQ, MISC_BUILTIN_TSTSFI_EQ_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_EQ, MISC_BUILTIN_TSTSFI_EQ_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_EQ_TD, MISC_BUILTIN_TSTSFI_EQ_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_EQ_DD, MISC_BUILTIN_TSTSFI_EQ_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_GT, MISC_BUILTIN_TSTSFI_GT_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_GT, MISC_BUILTIN_TSTSFI_GT_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_GT_TD, MISC_BUILTIN_TSTSFI_GT_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_GT_DD, MISC_BUILTIN_TSTSFI_GT_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_OV, MISC_BUILTIN_TSTSFI_OV_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_OV, MISC_BUILTIN_TSTSFI_OV_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + + { P9_BUILTIN_DFP_TSTSFI_OV_TD, MISC_BUILTIN_TSTSFI_OV_TD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat128, 0 }, + { P9_BUILTIN_DFP_TSTSFI_OV_DD, MISC_BUILTIN_TSTSFI_OV_DD, + RS6000_BTI_INTSI, RS6000_BTI_UINTSI, RS6000_BTI_dfloat64, 0 }, + { P9V_BUILTIN_VEC_VCTZ, P9V_BUILTIN_VCTZB, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 }, { P9V_BUILTIN_VEC_VCTZ, P9V_BUILTIN_VCTZB, diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def index 8fbf1b94268..7c67b6f2c8e 100644 --- a/gcc/config/rs6000/rs6000-cpus.def +++ b/gcc/config/rs6000/rs6000-cpus.def @@ -69,6 +69,7 @@ | OPTION_MASK_P9_FUSION \ | OPTION_MASK_P9_DFORM_SCALAR \ | OPTION_MASK_P9_DFORM_VECTOR \ + | OPTION_MASK_P9_MISC \ | OPTION_MASK_P9_VECTOR) #define POWERPC_7400_MASK (OPTION_MASK_PPC_GFXOPT | OPTION_MASK_ALTIVEC) @@ -108,6 +109,7 @@ | OPTION_MASK_P9_DFORM_VECTOR \ | OPTION_MASK_P9_FUSION \ | OPTION_MASK_P9_MINMAX \ + | OPTION_MASK_P9_MISC \ | OPTION_MASK_P9_VECTOR \ | OPTION_MASK_POPCNTB \ | OPTION_MASK_POPCNTD \ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b6e4df05077..a34f28755dd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3680,6 +3680,7 @@ rs6000_builtin_mask_calculate (void) | ((rs6000_cpu == PROCESSOR_CELL) ? RS6000_BTM_CELL : 0) | ((TARGET_P8_VECTOR) ? RS6000_BTM_P8_VECTOR : 0) | ((TARGET_P9_VECTOR) ? RS6000_BTM_P9_VECTOR : 0) + | ((TARGET_P9_MISC) ? RS6000_BTM_P9_MISC : 0) | ((TARGET_MODULO) ? RS6000_BTM_MODULO : 0) | ((TARGET_64BIT) ? RS6000_BTM_64BIT : 0) | ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0) @@ -13380,6 +13381,24 @@ rs6000_expand_binop_builtin (enum insn_code icode, tree exp, rtx target) return const0_rtx; } } + else if (icode == CODE_FOR_dfptstsfi_eq_dd + || icode == CODE_FOR_dfptstsfi_lt_dd + || icode == CODE_FOR_dfptstsfi_gt_dd + || icode == CODE_FOR_dfptstsfi_unordered_dd + || icode == CODE_FOR_dfptstsfi_eq_td + || icode == CODE_FOR_dfptstsfi_lt_td + || icode == CODE_FOR_dfptstsfi_gt_td + || icode == CODE_FOR_dfptstsfi_unordered_td) + { + /* Only allow 6-bit unsigned literals. */ + STRIP_NOPS (arg0); + if (TREE_CODE (arg0) != INTEGER_CST + || !IN_RANGE (TREE_INT_CST_LOW (arg0), 0, 63)) + { + error ("argument 1 must be a 6-bit unsigned literal"); + return CONST0_RTX (tmode); + } + } if (target == 0 || GET_MODE (target) != tmode @@ -15486,6 +15505,12 @@ rs6000_invalid_builtin (enum rs6000_builtins fncode) error ("Builtin function %s requires the -mpower8-vector option", name); else if ((fnmask & RS6000_BTM_P9_VECTOR) != 0) error ("Builtin function %s requires the -mpower9-vector option", name); + else if ((fnmask & (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT)) + == (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT)) + error ("Builtin function %s requires the -mpower9-misc and" + " -m64 options", name); + else if ((fnmask & RS6000_BTM_P9_MISC) == RS6000_BTM_P9_MISC) + error ("Builtin function %s requires the -mpower9-misc option", name); else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128)) == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128)) error ("Builtin function %s requires the -mhard-float and" @@ -35825,6 +35850,7 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] = { "power9-dform-vector", OPTION_MASK_P9_DFORM_VECTOR, false, true }, { "power9-fusion", OPTION_MASK_P9_FUSION, false, true }, { "power9-minmax", OPTION_MASK_P9_MINMAX, false, true }, + { "power9-misc", OPTION_MASK_P9_MISC, false, true }, { "power9-vector", OPTION_MASK_P9_VECTOR, false, true }, { "powerpc-gfxopt", OPTION_MASK_PPC_GFXOPT, false, true }, { "powerpc-gpopt", OPTION_MASK_PPC_GPOPT, false, true }, @@ -35881,6 +35907,7 @@ static struct rs6000_opt_mask const rs6000_builtin_mask_names[] = { "cell", RS6000_BTM_CELL, false, false }, { "power8-vector", RS6000_BTM_P8_VECTOR, false, false }, { "power9-vector", RS6000_BTM_P9_VECTOR, false, false }, + { "power9-misc", RS6000_BTM_P9_MISC, false, false }, { "crypto", RS6000_BTM_CRYPTO, false, false }, { "htm", RS6000_BTM_HTM, false, false }, { "hard-dfp", RS6000_BTM_DFP, false, false }, diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index f835f439416..a6e80d7c897 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -314,12 +314,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #undef TARGET_P9_MINMAX #undef TARGET_P9_DFORM_SCALAR #undef TARGET_P9_DFORM_VECTOR +#undef TARGET_P9_MISC #define TARGET_FLOAT128_HW 0 #define TARGET_MODULO 0 #define TARGET_P9_VECTOR 0 #define TARGET_P9_MINMAX 0 #define TARGET_P9_DFORM_SCALAR 0 #define TARGET_P9_DFORM_VECTOR 0 +#define TARGET_P9_MISC 0 #endif /* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync. If @@ -648,6 +650,7 @@ extern int rs6000_vector_align[]; #define MASK_NO_UPDATE OPTION_MASK_NO_UPDATE #define MASK_P8_VECTOR OPTION_MASK_P8_VECTOR #define MASK_P9_VECTOR OPTION_MASK_P9_VECTOR +#define MASK_P9_MISC OPTION_MASK_P9_MISC #define MASK_POPCNTB OPTION_MASK_POPCNTB #define MASK_POPCNTD OPTION_MASK_POPCNTD #define MASK_PPC_GFXOPT OPTION_MASK_PPC_GFXOPT @@ -2698,6 +2701,7 @@ extern int frame_pointer_needed; #define RS6000_BTM_VSX MASK_VSX /* VSX (vector/scalar). */ #define RS6000_BTM_P8_VECTOR MASK_P8_VECTOR /* ISA 2.07 vector. */ #define RS6000_BTM_P9_VECTOR MASK_P9_VECTOR /* ISA 3.0 vector. */ +#define RS6000_BTM_P9_MISC MASK_P9_MISC /* ISA 3.0 misc. non-vector */ #define RS6000_BTM_CRYPTO MASK_CRYPTO /* crypto funcs. */ #define RS6000_BTM_HTM MASK_HTM /* hardware TM funcs. */ #define RS6000_BTM_SPE MASK_STRING /* E500 */ @@ -2718,6 +2722,7 @@ extern int frame_pointer_needed; | RS6000_BTM_VSX \ | RS6000_BTM_P8_VECTOR \ | RS6000_BTM_P9_VECTOR \ + | RS6000_BTM_P9_MISC \ | RS6000_BTM_MODULO \ | RS6000_BTM_CRYPTO \ | RS6000_BTM_FRE \ diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 4b9905fe767..4f67473c7d6 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -609,9 +609,13 @@ mpower9-fusion Target Report Mask(P9_FUSION) Var(rs6000_isa_flags) Fuse certain operations together for better performance on power9. +mpower9-misc +Target Undocumented Report Mask(P9_MISC) Var(rs6000_isa_flags) +Use/do not use certain scalar instructions added in ISA 3.0. + mpower9-vector Target Report Mask(P9_VECTOR) Var(rs6000_isa_flags) -Use/do not use vector and scalar instructions added in ISA 3.0. +Use/do not use vector instructions added in ISA 3.0. mpower9-dform-scalar Target Undocumented Mask(P9_DFORM_SCALAR) Var(rs6000_isa_flags) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b5f6e12f8be..5b9e6174cfa 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -14842,12 +14842,31 @@ The @code{__builtin_divde}, @code{__builtin_divdeo}, 64-bit environment support ISA 2.06 or later. The following built-in functions are available for the PowerPC family -of processors, starting with ISA 3.0 or later (@option{-mcpu=power9}) -or with @option{-mmodulo}: +of processors, starting with ISA 3.0 or later (@option{-mcpu=power9}): @smallexample long long __builtin_darn (void); long long __builtin_darn_raw (void); int __builtin_darn_32 (void); + +int __builtin_dfp_dtstsfi_lt (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_lt (unsigned int comparison, _Decimal128 value); +int __builtin_dfp_dtstsfi_lt_dd (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_lt_td (unsigned int comparison, _Decimal128 value); + +int __builtin_dfp_dtstsfi_gt (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_gt (unsigned int comparison, _Decimal128 value); +int __builtin_dfp_dtstsfi_gt_dd (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_gt_td (unsigned int comparison, _Decimal128 value); + +int __builtin_dfp_dtstsfi_eq (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_eq (unsigned int comparison, _Decimal128 value); +int __builtin_dfp_dtstsfi_eq_dd (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_eq_td (unsigned int comparison, _Decimal128 value); + +int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal128 value); +int __builtin_dfp_dtstsfi_ov_dd (unsigned int comparison, _Decimal64 value); +int __builtin_dfp_dtstsfi_ov_td (unsigned int comparison, _Decimal128 value); @end smallexample The @code{__builtin_darn} and @code{__builtin_darn_raw} @@ -14858,6 +14877,38 @@ random number. The @code{__builtin_darn_raw} function provides a 64-bit raw random number. The @code{__builtin_darn_32} function provides a 32-bit random number. +The @code{__builtin_dfp_dtstsfi_lt} function returns a non-zero value +if and only if the number of signficant digits of its @code{value} argument +is less than its @code{comparison} argument. The +@code{__builtin_dfp_dtstsfi_lt_dd} and +@code{__builtin_dfp_dtstsfi_lt_td} functions behave similarly, but +require that the type of the @code{value} argument be +@code{__Decimal64} and @code{__Decimal128} respectively. + +The @code{__builtin_dfp_dtstsfi_gt} function returns a non-zero value +if and only if the number of signficant digits of its @code{value} argument +is greater than its @code{comparison} argument. The +@code{__builtin_dfp_dtstsfi_gt_dd} and +@code{__builtin_dfp_dtstsfi_gt_td} functions behave similarly, but +require that the type of the @code{value} argument be +@code{__Decimal64} and @code{__Decimal128} respectively. + +The @code{__builtin_dfp_dtstsfi_eq} function returns a non-zero value +if and only if the number of signficant digits of its @code{value} argument +equals its @code{comparison} argument. The +@code{__builtin_dfp_dtstsfi_eq_dd} and +@code{__builtin_dfp_dtstsfi_eq_td} functions behave similarly, but +require that the type of the @code{value} argument be +@code{__Decimal64} and @code{__Decimal128} respectively. + +The @code{__builtin_dfp_dtstsfi_ov} function returns a non-zero value +if and only if its @code{value} argument has an undefined number of +significant digits, such as when @code{value} is an encoding of @code{NaN}. +The @code{__builtin_dfp_dtstsfi_ov_dd} and +@code{__builtin_dfp_dtstsfi_ov_td} functions behave similarly, but +require that the type of the @code{value} argument be +@code{__Decimal64} and @code{__Decimal128} respectively. + The following built-in functions are available for the PowerPC family of processors when hardware decimal floating point (@option{-mhard-dfp}) is available: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 216f61fd821..4081bd6846b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,87 @@ +2016-06-30 Kelvin Nilsen + + * gcc.target/powerpc/dfp/dfp.exp: New dejagnu test script. + * gcc.target/powerpc/dfp/dtstsfi-0.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-1.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-10.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-11.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-12.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-13.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-14.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-15.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-16.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-17.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-18.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-19.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-2.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-20.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-21.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-22.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-23.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-24.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-25.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-26.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-27.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-28.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-29.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-3.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-30.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-31.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-32.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-33.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-34.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-35.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-36.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-37.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-38.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-39.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-4.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-40.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-41.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-42.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-43.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-44.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-45.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-46.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-47.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-48.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-49.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-5.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-50.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-51.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-52.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-53.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-54.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-55.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-56.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-57.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-58.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-59.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-6.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-60.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-61.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-62.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-63.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-64.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-65.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-66.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-67.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-68.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-69.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-7.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-70.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-71.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-72.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-73.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-74.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-75.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-76.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-77.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-78.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-79.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-8.c: New test. + * gcc.target/powerpc/dfp/dtstsfi-9.c: New test. + 2016-06-30 Kyrylo Tkachov James Greenhalgh diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dfp.exp b/gcc/testsuite/gcc.target/powerpc/dfp/dfp.exp new file mode 100644 index 00000000000..081946f7fbf --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dfp.exp @@ -0,0 +1,39 @@ +# Copyright (C) 2014-2016 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Exit immediately if this isn't a PowerPC target. +if { ![istarget powerpc*-*-*] && ![istarget rs6000-*-*] } then { + return +} + +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Load support procs. +load_lib gcc-dg.exp +load_lib torture-options.exp + +# Initialize. +dg-init + +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c*]] "" $DEFAULT_CFLAGS + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-0.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-0.c new file mode 100644 index 00000000000..29859c55986 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-0.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-1.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-1.c new file mode 100644 index 00000000000..d634a2acd04 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_lt_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-10.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-10.c new file mode 100644 index 00000000000..a56f19ba391 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-10.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt_dd (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-11.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-11.c new file mode 100644 index 00000000000..523facea156 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-11.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt_dd (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_lt_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-12.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-12.c new file mode 100644 index 00000000000..e62e4bc7bbe --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-12.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt_dd (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-13.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-13.c new file mode 100644 index 00000000000..38bff163c02 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-13.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_lt_dd (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-14.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-14.c new file mode 100644 index 00000000000..57fc81ad742 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-14.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt_dd (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-15.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-15.c new file mode 100644 index 00000000000..990461f9c53 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-15.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt_td (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-16.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-16.c new file mode 100644 index 00000000000..dcd4a16635f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-16.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt_td (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_lt_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-17.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-17.c new file mode 100644 index 00000000000..5fbf5b5cc0c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-17.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt_td (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-18.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-18.c new file mode 100644 index 00000000000..675109552b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-18.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_lt_td (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-19.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-19.c new file mode 100644 index 00000000000..d24eb10f7a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-19.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt_td (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-2.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-2.c new file mode 100644 index 00000000000..d66ba886a92 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-20.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-20.c new file mode 100644 index 00000000000..e42f0debc82 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-20.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-21.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-21.c new file mode 100644 index 00000000000..975843c6a02 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-21.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_gt_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-22.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-22.c new file mode 100644 index 00000000000..d6eced78f6a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-22.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-23.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-23.c new file mode 100644 index 00000000000..eccca7e5d85 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-23.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_gt (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-24.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-24.c new file mode 100644 index 00000000000..54f1cd3d134 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-24.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-25.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-25.c new file mode 100644 index 00000000000..0c6594ecf46 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-25.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-26.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-26.c new file mode 100644 index 00000000000..e30c2f4ac79 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-26.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_gt_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-27.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-27.c new file mode 100644 index 00000000000..aaa0a854370 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-27.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-28.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-28.c new file mode 100644 index 00000000000..efec051639a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-28.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_gt (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-29.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-29.c new file mode 100644 index 00000000000..2f84bbfd36a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-29.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-3.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-3.c new file mode 100644 index 00000000000..ac0380973f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-3.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_lt (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-30.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-30.c new file mode 100644 index 00000000000..cfa8d0d2817 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-30.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt_dd (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-31.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-31.c new file mode 100644 index 00000000000..a95dcb8dbb6 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-31.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt_dd (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_gt_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-32.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-32.c new file mode 100644 index 00000000000..512e1574555 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-32.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt_dd (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-33.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-33.c new file mode 100644 index 00000000000..f21399e9d62 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-33.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_gt_dd (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-34.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-34.c new file mode 100644 index 00000000000..86422831975 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-34.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_gt_dd (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-35.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-35.c new file mode 100644 index 00000000000..5987b438970 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-35.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt_td (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-36.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-36.c new file mode 100644 index 00000000000..00be5389310 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-36.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt_td (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_gt_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-37.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-37.c new file mode 100644 index 00000000000..dcbde72a7f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-37.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt_td (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-38.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-38.c new file mode 100644 index 00000000000..c892c100aa8 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-38.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_gt_td (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-39.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-39.c new file mode 100644 index 00000000000..d54138d8c5c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-39.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_gt_td (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-4.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-4.c new file mode 100644 index 00000000000..f00756aa23c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-4.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_lt (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-40.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-40.c new file mode 100644 index 00000000000..6b2ecf775d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-40.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-41.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-41.c new file mode 100644 index 00000000000..c84387dc38b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-41.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_eq_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-42.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-42.c new file mode 100644 index 00000000000..f193b415007 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-42.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-43.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-43.c new file mode 100644 index 00000000000..0de23f4f225 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-43.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_eq (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-44.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-44.c new file mode 100644 index 00000000000..41652c99f6f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-44.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-45.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-45.c new file mode 100644 index 00000000000..4ef2d555d43 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-45.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-46.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-46.c new file mode 100644 index 00000000000..f1d6e2de80f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-46.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_eq_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-47.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-47.c new file mode 100644 index 00000000000..c85b709f228 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-47.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-48.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-48.c new file mode 100644 index 00000000000..94962fcff2f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-48.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_eq (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-49.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-49.c new file mode 100644 index 00000000000..79190d0dde0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-49.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-5.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-5.c new file mode 100644 index 00000000000..2aadb7e7dc2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-5.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-50.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-50.c new file mode 100644 index 00000000000..3d9869d39f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-50.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq_dd (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-51.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-51.c new file mode 100644 index 00000000000..58f542673de --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-51.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq_dd (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_eq_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-52.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-52.c new file mode 100644 index 00000000000..382fdc21060 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-52.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq_dd (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-53.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-53.c new file mode 100644 index 00000000000..067c2071b4b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-53.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_eq_dd (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-54.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-54.c new file mode 100644 index 00000000000..ac2c692b51f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-54.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_eq_dd (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-55.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-55.c new file mode 100644 index 00000000000..cd732fbc885 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-55.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq_td (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-56.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-56.c new file mode 100644 index 00000000000..7efb1a3d0f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-56.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq_td (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_eq_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-57.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-57.c new file mode 100644 index 00000000000..74ff7ec0d50 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-57.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq_td (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-58.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-58.c new file mode 100644 index 00000000000..d6ee4f72a75 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-58.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_eq_td (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-59.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-59.c new file mode 100644 index 00000000000..acd2a208379 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-59.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_eq_td (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-6.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-6.c new file mode 100644 index 00000000000..1bddb651b0e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-6.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_lt_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-60.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-60.c new file mode 100644 index 00000000000..71eab2609b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-60.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-61.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-61.c new file mode 100644 index 00000000000..247c1448a70 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-61.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_ov_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-62.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-62.c new file mode 100644 index 00000000000..fbe137de7f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-62.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-63.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-63.c new file mode 100644 index 00000000000..18d17f36ee3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-63.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_ov (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-64.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-64.c new file mode 100644 index 00000000000..6e601160ef7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-64.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-65.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-65.c new file mode 100644 index 00000000000..2ad93313760 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-65.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-66.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-66.c new file mode 100644 index 00000000000..69272acb47a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-66.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_ov_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-67.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-67.c new file mode 100644 index 00000000000..a9ba111b82f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-67.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-68.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-68.c new file mode 100644 index 00000000000..bd8040a175a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-68.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_ov (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-69.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-69.c new file mode 100644 index 00000000000..078f232cb4a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-69.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-7.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-7.c new file mode 100644 index 00000000000..1875741f5c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-7.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-70.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-70.c new file mode 100644 index 00000000000..f84faf8022b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-70.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov_dd (5, source); +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-71.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-71.c new file mode 100644 index 00000000000..3e512038cf3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-71.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov_dd (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_ov_dd requires" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-72.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-72.c new file mode 100644 index 00000000000..044d039b464 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-72.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov_dd (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-73.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-73.c new file mode 100644 index 00000000000..52a5d9a5664 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-73.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p) +{ + _Decimal64 source = *p; + + if (__builtin_dfp_dtstsfi_ov_dd (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfi" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-74.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-74.c new file mode 100644 index 00000000000..2dd72ee1253 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-74.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal64 *p, unsigned int significance) +{ + _Decimal64 source = *p; + + return __builtin_dfp_dtstsfi_ov_dd (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-75.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-75.c new file mode 100644 index 00000000000..6bbe73b7511 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-75.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on both 32- and 64-bit configurations. */ +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov_td (5, source); +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-76.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-76.c new file mode 100644 index 00000000000..572897fee55 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-76.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov_td (5, source); /* { dg-error "Builtin function __builtin_dtstsfi_ov_td requires" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-77.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-77.c new file mode 100644 index 00000000000..4b725377e09 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-77.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov_td (65, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} + + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-78.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-78.c new file mode 100644 index 00000000000..c302027e3be --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-78.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_ov_td (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-79.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-79.c new file mode 100644 index 00000000000..789b3ada11a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-79.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_ov_td (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-8.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-8.c new file mode 100644 index 00000000000..d3aa64efa97 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-8.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p) +{ + _Decimal128 source = *p; + + if (__builtin_dfp_dtstsfi_lt (63, source)) + return 3; + else + return 5; +} + +/* { dg-final { scan-assembler "dtstsfiq" } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-9.c b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-9.c new file mode 100644 index 00000000000..9180e3e9a01 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/dfp/dtstsfi-9.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-skip-if "" { powerpc*-*-aix* } } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +int doTestBCDSignificance (_Decimal128 *p, unsigned int significance) +{ + _Decimal128 source = *p; + + return __builtin_dfp_dtstsfi_lt (significance, source); /* { dg-error "argument 1 must be a 6-bit unsigned literal" } */ +} -- 2.30.2