@@ -14352,22 +14352,10 @@ rs6000_invalid_binary_op (int op ATTRIBUTE_UNUSED,
if (!TARGET_FLOAT128_CVT)
{
- if ((mode1 == KFmode && mode2 == IFmode)
- || (mode1 == IFmode && mode2 == KFmode))
- return N_("__float128 and __ibm128 cannot be used in the same "
- "expression");
-
- if (TARGET_IEEEQUAD
- && ((mode1 == IFmode && mode2 == TFmode)
- || (mode1 == TFmode && mode2 == IFmode)))
- return N_("__ibm128 and long double cannot be used in the same "
- "expression");
-
- if (!TARGET_IEEEQUAD
- && ((mode1 == KFmode && mode2 == TFmode)
- || (mode1 == TFmode && mode2 == KFmode)))
- return N_("__float128 and long double cannot be used in the same "
- "expression");
+ if ((FLOAT128_IEEE_P (mode1) && FLOAT128_IBM_P (mode2))
+ || (FLOAT128_IBM_P (mode1) && FLOAT128_IEEE_P (mode2)))
+ return N_("Invalid mixing of IEEE 128-bit and IBM 128-bit floating "
+ "point types");
}
return NULL;
@@ -11,7 +11,5 @@ get_exponent (__ieee128 *p)
{
__ieee128 source = *p;
- return __builtin_vec_scalar_extract_exp (source); /* { dg-error "'__builtin_vsx_scalar_extract_expq' requires" } */
+ return __builtin_vec_scalar_extract_exp (source); /* { dg-error "'__builtin_vsx_scalar_extract_exp.*' requires" } */
}
-
-
@@ -11,5 +11,5 @@ get_significand (__ieee128 *p)
{
__ieee128 source = *p;
- return __builtin_vec_scalar_extract_sig (source); /* { dg-error "'__builtin_vsx_scalar_extract_sigq' requires" } */
+ return __builtin_vec_scalar_extract_sig (source); /* { dg-error "'__builtin_vsx_scalar_extract_sig.*' requires" } */
}
@@ -10,5 +10,5 @@ test_data_class (__ieee128 *p)
{
__ieee128 source = *p;
- return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_qp' requires" } */
+ return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_.*' requires" } */
}
@@ -10,5 +10,5 @@ test_neg (__ieee128 *p)
{
__ieee128 source = *p;
- return __builtin_vec_scalar_test_neg_qp (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_qp' requires" } */
+ return __builtin_vec_scalar_test_neg_qp (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_.*' requires" } */
}
new file mode 100644
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { powerpc*-*-linux* } } } */
+/* { dg-require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -Wno-psabi -mabi=ieeelongdouble -mlong-double-128" } */
+
+/* Test to make sure that __float128 and long double do not generate errors if
+ long double uses the IEEE 128-bit format. */
+__float128
+add (__float128 a, long double b)
+{
+ return a+b;
+}
+
+long double
+sub (long double a, __float128 b)
+{
+ return a-b;
+}
new file mode 100644
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { powerpc*-*-linux* } } } */
+/* { dg-require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx" } */
+
+/* Test to make sure that __float128 and __ibm128 cannot be combined
+ together. */
+__float128
+add (__float128 a, __ibm128 b)
+{
+ return a+b; /* { dg-error "IEEE 128-bit and IBM 128-bit floating point" } */
+}
+
+__ibm128
+sub (__ibm128 a, __float128 b)
+{
+ return a-b; /* { dg-error "IEEE 128-bit and IBM 128-bit floating point" } */
+}
@@ -1,15 +1,18 @@
/* { dg-do compile { target { powerpc*-*-linux* } } } */
-/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -mvsx" } */
+/* { dg-require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -Wno-psabi -mabi=ibmlongdouble -mlong-double-128" } */
-
-/* Test to make sure that __float128 and long double cannot be combined together. */
-__float128 add (__float128 a, long double b)
+/* Test to make sure that __float128 and long double cannot be combined
+ together, when long double uses the IBM extended double format, and
+ __float128 uses the IEEE 128-bit format. */
+__float128
+add (__float128 a, long double b)
{
- return a+b; /* { dg-error "__float128 and long double cannot be used in the same expression" } */
+ return a+b; /* { dg-error "IEEE 128-bit and IBM 128-bit floating point" } */
}
-__ibm128 sub (long double a, __float128 b)
+long double
+sub (long double a, __float128 b)
{
- return a-b; /* { dg-error "__float128 and long double cannot be used in the same expression" } */
+ return a-b; /* { dg-error "IEEE 128-bit and IBM 128-bit floating point" } */
}