public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,rs6000] Correct argument and result types for binary floating point built-in functions
@ 2017-01-19 23:12 Kelvin Nilsen
  2017-01-21  2:33 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Kelvin Nilsen @ 2017-01-19 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool


This patch corrects several errors in a patch originally committed on
2016-08-10.  The following corrections are required to maintain
compliance with "Power Architecture 64-Bit ELF V2 ABI Specification",
also known as "OpenPOWER ABI for Linux Supplement".

  vector unsigned long long vec_extract_exp (vector double);
    (instead of vector long long vec_extract_exp (vector double))
  vector unsigned int vec_extract_exp (vector float);
    (instead of vector int vec_extract_exp (vector float))
  vector unsigned long long vec_extract_sig (vector double);
    (instead of vector long long vec_extract_sig (vector double))
  vector unsigned int vec_extract_sig (vector float);
    (instead of vector int vec_extract_sig (vector float))
  vector double vec_insert_exp (vector double, vector unsigned long long);
  vector float vec_insert_exp (vector float, vector unsigned int);
    (the above two are new forms, to complement the existing 
     forms which take matching integer arguments)
  vector bool int vec_test_data_class (vector float, const int);
    (instead of vector int vec_test_class (vector float, unsigned int))
  vector bool long long vec_test_data_class (vector double, const int);
    (instead of vector long long vec_test_data_class (vector double, unsigned int))

Though the following functions are not defined in the ABI
specification, they were also corrected to provide improved consistency
with the corresponding vector functions:

  double scalar_insert_exp (double, unsigned long long);
    (The above was added to complement the existing form: 
     double scalar_insert_exp (unsigned long long int, unsigned long long int))
  bool scalar_test_data_class (double, const int);
    (instead of int scalar_test_data_class (double, unsigned int))
  bool scalar_test_data_class (float, const int);
    (instead of int scalar_test_data_class (float, unsigned int))
  bool scalar_test_neg (double);
    (instead of int scalar_test_neg (double))
  bool scalar_test_neg (float);
    (instead of int scalar_test_neg (float))

This patch has bootstrapped and tested on
powerpcle-unknown-linux (little-endian) and on
powerpc-unknown-linux (big-endian, with both -m32 and -m64 target
option) with no regressions.  Is this ok for the trunk?

gcc/testsuite/ChangeLog:

2017-01-19  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/bfp/scalar-insert-exp-3.c: New test.
	* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: New test.
	* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: New test.
	* gcc.target/powerpc/bfp/scalar-test-data-class-0.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/scalar-test-data-class-1.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-2.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-3.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-4.c: Adjust return
	type and second argument type to reflect change in built-in
	function's type signature.
	* gcc.target/powerpc/bfp/scalar-test-data-class-5.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-6.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/scalar-test-data-class-7.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-0.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-1.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-2.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-0.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-0.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-insert-exp-4.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-5.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-6.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-7.c: New test.
	* gcc.target/powerpc/bfp/vec-test-data-class-0.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/vec-test-data-class-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-4.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-5.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-6.c: Adjust types of
	test function's result and second argument to reflect change in
	built-in function's type signature.
	* gcc.target/powerpc/bfp/vec-test-data-class-7.c: Likewise.

gcc/ChangeLog:

2017-01-19  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000-builtin.def (VSIEDPF): Add scalar insert
	exponent support with double type for first argument.
	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Changed
	type returned by __builtin_vec_extract_sig,
	__builtin_vec_extract_sig_sp, and __builtin_vec_extract_sig_dp
	functions from "vector int" to "vector unsigned int" or from
	"vector long long int" to "vector unsigned long long int".
	Changed type returned by __builtin_vec_extract_exp,
	__builtin_vec_extract_exp_sp, and __builtin_vec_extract_exp_dp
	functions from "vector int" to "vector unsigned int" or from
	"vector long long int" to "vector unsigned long long int".
	Changed return type of __builtin_vec_test_data_class,
	__builtin_vec_test_data_class_sp, and
	__builtin_vec_test_data_class_dp from "vector int" to
	"vector bool int" or from "vector long long int" to "vector bool
	long long int" and changed second argument type from "unsigned
	int" to "int".  Addeod new overloaded function forms "vector float
	__builtin_vec_insert_exp (vector float, vector unsigned int)" and
	"vector float __builtin_vec_insert_exp_sp (vector float, vector
	unsigned int)" and "vector double __builtin_vec_insert_exp (vector
	double, vector unsigned long long int)" and "vector double
	__builtin_vec_insert_exp_dp (vector double, vector unsigned long
	long int)".  Changed return type of
	__builtin_scalar_test_data_class and
	__builtin_scalar_test_data_class_sp and
	__builtin_scalar_test_data_class_dp from "unsigned int" to "bool
	int" and changed second argument from "unsigned int" to "int".
	Changed type returned by __builtin_scalar_test_neg,
	__builtin_scalar_test_neg_sp, and __builtin_scalar_test_neg_dp
	from "int" to "bool int".  Added new overloaded function form
	"double __builtin_scalar_insert_exp (double, unsigned long long int)".
	* config/rs6000/vsx.md (xsiexpdpf): New insn for scalar insert
	exponent double-precision with floating point first argument.
	* doc/extend.texi (PowerPC AltiVec Built-in Functions): Adjust
	documentation of scalar_test_data_class, scalar_test_neg,
	scalar_extract_sig, scalar_extract_exp, scalar_insert_exp,
	vector_extract_exp, vec_extract_sig, vec_insert_exp, and
	vec_test_data_class built-in functions to reflect refinements in
	their type signatures.

Index: gcc/config/rs6000/rs6000-builtin.def
===================================================================
--- gcc/config/rs6000/rs6000-builtin.def	(revision 244388)
+++ gcc/config/rs6000/rs6000-builtin.def	(working copy)
@@ -1934,6 +1934,7 @@ BU_P9V_VSX_1 (VSTDCNSP,	"scalar_test_neg_sp",	CONS
 
 /* 2 argument vsx scalar functions added in ISA 3.0 (power9).  */
 BU_P9V_64BIT_VSX_2 (VSIEDP,	"scalar_insert_exp",	CONST,	xsiexpdp)
+BU_P9V_64BIT_VSX_2 (VSIEDPF,	"scalar_insert_exp_dp",	CONST,	xsiexpdpf)
 
 BU_P9V_VSX_2 (VSCEDPGT,	"scalar_cmp_exp_dp_gt",	CONST,	xscmpexpdp_gt)
 BU_P9V_VSX_2 (VSCEDPLT,	"scalar_cmp_exp_dp_lt",	CONST,	xscmpexpdp_lt)
Index: gcc/config/rs6000/rs6000-c.c
===================================================================
--- gcc/config/rs6000/rs6000-c.c	(revision 244388)
+++ gcc/config/rs6000/rs6000-c.c	(working copy)
@@ -4326,64 +4326,74 @@ const struct altivec_builtin_types altivec_overloa
     RS6000_BTI_unsigned_V4SI, 0 },
 
   { P9V_BUILTIN_VEC_VES, P9V_BUILTIN_VESSP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, 0, 0 },
+    RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, 0, 0 },
   { P9V_BUILTIN_VEC_VES, P9V_BUILTIN_VESDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, 0, 0 },
+    RS6000_BTI_unsigned_V2DI, RS6000_BTI_V2DF, 0, 0 },
 
   { P9V_BUILTIN_VEC_VESSP, P9V_BUILTIN_VESSP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, 0, 0 },
+    RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, 0, 0 },
   { P9V_BUILTIN_VEC_VESDP, P9V_BUILTIN_VESDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, 0, 0 },
+    RS6000_BTI_unsigned_V2DI, RS6000_BTI_V2DF, 0, 0 },
 
   { P9V_BUILTIN_VEC_VEE, P9V_BUILTIN_VEESP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, 0, 0 },
+    RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, 0, 0 },
   { P9V_BUILTIN_VEC_VEE, P9V_BUILTIN_VEEDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, 0, 0 },
+    RS6000_BTI_unsigned_V2DI, RS6000_BTI_V2DF, 0, 0 },
 
   { P9V_BUILTIN_VEC_VEESP, P9V_BUILTIN_VEESP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, 0, 0 },
+    RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, 0, 0 },
   { P9V_BUILTIN_VEC_VEEDP, P9V_BUILTIN_VEEDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, 0, 0 },
+    RS6000_BTI_unsigned_V2DI, RS6000_BTI_V2DF, 0, 0 },
 
   { P9V_BUILTIN_VEC_VTDC, P9V_BUILTIN_VTDCSP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 },
   { P9V_BUILTIN_VEC_VTDC, P9V_BUILTIN_VTDCDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_V2DI, RS6000_BTI_V2DF, RS6000_BTI_INTSI, 0 },
 
   { P9V_BUILTIN_VEC_VTDCSP, P9V_BUILTIN_VTDCSP,
-    RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 },
   { P9V_BUILTIN_VEC_VTDCDP, P9V_BUILTIN_VTDCDP,
-    RS6000_BTI_V2DI, RS6000_BTI_V2DF, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_V2DI, RS6000_BTI_V2DF, RS6000_BTI_INTSI, 0 },
 
   { P9V_BUILTIN_VEC_VIE, P9V_BUILTIN_VIESP,
     RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
+  { P9V_BUILTIN_VEC_VIE, P9V_BUILTIN_VIESP,
+    RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, 0 },
+
   { P9V_BUILTIN_VEC_VIE, P9V_BUILTIN_VIEDP,
     RS6000_BTI_V2DF, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+  { P9V_BUILTIN_VEC_VIE, P9V_BUILTIN_VIEDP,
+    RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_unsigned_V2DI, 0 },
 
   { P9V_BUILTIN_VEC_VIESP, P9V_BUILTIN_VIESP,
     RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
+  { P9V_BUILTIN_VEC_VIESP, P9V_BUILTIN_VIESP,
+    RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, 0 },
+
   { P9V_BUILTIN_VEC_VIEDP, P9V_BUILTIN_VIEDP,
     RS6000_BTI_V2DF, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+  { P9V_BUILTIN_VEC_VIEDP, P9V_BUILTIN_VIEDP,
+    RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_unsigned_V2DI, 0 },
 
   { P9V_BUILTIN_VEC_VSTDC, P9V_BUILTIN_VSTDCSP,
-    RS6000_BTI_UINTSI, RS6000_BTI_float, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_float, RS6000_BTI_INTSI, 0 },
   { P9V_BUILTIN_VEC_VSTDC, P9V_BUILTIN_VSTDCDP,
-    RS6000_BTI_UINTSI, RS6000_BTI_double, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_double, RS6000_BTI_INTSI, 0 },
 
   { P9V_BUILTIN_VEC_VSTDCSP, P9V_BUILTIN_VSTDCSP,
-    RS6000_BTI_UINTSI, RS6000_BTI_float, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_float, RS6000_BTI_INTSI, 0 },
   { P9V_BUILTIN_VEC_VSTDCDP, P9V_BUILTIN_VSTDCDP,
-    RS6000_BTI_UINTSI, RS6000_BTI_double, RS6000_BTI_UINTSI, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_double, RS6000_BTI_INTSI, 0 },
 
   { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCNSP,
-    RS6000_BTI_INTSI, RS6000_BTI_float, 0, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_float, 0, 0 },
   { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCNDP,
-    RS6000_BTI_INTSI, RS6000_BTI_double, 0, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_double, 0, 0 },
 
   { P9V_BUILTIN_VEC_VSTDCNSP, P9V_BUILTIN_VSTDCNSP,
-    RS6000_BTI_INTSI, RS6000_BTI_float, 0, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_float, 0, 0 },
   { P9V_BUILTIN_VEC_VSTDCNDP, P9V_BUILTIN_VSTDCNDP,
-    RS6000_BTI_INTSI, RS6000_BTI_double, 0, 0 },
+    RS6000_BTI_bool_int, RS6000_BTI_double, 0, 0 },
 
   { P9V_BUILTIN_VEC_VSEEDP, P9V_BUILTIN_VSEEDP,
     RS6000_BTI_UINTSI, RS6000_BTI_double, 0, 0 },
@@ -4393,6 +4403,8 @@ const struct altivec_builtin_types altivec_overloa
 
   { P9V_BUILTIN_VEC_VSIEDP, P9V_BUILTIN_VSIEDP,
     RS6000_BTI_double, RS6000_BTI_UINTDI, RS6000_BTI_UINTDI, 0 },
+  { P9V_BUILTIN_VEC_VSIEDP, P9V_BUILTIN_VSIEDPF,
+    RS6000_BTI_double, RS6000_BTI_double, RS6000_BTI_UINTDI, 0 },
 
   { P9V_BUILTIN_VEC_VSCEDPGT, P9V_BUILTIN_VSCEDPGT,
     RS6000_BTI_INTSI, RS6000_BTI_double, RS6000_BTI_double, 0 },
Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md	(revision 244388)
+++ gcc/config/rs6000/vsx.md	(working copy)
@@ -3426,6 +3426,16 @@
   "xsiexpdp %x0,%1,%2"
   [(set_attr "type" "fpsimple")])
 
+;; VSX Scalar Insert Exponent Double-Precision Floating Point Argument
+(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")]
+	 UNSPEC_VSX_SIEXPDP))]
+  "TARGET_P9_VECTOR && TARGET_64BIT"
+  "xsiexpdp %x0,%1,%2"
+  [(set_attr "type" "fpsimple")])
+
 ;; VSX Scalar Compare Exponents Double-Precision
 (define_expand "xscmpexpdp_<code>"
   [(set (match_dup 3)
Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 244388)
+++ gcc/doc/extend.texi	(working copy)
@@ -15127,6 +15127,8 @@ unsigned long long int scalar_extract_sig (double
 
 double
 scalar_insert_exp (unsigned long long int significand, unsigned long long int exponent);
+double
+scalar_insert_exp (double significand, unsigned long long int exponent);
 
 int scalar_cmp_exp_gt (double arg1, double arg2);
 int scalar_cmp_exp_lt (double arg1, double arg2);
@@ -15133,11 +15135,11 @@ int scalar_cmp_exp_lt (double arg1, double arg2);
 int scalar_cmp_exp_eq (double arg1, double arg2);
 int scalar_cmp_exp_unordered (double arg1, double arg2);
 
-int scalar_test_data_class (float source, unsigned int condition);
-int scalar_test_data_class (double source, unsigned int condition);
+bool scalar_test_data_class (float source, const int condition);
+bool scalar_test_data_class (double source, const int condition);
 
-int scalar_test_neg (float source);
-int scalar_test_neg (double source);
+bool scalar_test_neg (float source);
+bool scalar_test_neg (double source);
 
 int __builtin_byte_in_set (unsigned char u, unsigned long long set);
 int __builtin_byte_in_range (unsigned char u, unsigned int range);
@@ -15172,19 +15174,30 @@ random number.  The @code{__builtin_darn_raw} func
 64-bit raw random number.  The @code{__builtin_darn_32} function
 provides a 32-bit random number.
 
-The @code{scalar_extract_sig} and @code{scalar_insert_exp}
+The @code{scalar_extract_exp} and @code{scalar_extract_sig}
 functions require a 64-bit environment supporting ISA 3.0 or later.
-The @code{scalar_extract_exp} and @code{vec_extract_sig} built-in
-functions return the significand and exponent respectively of their
-@code{source} arguments.  The
-@code{scalar_insert_exp} built-in function returns a double-precision
+The @code{scalar_extract_exp} and @code{scalar_extract_sig} built-in
+functions return the significand and the biased exponent value
+respectively of their @code{source} arguments.
+Within the result returned by @code{scalar_extract_sig},
+the @code{0x10000000000000} bit is set if the
+function's @code{source} argument is in normalized form.
+Otherwise, this bit is set to 0.
+Note that the sign of the significand is not represented in the result
+returned from the @code{scalar_extract_sig} function.  Use the
+@code{scalar_test_neg} function to test the sign of its @code{double}
+argument.
+
+The @code{scalar_insert_exp} 
+function requires a 64-bit environment supporting ISA 3.0 or later.
+The @code{scalar_insert_exp} built-in function returns a double-precision
 floating point value that is constructed by assembling the values of its
 @code{significand} and @code{exponent} arguments.  The sign of the
 result is copied from the most significant bit of the
 @code{significand} argument.  The significand and exponent components
 of the result are composed of the least significant 11 bits of the
-@code{significand} argument and the least significant 52 bits of the
-@code{exponent} argument.
+@code{exponent} argument and the least significant 52 bits of the
+@code{significand} argument.
 
 The @code{scalar_cmp_exp_gt}, @code{scalar_cmp_exp_lt},
 @code{scalar_cmp_exp_eq}, and @code{scalar_cmp_exp_unordered} built-in
@@ -15193,11 +15206,11 @@ than, equal to, or not comparable to @code{arg2} r
 arguments are not comparable if one or the other equals NaN (not a
 number). 
 
-The @code{scalar_test_data_class} built-in functions return a non-zero
-value if any of the condition tests enabled by the value of the
-@code{condition} variable are true.  The
-@code{condition} argument must be an unsigned integer with value not
-exceeding 127.  The
+The @code{scalar_test_data_class} built-in function returns 1
+if any of the condition tests enabled by the value of the
+@code{condition} variable are true, and 0 otherwise.  The
+@code{condition} argument must be a compile-time constant integer with
+value not exceeding 127.  The
 @code{condition} argument is encoded as a bitmask with each bit
 enabling the testing of a different condition, as characterized by the
 following:
@@ -15211,11 +15224,9 @@ following:
 0x01    Test for -Denormal
 @end smallexample
 
-If all of the enabled test conditions are false, the return value is 0.
+The @code{scalar_test_neg} built-in function returns 1 if its
+@code{source} argument holds a negative value, 0 otherwise.
 
-The @code{scalar_test_neg} built-in functions return a non-zero value
-if their @code{source} argument holds a negative value.
-
 The @code{__builtin_byte_in_set} function requires a
 64-bit environment supporting ISA 3.0 or later.  This function returns
 a non-zero value if and only if its @code{u} argument exactly equals one of
@@ -18119,39 +18130,66 @@ elements of the vector result.
 The following built-in functions are available for the PowerPC family
 of processors, starting with ISA 3.0 or later (@option{-mcpu=power9}):
 @smallexample
-__vector int
+__vector unsigned int
 vec_extract_exp (__vector float source);
-__vector long long int
+__vector unsigned long long int
 vec_extract_exp (__vector double source);
 
-__vector int
+__vector unsigned int
 vec_extract_sig (__vector float source);
-__vector long long int
+__vector unsigned long long int
 vec_extract_sig (__vector double source);
 
 __vector float
 vec_insert_exp (__vector unsigned int significands,
                 __vector unsigned int exponents);
+__vector float
+vec_insert_exp (__vector unsigned float significands,
+                __vector unsigned int exponents);
 __vector double
 vec_insert_exp (__vector unsigned long long int significands,
                 __vector unsigned long long int exponents);
+__vector double
+vec_insert_exp (__vector unsigned double significands,
+                __vector unsigned long long int exponents);
 
-__vector int vec_test_data_class (__vector float source,
-                                  unsigned int condition);
-__vector long long int vec_test_data_class (__vector double source,
-                                            unsigned int condition);
+__vector bool int vec_test_data_class (__vector float source,
+                                       const int condition);
+__vector bool long long int vec_test_data_class (__vector double source,
+                                                 const int condition);
 @end smallexample
 
 The @code{vec_extract_sig} and @code{vec_extract_exp} built-in
-functions return vectors representing the significands and exponents
-of their @code{source} arguments respectively.  The
-@code{vec_insert_exp} built-in functions return a vector of single- or
-double-precision floating
+functions return vectors representing the significands and biased
+exponent values of their @code{source} arguments respectively.
+Within the result vector returned by @code{vec_extract_sig}, the
+@code{0x800000} bit of each vector element returned when the
+function's @code{source} argument is of type @code{float} is set to 1
+if the corresponding floating point value is in normalized form.
+Otherwise, this bit is set to 0.  When the @code{source} argument is
+of type @code{double}, the @code{0x10000000000000} bit within each of
+the result vector's elements is set according to the same rules.
+Note that the sign of the significand is not represented in the result
+returned from the @code{vec_extract_sig} function.  To extract the
+sign bits, use the
+@code{vec_cpsgn} function, which returns a new vector within which all
+of the sign bits of its second argument vector are overwritten with the
+sign bits copied from the coresponding elements of its first argument
+vector, and all other (non-sign) bits of the second argument vector
+are copied unchanged into the result vector.
+
+The @code{vec_insert_exp} built-in functions return a vector of
+single- or double-precision floating
 point values constructed by assembling the values of their
 @code{significands} and @code{exponents} arguments into the
-corresponding elements of the returned vector.  The sign of each
+corresponding elements of the returned vector.
+The sign of each
 element of the result is copied from the most significant bit of the
-corresponding entry within the @code{significands} argument.  The
+corresponding entry within the @code{significands} argument.
+Note that the relevant
+bits of the @code{significands} argument are the same, for both integer
+and floating point types.
+The
 significand and exponent components of each element of the result are
 composed of the least significant bits of the corresponding
 @code{significands} element and the least significant bits of the
@@ -18160,8 +18198,8 @@ corresponding @code{exponents} element.
 The @code{vec_test_data_class} built-in function returns a vector
 representing the results of testing the @code{source} vector for the
 condition selected by the @code{condition} argument.  The
-@code{condition} argument must be an unsigned integer with value not
-exceeding 127.  The
+@code{condition} argument must be a compile-time constant integer with
+value not exceeding 127.  The
 @code{condition} argument is encoded as a bitmask with each bit
 enabling the testing of a different condition, as characterized by the
 following:
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c	(working copy)
@@ -0,0 +1,20 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mcpu=power9" } */
+
+/* This test should succeed only on 64-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-final { scan-assembler "xsiexpdp" } } */
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c	(working copy)
@@ -0,0 +1,18 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mcpu=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)
+{
+  double significand = *significand_p;
+  unsigned long long int exponent = *exponent_p;
+
+  return __builtin_vec_scalar_insert_exp (significand, exponent); /* { dg-error "Builtin function __builtin_vsx_scalar_insert_exp_dp requires" } */
+}
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-5.c	(working copy)
@@ -0,0 +1,21 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mcpu=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 function __builtin_vec_scalar_insert_exp not supported in this compiler configuration" } */
+}
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-0.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-0.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (double *p)
 {
   double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-1.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-1.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (float *p)
 {
   float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-2.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-2.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (double *p)
 {
   double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-3.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-3.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (float *p)
 {
   float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-4.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-4.c	(working copy)
@@ -4,9 +4,10 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
-test_data_class (double *p, unsigned int condition_flag)
+bool
+test_data_class (double *p, const int condition_flag)
 {
   double source = *p;
 
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-5.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-5.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-5.c	(working copy)
@@ -4,9 +4,10 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
-test_data_class (float *p, unsigned int condition_flag)
+bool
+test_data_class (float *p, const int condition_flag)
 {
   float source = *p;
 
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-6.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-6.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-6.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power8" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (double *p)
 {
   double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-7.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-7.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-7.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power8" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_data_class (float *p)
 {
   float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-0.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-0.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_neg (double *p)
 {
   double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-1.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-1.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power9" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_neg (float *p)
 {
   float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-2.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-2.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power8" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_neg (float *p)
 {
   float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-3.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-3.c	(working copy)
@@ -4,8 +4,9 @@
 /* { dg-options "-mcpu=power8" } */
 
 #include <altivec.h>
+#include <stdbool.h>
 
-unsigned int
+bool
 test_neg (double *p)
 {
   double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-0.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-0.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector unsigned int
 get_exponents (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-1.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-1.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector unsigned long long int
 get_exponents (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-2.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-2.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector unsigned long long int
 get_exponents (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-3.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-3.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector unsigned int
 get_exponents (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-0.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-0.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector unsigned int
 get_significands (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-1.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-1.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector unsigned long long int
 get_significands (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-2.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-2.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector unsigned long long int
 get_significands (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-3.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-3.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector unsigned int
 get_significands (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-4.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-4.c	(working copy)
@@ -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-options "-mcpu=power9" } */
+
+#include <altivec.h>
+
+__vector float
+make_floats (__vector float *significands_p, 
+	     __vector unsigned int *exponents_p)
+{
+  __vector float significands = *significands_p;
+  __vector unsigned int exponents = *exponents_p;
+
+  return vec_insert_exp (significands, exponents);
+}
+
+/* { dg-final { scan-assembler "xviexpsp" } } */
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-5.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-5.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-5.c	(working copy)
@@ -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-options "-mcpu=power9" } */
+
+#include <altivec.h>
+
+__vector double
+make_doubles (__vector double *significands_p,
+	      __vector unsigned long long int *exponents_p)
+{
+  __vector double significands = *significands_p;
+  __vector unsigned long long int exponents = *exponents_p;
+
+  return vec_insert_exp (significands, exponents);
+}
+
+/* { dg-final { scan-assembler "xviexpdp" } } */
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-6.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-6.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-6.c	(working copy)
@@ -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-options "-mcpu=power8" } */
+
+#include <altivec.h>
+
+__vector float
+make_floats (__vector float *significands_p, 
+	     __vector unsigned int *exponents_p)
+{
+  __vector float significands = *significands_p;
+  __vector unsigned int exponents = *exponents_p;
+
+  return __builtin_vec_insert_exp (significands, exponents); /* { dg-error "Builtin function __builtin_vsx_insert_exp_sp requires" } */
+}
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-7.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-7.c	(revision 0)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-7.c	(working copy)
@@ -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-options "-mcpu=power8" } */
+
+#include <altivec.h>
+
+__vector double
+make_doubles (__vector double *significands_p,
+	      __vector unsigned long long int *exponents_p)
+{
+  __vector double significands = *significands_p;
+  __vector unsigned long long int exponents = *exponents_p;
+
+  return __builtin_vec_insert_exp (significands, exponents); /* { dg-error "Builtin function __builtin_vsx_insert_exp_dp requires" } */
+}
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-0.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-0.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-0.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector bool int
 get_data_class_flags (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-1.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-1.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector bool long long int
 get_data_class_flags (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-2.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-2.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector bool long long int
 get_data_class_flags (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-3.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-3.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector bool int
 get_data_class_flags (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-4.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-4.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector int
+__vector bool int
 get_data_class_flags (__vector float *p)
 {
   __vector float source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-5.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-5.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-5.c	(working copy)
@@ -5,7 +5,7 @@
 
 #include <altivec.h>
 
-__vector long long int
+__vector bool long long int
 get_data_class_flags (__vector double *p)
 {
   __vector double source = *p;
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-6.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-6.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-6.c	(working copy)
@@ -5,8 +5,8 @@
 
 #include <altivec.h>
 
-__vector int
-get_data_class_flags (__vector float *p, unsigned int condition_flag)
+__vector bool int
+get_data_class_flags (__vector float *p, int condition_flag)
 {
   __vector float source = *p;
 
Index: gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-7.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-7.c	(revision 244388)
+++ gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-7.c	(working copy)
@@ -5,8 +5,8 @@
 
 #include <altivec.h>
 
-__vector long long int
-get_data_class_flags (__vector double *p, unsigned int condition_flag)
+__vector bool long long int
+get_data_class_flags (__vector double *p, int condition_flag)
 {
   __vector double source = *p;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH,rs6000] Correct argument and result types for binary floating point built-in functions
  2017-01-19 23:12 [PATCH,rs6000] Correct argument and result types for binary floating point built-in functions Kelvin Nilsen
@ 2017-01-21  2:33 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2017-01-21  2:33 UTC (permalink / raw)
  To: Kelvin Nilsen; +Cc: gcc-patches

On Thu, Jan 19, 2017 at 04:07:47PM -0700, Kelvin Nilsen wrote:
> 
> This patch corrects several errors in a patch originally committed on
> 2016-08-10.  The following corrections are required to maintain
> compliance with "Power Architecture 64-Bit ELF V2 ABI Specification",
> also known as "OpenPOWER ABI for Linux Supplement".
> 
>   vector unsigned long long vec_extract_exp (vector double);
>     (instead of vector long long vec_extract_exp (vector double))
>   vector unsigned int vec_extract_exp (vector float);
>     (instead of vector int vec_extract_exp (vector float))
>   vector unsigned long long vec_extract_sig (vector double);
>     (instead of vector long long vec_extract_sig (vector double))
>   vector unsigned int vec_extract_sig (vector float);
>     (instead of vector int vec_extract_sig (vector float))
>   vector double vec_insert_exp (vector double, vector unsigned long long);
>   vector float vec_insert_exp (vector float, vector unsigned int);
>     (the above two are new forms, to complement the existing 
>      forms which take matching integer arguments)
>   vector bool int vec_test_data_class (vector float, const int);
>     (instead of vector int vec_test_class (vector float, unsigned int))
>   vector bool long long vec_test_data_class (vector double, const int);
>     (instead of vector long long vec_test_data_class (vector double, unsigned int))
> 
> Though the following functions are not defined in the ABI
> specification, they were also corrected to provide improved consistency
> with the corresponding vector functions:
> 
>   double scalar_insert_exp (double, unsigned long long);
>     (The above was added to complement the existing form: 
>      double scalar_insert_exp (unsigned long long int, unsigned long long int))
>   bool scalar_test_data_class (double, const int);
>     (instead of int scalar_test_data_class (double, unsigned int))
>   bool scalar_test_data_class (float, const int);
>     (instead of int scalar_test_data_class (float, unsigned int))
>   bool scalar_test_neg (double);
>     (instead of int scalar_test_neg (double))
>   bool scalar_test_neg (float);
>     (instead of int scalar_test_neg (float))
> 
> This patch has bootstrapped and tested on
> powerpcle-unknown-linux (little-endian) and on
> powerpc-unknown-linux (big-endian, with both -m32 and -m64 target
> option) with no regressions.  Is this ok for the trunk?

Yes, this looks good, thanks!  One triviality in the changelog:

> 	int" to "int".  Addeod new overloaded function forms "vector float

Typo.  Looks like a powerpc mnemonic ;-)


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-21  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 23:12 [PATCH,rs6000] Correct argument and result types for binary floating point built-in functions Kelvin Nilsen
2017-01-21  2:33 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).