[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] TinyCC for bootstrapping (with patches)
From: |
Christian Jullien |
Subject: |
Re: [Tinycc-devel] TinyCC for bootstrapping (with patches) |
Date: |
Mon, 14 Jan 2019 12:09:57 +0100 |
It looks true for float and double, see also long double which differs greatly
On Windows: 32 and 64 bit with cl
sizeof(float) 4
sizeof(double) 8
sizeof(long double) 8
On Linux ARM32 (Rpi)
sizeof(float) 4
sizeof(double) 8
sizeof(long double) 8
On Linux ARM64
sizeof(float) 4
sizeof(double) 8
sizeof(long double) 16
On Linux x64
address@hidden ~]$ gcc -m32 foo.c -o foo && ./foo
sizeof(float) 4
sizeof(double) 8
sizeof(long double) 12
address@hidden ~]$ gcc -m64 foo.c -o foo && ./foo
sizeof(float) 4
sizeof(double) 8
sizeof(long double) 16
-----Original Message-----
From: Tinycc-devel [mailto:address@hidden On Behalf Of Giovanni Mascellani
Sent: lundi 14 janvier 2019 11:09
To: address@hidden
Subject: Re: [Tinycc-devel] TinyCC for bootstrapping (with patches)
Hi,
Il 13/01/19 19:37, Daniel Glöckner ha scritto:
> I really like the idea of using a library to perform floating point
> operations and I also like that you made it optional.
Good!
> But it looks like you made the assumption that long double is an
> 80 bit floating point type. This is only true for x86-32. You have to
> look at the LDOUBLE_SIZE macro to determine which of float64_t,
> extFloat80_t, and float128_t to use (For x86-32 it is 12 instead of
> 10 because of padding).
I agree. As I said in my first email, for the moment the patch is
Intel-specific (and actually i386-specific). I was asking for preliminary
opinions, because if people immediately think that such a patch would never be
accepted, then I would not bother generalizing it.
BTW, it is correct to assume that for all architecture supported by tcc float
and double are always 32 and 64 bits?
Thanks, Giovanni.
--
Giovanni Mascellani <address@hidden> Postdoc researcher - Université Libre de
Bruxelles