aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Nilsen <kelvin@gcc.gnu.org>2017-06-16 23:09:28 +0000
committerKelvin Nilsen <kelvin@gcc.gnu.org>2017-06-16 23:09:28 +0000
commit689264a666e7061dbce8c65a966e55b7ce62853c (patch)
tree94eb78fe9c571049fc860c85e3da88924feb538a
parent7e976d27121a043110b603688e16e3cacbeee72a (diff)
test cases pass on perch i thinkibm/92680e2
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/92680e2@249312 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/rs6000/vsx.md6
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c6
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c23
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c43
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c15
13 files changed, 68 insertions, 111 deletions
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 0ea819455e7..7d01bf311b7 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -3446,7 +3446,7 @@
(unspec:DI [(match_operand:KF 1 "altivec_register_operand" "v")]
UNSPEC_VSX_SXEXPDP))]
"TARGET_P9_VECTOR && TARGET_64BIT"
- "xsxexpqp %0,%x1"
+ "xsxexpqp %0,%1"
[(set_attr "type" "vecmove")])
;; VSX Scalar Extract Exponent Double-Precision
@@ -3464,7 +3464,7 @@
(unspec:TI [(match_operand:KF 1 "altivec_register_operand" "v")]
UNSPEC_VSX_SXSIGDP))]
"TARGET_P9_VECTOR && TARGET_64BIT"
- "xsxsigqp %0,%x1"
+ "xsxsigqp %0,%1"
[(set_attr "type" "vecmove")])
;; VSX Scalar Extract Significand Double-Precision
@@ -3493,7 +3493,7 @@
(match_operand:DI 2 "altivec_register_operand" "v")]
UNSPEC_VSX_SIEXPQP))]
"TARGET_P9_VECTOR && TARGET_64BIT"
- "xsiexpqp %0,%1,%0"
+ "xsiexpqp %0,%1,%2"
[(set_attr "type" "vecmove")])
;; VSX Scalar Insert Exponent Double-Precision
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 8ec43707d93..a5e31bf51ab 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
@@ -22,9 +22,9 @@ main ()
double x = (double) (0x1100LL << 50);
double z = (double) (0x1101LL << 37);
- if (get_exponent (&x) != 62)
+ if (get_unbiased_exponent (&x) != 62)
abort ();
- if (get_exponent (&z) != 49)
+ if (get_unbiased_exponent (&z) != 49)
abort ();
return 0;
}
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 8e1c022f538..212563c84b1 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
@@ -18,17 +18,19 @@ insert_exponent (double *significand_p,
return scalar_insert_exp (significand, exponent);
}
+#define BIAS_FOR_DOUBLE_EXP 1023
+
int
main ()
{
- unsigned long long int significand_1 = 0x18000000000000LL;
- unsigned long long int significand_2 = 0x1a000000000000LL;
+ 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;
double *significand_1_ptr = (double *) &significand_1;
double *significand_2_ptr = (double *) &significand_2;
- unsigned long long int exponent_1 = 53;
- unsigned long long int exponent_2 = 40;
double x = (double) (0x1100LL << 50);
double z = (double) (0x1101LL << 37);
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c
index e368393bd07..fc6c3817b98 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c
@@ -18,14 +18,16 @@ insert_exponent (unsigned __int128 *significand_p,
return scalar_insert_exp (significand, exponent);
}
+#define BIAS_FOR_QUAD_EXP 16383
+
int
main ()
{
/* most-significant bit @13, shift it to position 113 */
unsigned __int128 significand_1 = ((__int128) 0x1100) << 100;
unsigned __int128 significand_2 = ((__int128) 0x1101) << 100;
- unsigned long long int exponent_1 = 127;
- unsigned long long int exponent_2 = 124;
+ unsigned long long int exponent_1 = 126 + BIAS_FOR_QUAD_EXP;
+ unsigned long long int exponent_2 = 124 + BIAS_FOR_QUAD_EXP;
__ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 114);
__ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 112);
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c
index c9566a81d5c..5843880d382 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c
@@ -18,17 +18,19 @@ insert_exponent (__ieee128 *significand_p,
return scalar_insert_exp (significand, exponent);
}
+#define BIAS_FOR_QUAD_EXP 16383
+
int
main ()
{
/* most-significant bit @13, shift it to position 113 */
- unsigned __int128 significand_1 = ((__int 128) 0x1100) << 100;
- unsigned __int128 significand_2 = ((__int 128) 0x1101) << 100;
- unsigned long long int exponent_1 = 126;
- unsigned long long int exponent_2 = 124;
+ unsigned __int128 significand_1 = ((unsigned __int128) 0x1100) << 100;
+ unsigned __int128 significand_2 = ((unsigned __int128) 0x1101) << 100;
+ unsigned long long int exponent_1 = 126 + BIAS_FOR_QUAD_EXP;
+ unsigned long long int exponent_2 = 124 + BIAS_FOR_QUAD_EXP;
- double __ieee128 *significand_1_ptr = (double *) &signficand_1;
- double __ieee128 *significand_2_ptr = (double *) &signficand_2;
+ __ieee128 *significand_1_ptr = (__ieee128 *) &significand_1;
+ __ieee128 *significand_2_ptr = (__ieee128 *) &significand_2;
__ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 114);
__ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 112);
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c
index 7340bb3b9e1..0beb66ae643 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c
@@ -27,27 +27,8 @@ test_zero (float *p)
int
main ()
{
- /* A normalized number has a biased exponent value:
- * (my extrapolations for ieee128)
- * 1 to 254 in single format
- * 1 to 2046 in double format
- * 1 to 32766 in ieee128 format
- * Note that unbiased exponent value is:
- * biased_value - 127: single format (range: -126 to 127)
- * biased_value - 1023: double format (range: -1022 to 1023)
- * biased_value - 16,383: ieee128 format (range: -16382 to 16,383)
- *
- * For normalized numbers, the implied unit bit is 1. Normalized
- * numbers are interpreted as follows:
- * normalized_number = (-1)^S * s^E * (1.<fraction>)
- * (note that the significand is 1 plus the <fraction>)
- *
- * A Zero value has a biased exponent value of zero and a zero
- * fraction value. The sign may be either positive or negative.
- *
- * A Denormal number has a biased exponent value of zero and a
- * non-zero fraction value
- */
+ /* A Zero value has a biased exponent value of zero and a zero
+ * fraction value. The sign may be either positive or negative. */
unsigned int zero_plus_image = 0x0;
unsigned int zero_minus_image = 0x80000000;
unsigned int non_zero_image = 0x60000000;
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c
index 5bd67b2f795..90dd64637c9 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c
@@ -27,44 +27,13 @@ test_nan (__ieee128 *p)
int
main ()
{
- /* A normalized number has a biased exponent value:
- * (my extrapolations for ieee128)
- * 1 to 254 in single format
- * 1 to 2046 in double format
- * 1 to 32766 in ieee128 format
- * Note that unbiased exponent value is:
- * biased_value - 127: single format (range: -126 to 127)
- * biased_value - 1023: double format (range: -1022 to 1023)
- * biased_value - 16,383: ieee128 format (range: -16382 to 16,383)
- *
- * For normalized numbers, the implied unit bit is 1. Normalized
- * numbers are interpreted as follows:
- * normalized_number = (-1)^S * s^E * (1.<fraction>)
- * (note that the significand is 1 plus the <fraction>)
- *
- * A Zero value has a biased exponent value of zero and a zero
- * fraction value. The sign may be either positive or negative.
- *
- * A Denormal number has a biased exponent value of zero and a
- * non-zero fraction value
- *
- * Infinity is represented by a biased exponent value of:
- * 255 in single format
- * 2047 in double format
- * 32767 in ieee128 format
- * and a zero fraction value. The document doesn't say so, but
- * the difference between +infinity and -infinity is the value of
- * the sign bit.
- *
- * NaNs are represented with
- * the maximum biased exponent value and a non-zero fraction value.
- * The sign bit ignored.
- * If the high-order bit of the fraction field is 0, then the Nan
- * is a Signaling NaN. Otherwise, it is a Quiet NaN.
- */
+ /* NaN is represented with the maximum biased exponent value and a
+ * non-zero fraction value. The sign bit ignored. If the
+ * high-order bit of the fraction field is 0, then the NaN is a
+ * Signaling NaN. Otherwise, it is a Quiet NaN. */
__int128 signal_significand = (__int128) 0xffffffff;
- __int128 quiet_significand = (((__int128) 0x1) << 111) | 0xffffffff;
- __int128 a_number_significand = (((__int128) 0x1) << 111);
+ __int128 quiet_significand = (((__int128) 0x1) << 112) | 0xffffffff;
+ __int128 a_number_significand = (((__int128) 0x1) << 112);
unsigned long long int nan_exponent = 0x7fff;
unsigned long long int a_number_exponent = 16383;
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c
index 9f8becc73b0..e7f20152f64 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c
@@ -25,19 +25,19 @@ main ()
__vector float result;
/* 24 bits in significand, plus the sign bit: 0x80ffffff */
- significands[0] = 0x00800000; /* 1 */
- significands[1] = 0x00c00000; /* 3 */
- significands[2] = 0x80e00000; /* 7 */
- significands[3] = 0x80c00000; /* -3 */
+ significands[0] = 0x00800000; /* 1.0 */
+ significands[1] = 0x00c00000; /* 1.5 */
+ significands[2] = 0x80e00000; /* -1.75 */
+ significands[3] = 0x80c00000; /* -1.5 */
- exponents[0] = 127; /* 1.0 */
- exponents[1] = 128; /* 30.0 */
- exponents[2] = 129; /* 700.0 */
- exponents[3] = 125; /* -0.03 */
+ exponents[0] = 127; /* exp = 0: 1.0 */
+ exponents[1] = 128; /* exp = 1: 3.0 */
+ exponents[2] = 129; /* exp = 2: -7.0 */
+ exponents[3] = 125; /* exp = -2: -0.375 */
result = make_floats (significands_p, &exponents);
if ((result[0] != 1.0f) ||
- (result[1] != 30.0f) || (result[2] != 700.0f) || (result[3] != -0.03f))
+ (result[1] != 3.0f) || (result[2] != -7.0f) || (result[3] != -0.375f))
abort();
return 0;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c
index d280d5b3b2c..5bf2c9cfdaa 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c
@@ -25,14 +25,14 @@ main ()
__vector double result;
/* 53 bits in significand, plus the sign bit: 0x8000_0000_0000_0000 */
- significands[0] = 0x0010000000000000; /* 1 */
- significands[1] = 0x801c000000000000; /* -7 */
+ significands[0] = 0x0010000000000000; /* 1.0 */
+ significands[1] = 0x801c000000000000; /* -1.75 */
- exponents[0] = 1023; /* 1.0 */
- exponents[1] = 1021; /* -0.07 */
+ exponents[0] = 1023; /* exp = 0: 1.0 */
+ exponents[1] = 1021; /* exp = -2: -0.4375 (7/16) */
result = make_doubles (significands_p, &exponents);
- if ((result[0] != 1.0) || (result[1] != -0.07))
+ if ((result[0] != 1.0) || (result[1] != -0.4375))
abort();
return 0;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c
index 6f8b7928ac8..3c4a6f83ebf 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c
@@ -24,19 +24,19 @@ main ()
__vector float result;
/* 24 bits in significand, plus the sign bit: 0x80ffffff */
- significands[0] = 0x00800000; /* 1 */
- significands[1] = 0x00c00000; /* 3 */
- significands[2] = 0x80e00000; /* 7 */
- significands[3] = 0x80c00000; /* -3 */
+ significands[0] = 0x00800000; /* 1.0 */
+ significands[1] = 0x00c00000; /* 1.5 */
+ significands[2] = 0x80e00000; /* -1.75 */
+ significands[3] = 0x80c00000; /* -1.5 */
- exponents[0] = 127; /* 1.0 */
- exponents[1] = 128; /* 30.0 */
- exponents[2] = 129; /* 700.0 */
- exponents[3] = 125; /* -0.03 */
+ exponents[0] = 127; /* exp = 0: 1.0 */
+ exponents[1] = 128; /* exp = 1: 3.0.0 */
+ exponents[2] = 129; /* exp = 2: -7.0 */
+ exponents[3] = 125; /* exp = -2: -0.375 */
result = make_floats (&significands, &exponents);
if ((result[0] != 1.0f) ||
- (result[1] != 30.0f) || (result[2] != 700.0f) || (result[3] != -0.03f))
+ (result[1] != 3.0f) || (result[2] != -7.0f) || (result[3] != -0.375f))
abort();
return 0;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c
index 9c9b72784f9..5dc71951aee 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c
@@ -24,14 +24,14 @@ main ()
__vector double result;
/* 53 bits in significand, plus the sign bit: 0x8000_0000_0000_0000 */
- significands[0] = 0x0010000000000000; /* 1 */
- significands[1] = 0x801c000000000000; /* -7 */
+ significands[0] = 0x0010000000000000; /* 1.0 */
+ significands[1] = 0x801c000000000000; /* -1.75 */
- exponents[0] = 1023; /* 1.0 */
- exponents[1] = 1021; /* -0.07 */
+ exponents[0] = 1023; /* exp = 0: 1.0 */
+ exponents[1] = 1021; /* exp = -2: -0.4375 (7/16) */
result = make_doubles (&significands, &exponents);
- if ((result[0] != 1.0) || (result[1] != -0.07))
+ if ((result[0] != 1.0) || (result[1] != -0.4375))
abort();
return 0;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c
index 4deaa2f25ae..4be9bca17c6 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c
@@ -105,7 +105,7 @@ main ()
/* A Denormal number has a biased exponent value of zero and a
* non-zero fraction value. */
argument[0] = float_scalar_insert_exp (five_significand, 0);
- argument[4] = float_scalar_insert_exp (three_significand, 0);
+ argument[3] = float_scalar_insert_exp (three_significand, 0);
result = test_denormal (&argument);
if (!result[0] || result[1] || result[2] || !result[3])
abort ();
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c
index 60c3a1f1a35..5ccac12df87 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c
@@ -55,19 +55,19 @@ main ()
__vector bool long long int result;
unsigned long long int signaling_significand =
- 0x00017000000000000000000000000000;
+ 0x0017000000000000ULL;
unsigned long long int quiet_significand =
- 0x0001f000000000000000000000000000;
+ 0x001f000000000000ULL;
unsigned long long int one_significand =
- 0x00010000000000000000000000000000;
+ 0x0010000000000000ULL;
unsigned long long int three_significand =
- 0x00018000000000000000000000000000;
+ 0x0018000000000000ULL;
unsigned long long int five_significand =
- 0x00014000000000000000000000000000;
+ 0x0014000000000000ULL;
unsigned long long int zero_significand =
- 0x00000000000000000000000000000000;
+ 0x0000000000000000ULL;
unsigned long long int minus_zero_significand =
- 0x80000000000000000000000000000000;
+ 0x8000000000000000ULL;
nonspecial_argument[0] = -3.825;
nonspecial_argument[1] = 3.14159;
@@ -120,5 +120,6 @@ main ()
result = test_denormal (&nonspecial_argument);
if (result[0] || result[1])
abort ();
+ return 0;
}