Replaced float96 and float128 with just long_double.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 28 Oct 2010 20:32:21 +0000 (16:32 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 28 Oct 2010 20:32:21 +0000 (16:32 -0400)
These two types are not really distinct types: they are both just
80-bit floating point numbers padded to fit in machine registers.

src/aop-type.c
src/aop.h
test/plugin-float-types.c

index f1e233dc89c2ff0c65c7eb2116101d6e7d59f7df..435fdc13e8a8a6558c4e0c87b30e5514b03c748c 100644 (file)
@@ -368,8 +368,8 @@ aop_t_all_unsigned ()
  *
  * Standard floating point sizes are single-precision (float) and
  * double-precision (double).  This type will not match
- * quadruple-precision floating point types (you must use
- * aop_t_float128() to match quadruple-precision).
+ * higher-precision floating point types (you must use
+ * aop_t_long_double() to match GCC's long double).
  *
  * \return A type that will match any standard-sized floating point
  * type.
@@ -525,27 +525,25 @@ aop_t_float64 ()
 }
 
 /**
- * Return a type that will match 96-bit floating point types (long double
- * in C on a 32-bit system).
- * \return A type that will match quadruple-precision floating point
- * types.
+ * Return a type that will match <code>long double</code>.  Where
+ * supported, the <code>long double</code> type is actually 80-bits,
+ * though it is padded to 96 or 128 bits on different systems.
+ * \return A type that will match GCC's <code>long double</code>
+ * floating point type.
  */
 const struct aop_type *
-aop_t_float96 ()
+aop_t_long_double ()
 {
-  return &_aop_t_float96;
-}
-
-/**
- * Return a type that will match quadruple-precision floating point
- * types (long double in C on a 64-bit system).
- * \return A type that will match quadruple-precision floating point
- * types.
- */
-const struct aop_type *
-aop_t_float128 ()
-{
-  return &_aop_t_float128;
+  switch (int_size_in_bytes (long_double_type_node))
+    {
+    case 12:
+      return &_aop_t_float96;
+    case 16:
+      return &_aop_t_float128;
+    default:
+      fatal_error ("(InterAspect) This compiler does not supply a standard long"
+                  " double type.");
+    }
 }
 
 /**
index 819db7f4f383f9615d08ebe7876acd180a3b65b8..efc68fdc2a809542625ad25a313857c5b978bcea 100644 (file)
--- a/src/aop.h
+++ b/src/aop.h
@@ -199,8 +199,7 @@ extern const struct aop_type *aop_t_unsigned64 ();
 extern const struct aop_type *aop_t_unsigned128 ();
 extern const struct aop_type *aop_t_float32 ();
 extern const struct aop_type *aop_t_float64 ();
-extern const struct aop_type *aop_t_float96 ();
-extern const struct aop_type *aop_t_float128 ();
+extern const struct aop_type *aop_t_long_double ();
 extern const struct aop_type *aop_t_cstring ();
 extern const struct aop_type *aop_t_struct (const char *tag);
 extern const struct aop_type *aop_t_struct_ptr (const char *tag);
index 49877b25b7b3769f96913262c7934429a99236a2..c5746c9ea92c094a23ade08f4bffb4dcfacc03e3 100644 (file)
@@ -31,13 +31,8 @@ static unsigned int plugin_float()
   aop_filter_call_pc_by_param(pc, 0, aop_t_float64());
   aop_join_on(pc, plugin_join_on_call, "_advice_64");
 
-  /* (long double) is 96 bits on 32-bit machines but 128 bits on
-     64-bit machines. */
   pc = aop_match_function_call();
-  if (sizeof(long double) == 12)
-    aop_filter_call_pc_by_param(pc, 0, aop_t_float96());
-  else
-    aop_filter_call_pc_by_param(pc, 0, aop_t_float128());
+  aop_filter_call_pc_by_param(pc, 0, aop_t_long_double());
   aop_join_on(pc, plugin_join_on_call, "_advice_128");
 
   return 0;