*
* 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.
}
/**
- * 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.");
+ }
}
/**
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);
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;