From b0644d0a1e9c154a4fa7074b50804e63705a090a Mon Sep 17 00:00:00 2001 From: Justin Seyster Date: Tue, 26 Oct 2010 20:13:15 -0400 Subject: [PATCH] Added aop_t_float96(), which is (long double) on 32-bit systems. --- src/aop-type.c | 25 ++++++++++++++++++++++++- src/aop.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/aop-type.c b/src/aop-type.c index 3444f9c..9a2a1f9 100644 --- a/src/aop-type.c +++ b/src/aop-type.c @@ -173,6 +173,14 @@ static struct aop_type _aop_t_float64 = { .size = 8, }; +static struct aop_type _aop_t_float96 = { + .kind = ATK_FP, + .pointer_levels = 0, + .tag = NULL, + + .size = 12, +}; + static struct aop_type _aop_t_float128 = { .kind = ATK_FP, .pointer_levels = 0, @@ -515,9 +523,21 @@ aop_t_float64 () return &_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. + */ +const struct aop_type * +aop_t_float96 () +{ + return &_aop_t_float96; +} + /** * Return a type that will match quadruple-precision floating point - * types (long double in C). + * types (long double in C on a 64-bit system). * \return A type that will match quadruple-precision floating point * types. */ @@ -881,6 +901,9 @@ format_c_type (const struct aop_type *type, int n, char *output) case 8: BUF_PRINTF ("%s", "double"); break; + case 12: /* As seen on 32-bit systems. */ + BUF_PRINTF ("%s", "long double"); + break; case 16: BUF_PRINTF ("%s", "long double"); break; diff --git a/src/aop.h b/src/aop.h index be8b4f8..a4fae70 100644 --- a/src/aop.h +++ b/src/aop.h @@ -199,6 +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_cstring (); extern const struct aop_type *aop_t_struct (const char *tag); -- 2.34.1