PATCH: Add -mlong-double-128 and make it default for 64-bit Bionic

H.J. Lu hjl.tools@gmail.com
Fri Jan 31 17:10:00 GMT 2014


On Fri, Jan 31, 2014 at 8:52 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Jan 31, 2014 at 2:59 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
>> For 64-bit Android, long double is 128-bit IEEE-754 floating point type.
>> This patch adds -mlong-double-128 to i386 and makes it default for 64-bit
>> Bionic.  I only added MASK_LONG_DOUBLE_128.  I made -mlong-double-128,
>> -mlong-double-64 and -mlong-double-80 negate each other so that the
>> last one on command line wins.  It os OK since we don't support
>> -mlong-double-xxx in target attribute. I added some testcases to verify
>> it works correctly.  OK for trunk?
>>
>> Thanks.
>>
>>
>> H.J.
>> ---
>> gcc/
>>
>> 2014-01-30  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>         * config/i386/i386.c (flag_opts): Add -mlong-double-128.
>>         (ix86_option_override_internal): Default long double to 64-bit for
>>         32-bit Bionic and to 128-bit for 64-bit Bionic.
>>
>>         * config/i386/i386.h (LONG_DOUBLE_TYPE_SIZE): Use 128 if
>>         TARGET_LONG_DOUBLE_128 is true.
>>         (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Likewise.
>>
>>         * config/i386/i386.opt (mlong-double-80): Negate -mlong-double-64.
>>         (mlong-double-64): Negate -mlong-double-128.
>>         (mlong-double-128): New option.
>>
>>         * config/i386/i386-c.c (ix86_target_macros): Define
>>         __LONG_DOUBLE_128__ for TARGET_LONG_DOUBLE_128.
>>
>>         * doc/invoke.texi: Document -mlong-double-128.
>>
>> gcc/testsuite/
>>
>> 2014-01-30  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>         * gcc.target/i386/long-double-64-1.c: Verify __multf3 isn't used.
>>         * gcc.target/i386/long-double-64-4.c: Likewise.
>>         * gcc.target/i386/long-double-80-1.c: Likewise.
>>         * gcc.target/i386/long-double-80-2.c: Likewise.
>>         * gcc.target/i386/long-double-80-3.c: Likewise.
>>         * gcc.target/i386/long-double-80-4.c: Likewise.
>>         * gcc.target/i386/long-double-80-5.c: Likewise.
>>         * gcc.target/i386/long-double-64-2.c: Limit to ia32.  Verify
>>         __multf3 isn't used.
>>         * gcc.target/i386/long-double-64-3.c: Likewise.
>>         * gcc.target/i386/long-double-128-1.c: New test.
>>         * gcc.target/i386/long-double-128-2.c: Likewise.
>>         * gcc.target/i386/long-double-128-3.c: Likewise.
>>         * gcc.target/i386/long-double-128-4.c: Likewise.
>>         * gcc.target/i386/long-double-128-5.c: Likewise.
>>         * gcc.target/i386/long-double-128-6.c: Likewise.
>>         * gcc.target/i386/long-double-128-7.c: Likewise.
>>         * gcc.target/i386/long-double-128-8.c: Likewise.
>>         * gcc.target/i386/long-double-128-9.c: Likewise.
>>         * gcc.target/i386/long-double-64-5.c: Likewise.
>>         * gcc.target/i386/long-double-64-6.c: Likewise.
>>         * gcc.target/i386/long-double-64-7.c: Likewise.
>>         * gcc.target/i386/long-double-64-8.c: Likewise.
>>         * gcc.target/i386/long-double-64-9.c: Likewise.
>>         * gcc.target/i386/long-double-80-10.c: Likewise.
>>         * gcc.target/i386/long-double-80-8.c: Likewise.
>>         * gcc.target/i386/long-double-80-9.c: Likewise.
>
> OK for mainline as far as x86 is concerned, but please check if you
> also need Android maintainer approval.
>

Hi Maxim,

Can you take a look at this?

BTW, 64-bit Android psABI is on hjl/android branch at

https://github.com/hjl-tools/x86-64-psABI

Thanks.

-- 
H.J.



More information about the Gcc-patches mailing list