[v4,rs6000] Change mode and insn condition for VSX scalar extract/insert instructions

Message ID 91d596d0-e4ca-f60f-4fe0-d96e35d62de2@linux.ibm.com
State Not Applicable
Headers
Series [v4,rs6000] Change mode and insn condition for VSX scalar extract/insert instructions |

Checks

Context Check Description
snail/gcc-patch-check fail Git am fail log

Commit Message

HAO CHEN GUI Nov. 7, 2022, 6:45 a.m. UTC
  Hi,
  For scalar extract/insert instructions, exponent field can be stored in a
32-bit register. So this patch changes the mode of exponent field from DI to
SI. So these instructions can be generated in a 32-bit environment. The patch
removes TARGET_64BIT check for these instructiions.

  The instructions using DI registers can be invoked with -mpowerpc64 in a
32-bit environment. The patch changes insn condition from TARGET_64BIT to
TARGET_POWERPC64 for those instructions.

  This patch also changes prototypes and catagories of relevant built-ins and
effective target checks of test cases.

  Compared to last version, main changes are to set catagories of relevant
built-ins from power9-64 to power9 and remove some unnecessary test cases.
Last version: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601196.html

  Bootstrapped and tested on powerpc64-linux BE and LE with no regressions.
Is this okay for trunk? Any recommendations? Thanks a lot.


ChangeLog
2022-11-07  Haochen Gui  <guihaoc@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-builtins.def
	(__builtin_vsx_scalar_extract_exp): Set return type to const unsigned
	int and move it from power9-64 to power9 catatlog.
	(__builtin_vsx_scalar_extract_sig): Set return type to const unsigned
	long long.
	(__builtin_vsx_scalar_insert_exp): Set type of second argument to
	unsigned int.
	(__builtin_vsx_scalar_insert_exp_dp): Set type of second argument to
	unsigned int and move it from power9-64 to power9 catatlog.
	* config/rs6000/vsx.md (xsxexpdp): Set mode of first operand to
	SImode.  Remove TARGET_64BIT from insn condition.
	(xsxsigdp): Change insn condition from TARGET_64BIT to TARGET_POWERPC64.
	(xsiexpdp): Change insn condition from TARGET_64BIT to
	TARGET_POWERPC64.  Set mode of third operand to SImode.
	(xsiexpdpf): Set mode of third operand to SImode.  Remove TARGET_64BIT
	from insn condition.

gcc/testsuite/
	* gcc.target/powerpc/bfp/scalar-extract-exp-0.c: Remove lp64 check.
	* gcc.target/powerpc/bfp/scalar-extract-exp-1.c: Remove lp64 check.
	* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Deleted as case is
	invalid now.
	* gcc.target/powerpc/bfp/scalar-extract-exp-6.c: Replace lp64 check
	with has_arch_ppc64.
	* gcc.target/powerpc/bfp/scalar-extract-sig-0.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-extract-sig-6.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-insert-exp-0.c: Replace lp64 check
	with has_arch_ppc64. Set type of exponent to unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-1.c: Set type of exponent
	to unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-12.c: Replace lp64 check
	with has_arch_ppc64. Set type of exponent to unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-13.c: Remove lp64 check.
	Set type of exponent to unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Set type of exponent to
	unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-3.c: Remove lp64 check. Set
	type of exponent to unsigned int.
	* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Deleted as case is
	invalid now.

patch.diff
  

Comments

Kewen.Lin Nov. 25, 2022, 8:33 a.m. UTC | #1
Hi Haochen,

Sorry for the late reply.

on 2022/11/7 14:45, HAO CHEN GUI wrote:
> Hi,
>   For scalar extract/insert instructions, exponent field can be stored in a
> 32-bit register. So this patch changes the mode of exponent field from DI to
> SI. So these instructions can be generated in a 32-bit environment. The patch
> removes TARGET_64BIT check for these instructiions.
> 
>   The instructions using DI registers can be invoked with -mpowerpc64 in a
> 32-bit environment. The patch changes insn condition from TARGET_64BIT to
> TARGET_POWERPC64 for those instructions.
> 
>   This patch also changes prototypes and catagories of relevant built-ins and
> effective target checks of test cases.
> 
>   Compared to last version, main changes are to set catagories of relevant
> built-ins from power9-64 to power9 and remove some unnecessary test cases.
> Last version: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601196.html

Nice, but this still missed to update the documentation on scalar_extract_exp and
scalar_insert_exp, both are ducumented as "require a 64-bit environment".
We need some corresponding updates in gcc/doc/extend.texi.

The others look good to me excepting for one nit in test cases ...

> 
>   Bootstrapped and tested on powerpc64-linux BE and LE with no regressions.
> Is this okay for trunk? Any recommendations? Thanks a lot.
> 
> 
> ChangeLog
> 2022-11-07  Haochen Gui  <guihaoc@linux.ibm.com>
> 
> gcc/
> 	* config/rs6000/rs6000-builtins.def
> 	(__builtin_vsx_scalar_extract_exp): Set return type to const unsigned
> 	int and move it from power9-64 to power9 catatlog.
> 	(__builtin_vsx_scalar_extract_sig): Set return type to const unsigned
> 	long long.
> 	(__builtin_vsx_scalar_insert_exp): Set type of second argument to
> 	unsigned int.
> 	(__builtin_vsx_scalar_insert_exp_dp): Set type of second argument to
> 	unsigned int and move it from power9-64 to power9 catatlog.
> 	* config/rs6000/vsx.md (xsxexpdp): Set mode of first operand to
> 	SImode.  Remove TARGET_64BIT from insn condition.
> 	(xsxsigdp): Change insn condition from TARGET_64BIT to TARGET_POWERPC64.
> 	(xsiexpdp): Change insn condition from TARGET_64BIT to
> 	TARGET_POWERPC64.  Set mode of third operand to SImode.
> 	(xsiexpdpf): Set mode of third operand to SImode.  Remove TARGET_64BIT
> 	from insn condition.
> 
> gcc/testsuite/
> 	* gcc.target/powerpc/bfp/scalar-extract-exp-0.c: Remove lp64 check.
> 	* gcc.target/powerpc/bfp/scalar-extract-exp-1.c: Remove lp64 check.
> 	* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Deleted as case is
> 	invalid now.
> 	* gcc.target/powerpc/bfp/scalar-extract-exp-6.c: Replace lp64 check
> 	with has_arch_ppc64.
> 	* gcc.target/powerpc/bfp/scalar-extract-sig-0.c: Likewise.
> 	* gcc.target/powerpc/bfp/scalar-extract-sig-6.c: Likewise.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-0.c: Replace lp64 check
> 	with has_arch_ppc64. Set type of exponent to unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-1.c: Set type of exponent
> 	to unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-12.c: Replace lp64 check
> 	with has_arch_ppc64. Set type of exponent to unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-13.c: Remove lp64 check.
> 	Set type of exponent to unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Set type of exponent to
> 	unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-3.c: Remove lp64 check. Set
> 	type of exponent to unsigned int.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: Likewise.
> 	* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Deleted as case is
> 	invalid now.
> 
> patch.diff
> diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
> index f76f54793d7..d8d67fa0cad 100644
> --- a/gcc/config/rs6000/rs6000-builtins.def
> +++ b/gcc/config/rs6000/rs6000-builtins.def
> @@ -2833,6 +2833,11 @@
>    const signed int __builtin_dtstsfi_ov_td (const int<6>, _Decimal128);
>      TSTSFI_OV_TD dfptstsfi_unordered_td {}
> 
> +  const unsigned int __builtin_vsx_scalar_extract_exp (double);
> +    VSEEDP xsxexpdp {}
> +
> +  const double __builtin_vsx_scalar_insert_exp_dp (double, unsigned int);
> +    VSIEDPF xsiexpdpf {}
> 
>  [power9-64]
>    void __builtin_altivec_xst_len_r (vsc, void *, long);
> @@ -2847,19 +2852,13 @@
>    pure vsc __builtin_vsx_lxvl (const void *, signed long);
>      LXVL lxvl {}
> 
> -  const signed long __builtin_vsx_scalar_extract_exp (double);
> -    VSEEDP xsxexpdp {}
> -
> -  const signed long __builtin_vsx_scalar_extract_sig (double);
> +  const unsigned long long __builtin_vsx_scalar_extract_sig (double);
>      VSESDP xsxsigdp {}
> 
>    const double __builtin_vsx_scalar_insert_exp (unsigned long long, \
> -                                                unsigned long long);
> +						unsigned int);
>      VSIEDP xsiexpdp {}
> 
> -  const double __builtin_vsx_scalar_insert_exp_dp (double, unsigned long long);
> -    VSIEDPF xsiexpdpf {}
> -
>    pure vsc __builtin_vsx_xl_len_r (void *, signed long);
>      XL_LEN_R xl_len_r {}
> 
> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
> index e226a93bbe5..9d3a2340a79 100644
> --- a/gcc/config/rs6000/vsx.md
> +++ b/gcc/config/rs6000/vsx.md
> @@ -5095,10 +5095,10 @@ (define_insn "xsxexpqp_<mode>"
> 
>  ;; VSX Scalar Extract Exponent Double-Precision
>  (define_insn "xsxexpdp"
> -  [(set (match_operand:DI 0 "register_operand" "=r")
> -	(unspec:DI [(match_operand:DF 1 "vsx_register_operand" "wa")]
> +  [(set (match_operand:SI 0 "register_operand" "=r")
> +	(unspec:SI [(match_operand:DF 1 "vsx_register_operand" "wa")]
>  	 UNSPEC_VSX_SXEXPDP))]
> -  "TARGET_P9_VECTOR && TARGET_64BIT"
> +  "TARGET_P9_VECTOR"
>    "xsxexpdp %0,%x1"
>    [(set_attr "type" "integer")])
> 
> @@ -5116,7 +5116,7 @@ (define_insn "xsxsigdp"
>    [(set (match_operand:DI 0 "register_operand" "=r")
>  	(unspec:DI [(match_operand:DF 1 "vsx_register_operand" "wa")]
>  	 UNSPEC_VSX_SXSIG))]
> -  "TARGET_P9_VECTOR && TARGET_64BIT"
> +  "TARGET_P9_VECTOR && TARGET_POWERPC64"
>    "xsxsigdp %0,%x1"
>    [(set_attr "type" "integer")])
> 
> @@ -5145,9 +5145,9 @@ (define_insn "xsiexpqp_<mode>"
>  (define_insn "xsiexpdp"
>    [(set (match_operand:DF 0 "vsx_register_operand" "=wa")
>  	(unspec:DF [(match_operand:DI 1 "register_operand" "r")
> -		    (match_operand:DI 2 "register_operand" "r")]
> +		    (match_operand:SI 2 "register_operand" "r")]
>  	 UNSPEC_VSX_SIEXPDP))]
> -  "TARGET_P9_VECTOR && TARGET_64BIT"
> +  "TARGET_P9_VECTOR && TARGET_POWERPC64"
>    "xsiexpdp %x0,%1,%2"
>    [(set_attr "type" "fpsimple")])
> 
> @@ -5155,9 +5155,9 @@ (define_insn "xsiexpdp"
>  (define_insn "xsiexpdpf"
>    [(set (match_operand:DF 0 "vsx_register_operand" "=wa")
>  	(unspec:DF [(match_operand:DF 1 "register_operand" "r")
> -		    (match_operand:DI 2 "register_operand" "r")]
> +		    (match_operand:SI 2 "register_operand" "r")]
>  	 UNSPEC_VSX_SIEXPDP))]
> -  "TARGET_P9_VECTOR && TARGET_64BIT"
> +  "TARGET_P9_VECTOR"
>    "xsiexpdp %x0,%1,%2"
>    [(set_attr "type" "fpsimple")])
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
> index 35bf1b240f3..a97a2b6ec98 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
> @@ -1,9 +1,7 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-do compile } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> 
> -/* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> 
>  unsigned int
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
> index 9737762c1d4..1cb438f9b70 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
> @@ -1,9 +1,7 @@
>  /* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
>  /* { dg-require-effective-target powerpc_p9vector_ok } */
>  /* { dg-options "-mdejagnu-cpu=power8" } */
> 
> -/* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> 
>  unsigned int
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c
> deleted file mode 100644
> index 53b67c95cf9..00000000000
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target ilp32 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> -/* { dg-options "-mdejagnu-cpu=power9" } */
> -
> -/* This test only runs on 32-bit configurations, where a compiler error
> -   should be issued because this builtin is not available on
> -   32-bit configurations.  */
> -
> -#include <altivec.h>
> -
> -unsigned int
> -get_exponent (double *p)
> -{
> -  double source = *p;
> -
> -  return scalar_extract_exp (source);	/* { dg-error "'__builtin_vsx_scalar_extract_exp' requires the" } */
> -}
> -
> -
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
> index b9dd7d61aae..136471a35b3 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
> @@ -1,7 +1,7 @@
> -/* { dg-do run { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target p9vector_hw } */
> +/* { dg-do run } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target has_arch_ppc64 } */
> +/* { dg-require-effective-target p9vector_hw } */
> 
>  /* This test should succeed only on 64-bit configurations.  */

... s/on 64-bit configurations/with 64-bit instructions (-mpowerpc64)/

This is also applied for the below cases with has_arch_ppc64.

BR,
Kewen

>  #include <altivec.h>
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
> index 637080652b7..3be7eb13566 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
> @@ -1,7 +1,7 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-do compile } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target has_arch_ppc64 } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> 
>  /* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
> index c85072da138..b96a745157d 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
> @@ -1,7 +1,7 @@
> -/* { dg-do run { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target p9vector_hw } */
> +/* { dg-do run } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target has_arch_ppc64 } */
> +/* { dg-require-effective-target p9vector_hw } */
> 
>  /* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
> index d8243258a67..7e70d6e2642 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
> @@ -1,17 +1,17 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-do compile } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target has_arch_ppc64 } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> 
>  /* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> 
>  double
>  insert_exponent (unsigned long long int *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    unsigned long long int significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return scalar_insert_exp (significand, exponent);
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
> index 8260b107178..a7297319bc4 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
> @@ -8,10 +8,10 @@
> 
>  double
>  insert_exponent (unsigned long long int *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    unsigned long long int significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return __builtin_vec_scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp' requires" } */
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
> index 384fc9cc675..343620fbe17 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
> @@ -1,7 +1,7 @@
> -/* { dg-do run { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target p9vector_hw } */
> +/* { dg-do run } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target has_arch_ppc64 } */
> +/* { dg-require-effective-target p9vector_hw } */
> 
>  /* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> @@ -9,10 +9,10 @@
> 
>  double
>  insert_exponent (unsigned long long int *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    unsigned long long int significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return scalar_insert_exp (significand, exponent);
>  }
> @@ -24,8 +24,8 @@ main ()
>  {
>    unsigned long long int significand_1 = 0x18000000000000LL;
>    unsigned long long int significand_2 = 0x1a000000000000LL;
> -  unsigned long long int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
> -  unsigned long long int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
> +  unsigned int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
> +  unsigned int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
> 
>    double x = (double) (0x1800ULL << 50);
>    double z = (double) (0x1a00ULL << 37);
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
> index 0e004224277..6c3b1ccd523 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
> @@ -1,18 +1,16 @@
> -/* { dg-do run { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target p9vector_hw } */
> +/* { dg-do run } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target p9vector_hw } */
> 
> -/* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
>  #include <stdlib.h>
> 
>  double
>  insert_exponent (double *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    double significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return scalar_insert_exp (significand, exponent);
>  }
> @@ -24,8 +22,8 @@ main ()
>  {
>    unsigned long long int significand_1 = 0x11000000000000LL;
>    unsigned long long int significand_2 = 0x11010000000000LL;
> -  unsigned long long int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
> -  unsigned long long int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
> +  unsigned int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
> +  unsigned int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
> 
>    double *significand_1_ptr = (double *) &significand_1;
>    double *significand_2_ptr = (double *) &significand_2;
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
> index efd69725905..fdaba6b31ff 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
> @@ -11,10 +11,10 @@
> 
>  double
>  insert_exponent (unsigned long long int *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    unsigned long long int significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp' requires the" } */
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
> index 3ecbe3318e8..c03018782fb 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
> @@ -1,17 +1,15 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-do compile } */
>  /* { dg-options "-mdejagnu-cpu=power9" } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> 
> -/* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> 
>  double
>  insert_exponent (double *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    double significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return scalar_insert_exp (significand, exponent);
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
> index 1699c67a2f1..e0861f43d86 100644
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
> +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
> @@ -1,17 +1,15 @@
>  /* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target lp64 } */
>  /* { dg-require-effective-target powerpc_p9vector_ok } */
>  /* { dg-options "-mdejagnu-cpu=power8" } */
> 
> -/* This test should succeed only on 64-bit configurations.  */
>  #include <altivec.h>
> 
>  double
>  insert_exponent (double *significand_p,
> -		 unsigned long long int *exponent_p)
> +		 unsigned int *exponent_p)
>  {
>    double significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> +  unsigned int exponent = *exponent_p;
> 
>    return __builtin_vec_scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp_dp' requires" } */
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c
> deleted file mode 100644
> index f85966a6fdf..00000000000
> --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -/* { dg-do compile { target { powerpc*-*-* } } } */
> -/* { dg-require-effective-target ilp32 } */
> -/* { dg-require-effective-target powerpc_p9vector_ok } */
> -/* { dg-options "-mdejagnu-cpu=power9" } */
> -
> -/* This test only runs on 32-bit configurations, where a compiler error
> -   should be issued because this builtin is not available on
> -   32-bit configurations.  */
> -
> -#include <altivec.h>
> -
> -double
> -insert_exponent (double *significand_p,
> -		 unsigned long long int *exponent_p)
> -{
> -  double significand = *significand_p;
> -  unsigned long long int exponent = *exponent_p;
> -
> -  return scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp_dp' requires the" } */
> -}
> 
>
  

Patch

diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index f76f54793d7..d8d67fa0cad 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -2833,6 +2833,11 @@ 
   const signed int __builtin_dtstsfi_ov_td (const int<6>, _Decimal128);
     TSTSFI_OV_TD dfptstsfi_unordered_td {}

+  const unsigned int __builtin_vsx_scalar_extract_exp (double);
+    VSEEDP xsxexpdp {}
+
+  const double __builtin_vsx_scalar_insert_exp_dp (double, unsigned int);
+    VSIEDPF xsiexpdpf {}

 [power9-64]
   void __builtin_altivec_xst_len_r (vsc, void *, long);
@@ -2847,19 +2852,13 @@ 
   pure vsc __builtin_vsx_lxvl (const void *, signed long);
     LXVL lxvl {}

-  const signed long __builtin_vsx_scalar_extract_exp (double);
-    VSEEDP xsxexpdp {}
-
-  const signed long __builtin_vsx_scalar_extract_sig (double);
+  const unsigned long long __builtin_vsx_scalar_extract_sig (double);
     VSESDP xsxsigdp {}

   const double __builtin_vsx_scalar_insert_exp (unsigned long long, \
-                                                unsigned long long);
+						unsigned int);
     VSIEDP xsiexpdp {}

-  const double __builtin_vsx_scalar_insert_exp_dp (double, unsigned long long);
-    VSIEDPF xsiexpdpf {}
-
   pure vsc __builtin_vsx_xl_len_r (void *, signed long);
     XL_LEN_R xl_len_r {}

diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index e226a93bbe5..9d3a2340a79 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -5095,10 +5095,10 @@  (define_insn "xsxexpqp_<mode>"

 ;; VSX Scalar Extract Exponent Double-Precision
 (define_insn "xsxexpdp"
-  [(set (match_operand:DI 0 "register_operand" "=r")
-	(unspec:DI [(match_operand:DF 1 "vsx_register_operand" "wa")]
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(unspec:SI [(match_operand:DF 1 "vsx_register_operand" "wa")]
 	 UNSPEC_VSX_SXEXPDP))]
-  "TARGET_P9_VECTOR && TARGET_64BIT"
+  "TARGET_P9_VECTOR"
   "xsxexpdp %0,%x1"
   [(set_attr "type" "integer")])

@@ -5116,7 +5116,7 @@  (define_insn "xsxsigdp"
   [(set (match_operand:DI 0 "register_operand" "=r")
 	(unspec:DI [(match_operand:DF 1 "vsx_register_operand" "wa")]
 	 UNSPEC_VSX_SXSIG))]
-  "TARGET_P9_VECTOR && TARGET_64BIT"
+  "TARGET_P9_VECTOR && TARGET_POWERPC64"
   "xsxsigdp %0,%x1"
   [(set_attr "type" "integer")])

@@ -5145,9 +5145,9 @@  (define_insn "xsiexpqp_<mode>"
 (define_insn "xsiexpdp"
   [(set (match_operand:DF 0 "vsx_register_operand" "=wa")
 	(unspec:DF [(match_operand:DI 1 "register_operand" "r")
-		    (match_operand:DI 2 "register_operand" "r")]
+		    (match_operand:SI 2 "register_operand" "r")]
 	 UNSPEC_VSX_SIEXPDP))]
-  "TARGET_P9_VECTOR && TARGET_64BIT"
+  "TARGET_P9_VECTOR && TARGET_POWERPC64"
   "xsiexpdp %x0,%1,%2"
   [(set_attr "type" "fpsimple")])

@@ -5155,9 +5155,9 @@  (define_insn "xsiexpdp"
 (define_insn "xsiexpdpf"
   [(set (match_operand:DF 0 "vsx_register_operand" "=wa")
 	(unspec:DF [(match_operand:DF 1 "register_operand" "r")
-		    (match_operand:DI 2 "register_operand" "r")]
+		    (match_operand:SI 2 "register_operand" "r")]
 	 UNSPEC_VSX_SIEXPDP))]
-  "TARGET_P9_VECTOR && TARGET_64BIT"
+  "TARGET_P9_VECTOR"
   "xsiexpdp %x0,%1,%2"
   [(set_attr "type" "fpsimple")])

diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
index 35bf1b240f3..a97a2b6ec98 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c
@@ -1,9 +1,7 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do compile } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */

-/* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>

 unsigned int
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
index 9737762c1d4..1cb438f9b70 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c
@@ -1,9 +1,7 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
 /* { dg-require-effective-target powerpc_p9vector_ok } */
 /* { dg-options "-mdejagnu-cpu=power8" } */

-/* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>

 unsigned int
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c
deleted file mode 100644
index 53b67c95cf9..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c
+++ /dev/null
@@ -1,20 +0,0 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-options "-mdejagnu-cpu=power9" } */
-
-/* This test only runs on 32-bit configurations, where a compiler error
-   should be issued because this builtin is not available on
-   32-bit configurations.  */
-
-#include <altivec.h>
-
-unsigned int
-get_exponent (double *p)
-{
-  double source = *p;
-
-  return scalar_extract_exp (source);	/* { dg-error "'__builtin_vsx_scalar_extract_exp' requires the" } */
-}
-
-
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
index b9dd7d61aae..136471a35b3 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c
@@ -1,7 +1,7 @@ 
-/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target p9vector_hw } */
+/* { dg-do run } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-require-effective-target p9vector_hw } */

 /* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
index 637080652b7..3be7eb13566 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-0.c
@@ -1,7 +1,7 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do compile } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */

 /* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
index c85072da138..b96a745157d 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c
@@ -1,7 +1,7 @@ 
-/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target p9vector_hw } */
+/* { dg-do run } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-require-effective-target p9vector_hw } */

 /* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
index d8243258a67..7e70d6e2642 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c
@@ -1,17 +1,17 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do compile } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */

 /* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>

 double
 insert_exponent (unsigned long long int *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   unsigned long long int significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return scalar_insert_exp (significand, exponent);
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
index 8260b107178..a7297319bc4 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c
@@ -8,10 +8,10 @@ 

 double
 insert_exponent (unsigned long long int *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   unsigned long long int significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return __builtin_vec_scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp' requires" } */
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
index 384fc9cc675..343620fbe17 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c
@@ -1,7 +1,7 @@ 
-/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target p9vector_hw } */
+/* { dg-do run } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-require-effective-target p9vector_hw } */

 /* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>
@@ -9,10 +9,10 @@ 

 double
 insert_exponent (unsigned long long int *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   unsigned long long int significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return scalar_insert_exp (significand, exponent);
 }
@@ -24,8 +24,8 @@  main ()
 {
   unsigned long long int significand_1 = 0x18000000000000LL;
   unsigned long long int significand_2 = 0x1a000000000000LL;
-  unsigned long long int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
-  unsigned long long int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
+  unsigned int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
+  unsigned int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;

   double x = (double) (0x1800ULL << 50);
   double z = (double) (0x1a00ULL << 37);
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
index 0e004224277..6c3b1ccd523 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c
@@ -1,18 +1,16 @@ 
-/* { dg-do run { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target p9vector_hw } */
+/* { dg-do run } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target p9vector_hw } */

-/* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>
 #include <stdlib.h>

 double
 insert_exponent (double *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   double significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return scalar_insert_exp (significand, exponent);
 }
@@ -24,8 +22,8 @@  main ()
 {
   unsigned long long int significand_1 = 0x11000000000000LL;
   unsigned long long int significand_2 = 0x11010000000000LL;
-  unsigned long long int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
-  unsigned long long int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;
+  unsigned int exponent_1 = 62 + BIAS_FOR_DOUBLE_EXP;
+  unsigned int exponent_2 = 49 + BIAS_FOR_DOUBLE_EXP;

   double *significand_1_ptr = (double *) &significand_1;
   double *significand_2_ptr = (double *) &significand_2;
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
index efd69725905..fdaba6b31ff 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-2.c
@@ -11,10 +11,10 @@ 

 double
 insert_exponent (unsigned long long int *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   unsigned long long int significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp' requires the" } */
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
index 3ecbe3318e8..c03018782fb 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
@@ -1,17 +1,15 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-do compile } */
 /* { dg-options "-mdejagnu-cpu=power9" } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */

-/* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>

 double
 insert_exponent (double *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   double significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return scalar_insert_exp (significand, exponent);
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
index 1699c67a2f1..e0861f43d86 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
@@ -1,17 +1,15 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target lp64 } */
 /* { dg-require-effective-target powerpc_p9vector_ok } */
 /* { dg-options "-mdejagnu-cpu=power8" } */

-/* This test should succeed only on 64-bit configurations.  */
 #include <altivec.h>

 double
 insert_exponent (double *significand_p,
-		 unsigned long long int *exponent_p)
+		 unsigned int *exponent_p)
 {
   double significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
+  unsigned int exponent = *exponent_p;

   return __builtin_vec_scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp_dp' requires" } */
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c
deleted file mode 100644
index f85966a6fdf..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c
+++ /dev/null
@@ -1,20 +0,0 @@ 
-/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-options "-mdejagnu-cpu=power9" } */
-
-/* This test only runs on 32-bit configurations, where a compiler error
-   should be issued because this builtin is not available on
-   32-bit configurations.  */
-
-#include <altivec.h>
-
-double
-insert_exponent (double *significand_p,
-		 unsigned long long int *exponent_p)
-{
-  double significand = *significand_p;
-  unsigned long long int exponent = *exponent_p;
-
-  return scalar_insert_exp (significand, exponent); /* { dg-error "'__builtin_vsx_scalar_insert_exp_dp' requires the" } */
-}