Patchwork [RFA] : cygming, darwin, freebsd: Build libgcc2 TCmode complex functions

login
register
mail settings
Submitter IainS
Date Sept. 2, 2010, 9:48 a.m.
Message ID <CB76A8DB-48CA-4B0A-857E-36957B70A35C@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/63465/
State New
Headers show

Comments

IainS - Sept. 2, 2010, 9:48 a.m.
On 2 Sep 2010, at 06:08, Uros Bizjak wrote:
>> The testsuite is still running, but so far things look good.  Do you
>> expect to see any new PASSes?
>
> No, since TCmode tests in gcc.target/i386 are currently limited to  
> linux
> targets only.  I will enable them for other __float128 capable targets
> once Darwin catches up with TCmode libgcc2 support.


well, there are differences in approach;
In the system levels, Darwin uses fat libraries rather than separating  
m32 and m64 into different directories.

The 'old' symbol exports for a build of gcc  to run on Darwin* have to  
agree with those in the relevant system version of libgcc_s - which  
are defined by common export lists.   For 'new' symbols  this is  
immaterial.

However, some of the relevant symbols are not 'new' - we've been  
exporting them for years (via the LIB2_SIDITI_CONV_FUNCS mechanism) -  
so we must accommodate that.

It turns out that the libgcc Makefile does not honor LIB2FUNCS_EXCLUDE  
for these functions in the case of LIB2_SIDITI_CONV_FUNCS=yes.

I suspect that this an oversight - since it does honor it otherwise.

the patch below bootstrapped on i686-darwin9 (currently reg-testing)  
and has passed stage1 on i686-darwin8 and x86_64-darwin10

AFAICT the only targets using LIB2_SIDITI_CONV_FUNCS are MIPS and  
Darwin.

cheers,
Iain
Paolo Bonzini - Sept. 3, 2010, 1:10 p.m.
On 09/02/2010 11:48 AM, IainS wrote:
> Index: libgcc/Makefile.in
> ===================================================================
> --- libgcc/Makefile.in (revision 163732)
> +++ libgcc/Makefile.in (working copy)
> @@ -384,9 +384,9 @@ ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
> # functions are built with a wordsize of 4; the TImode functions are
> # built with the same labels, but a wordsize of 8.
>
> -sifuncs = $(subst XX,si,$(swfloatfuncs))
> -difuncs = $(subst XX,di,$(dwfloatfuncs))
> -tifuncs = $(subst XX,ti,$(dwfloatfuncs))
> +sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
> XX,si,$(swfloatfuncs)))
> +difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
> XX,di,$(dwfloatfuncs)))
> +tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
> XX,ti,$(dwfloatfuncs)))
>
> iter-items := $(sifuncs) $(difuncs) $(tifuncs)
> iter-labels := $(sifuncs) $(difuncs) $(difuncs)
> Index: gcc/config/i386/t-darwin
> ===================================================================
> --- gcc/config/i386/t-darwin (revision 163732)
> +++ gcc/config/i386/t-darwin (working copy)
> @@ -2,3 +2,4 @@ MULTILIB_OPTIONS = m64
> MULTILIB_DIRNAMES = x86_64
> LIB2_SIDITI_CONV_FUNCS=yes
> LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c
> +LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
>
>
>

Ok.

Paolo
IainS - Sept. 3, 2010, 1:39 p.m.
Uros,

On 3 Sep 2010, at 14:10, Paolo Bonzini wrote:

> On 09/02/2010 11:48 AM, IainS wrote:
>> Index: libgcc/Makefile.in
>> ===================================================================
>> --- libgcc/Makefile.in (revision 163732)
>> +++ libgcc/Makefile.in (working copy)
>> @@ -384,9 +384,9 @@ ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
>> # functions are built with a wordsize of 4; the TImode functions are
>> # built with the same labels, but a wordsize of 8.
>>
>> -sifuncs = $(subst XX,si,$(swfloatfuncs))
>> -difuncs = $(subst XX,di,$(dwfloatfuncs))
>> -tifuncs = $(subst XX,ti,$(dwfloatfuncs))
>> +sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
>> XX,si,$(swfloatfuncs)))
>> +difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
>> XX,di,$(dwfloatfuncs)))
>> +tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst
>> XX,ti,$(dwfloatfuncs)))
>>
>> iter-items := $(sifuncs) $(difuncs) $(tifuncs)
>> iter-labels := $(sifuncs) $(difuncs) $(difuncs)
>> Index: gcc/config/i386/t-darwin
>> ===================================================================
>> --- gcc/config/i386/t-darwin (revision 163732)
>> +++ gcc/config/i386/t-darwin (working copy)
>> @@ -2,3 +2,4 @@ MULTILIB_OPTIONS = m64
>> MULTILIB_DIRNAMES = x86_64
>> LIB2_SIDITI_CONV_FUNCS=yes
>> LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c
>> +LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
>>
>>
>>
>
> Ok.

this needs to be applied as part of your LIBGCC2_HAS_TF_MODE patch -  
could you do that?

... or split the darwin entry from your patch and I'll apply both -  
(when all is approved )

cheers,
Iain
Uros Bizjak - Sept. 3, 2010, 2:29 p.m.
On Fri, Sep 3, 2010 at 3:39 PM, IainS <developer@sandoe-acoustics.co.uk> wrote:

> this needs to be applied as part of your LIBGCC2_HAS_TF_MODE patch - could
> you do that?

Done (I hope I didn't mess something).

This is the final combined ChangeLog:

libgcc/ChangeLog:

2010-09-03  Uros Bizjak  <ubizjak@gmail.com>

	PR target/45476
	* Makefile.in (sifuncs, difuncs, tifuncs): Filter out
	LIB2FUNCS_EXCLUDE functions.

gcc/ChangeLog:

2010-09-03  Uros Bizjak  <ubizjak@gmail.com>
	    Iain Sandoe  <iains@gcc.gnu.org>

	PR target/45476
	* config/i386/t-darwin (LIB2FUNCS_EXCLUDE): New.
	* config/i386/darwin.h (LIBGCC2_HAS_TF_MODE,
	LIBGCC2_TF_CEXT, TF_SIZE): New defines.

gcc/testsuite/ChangeLog:

2010-09-03  Uros Bizjak  <ubizjak@gmail.com>

	PR target/45476
	* gcc.target/i386/float128-1.c: Enable for all x86 targets.
	* gcc.target/i386/float128-2.c: Ditto.

I have also enabled gcc.target/i386/float128-[12].c tests for all x86
targets, to mirror gcc.dg/torture/fp-int-convert-float128.c and to
prevent missing libgcc2 TFmode functions in future.

Enjoy __float128 floats ;)

Uros.

Patch

Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in	(revision 163732)
+++ libgcc/Makefile.in	(working copy)
@@ -384,9 +384,9 @@  ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
  # functions are built with a wordsize of 4; the TImode functions are
  # built with the same labels, but a wordsize of 8.

-sifuncs = $(subst XX,si,$(swfloatfuncs))
-difuncs = $(subst XX,di,$(dwfloatfuncs))
-tifuncs = $(subst XX,ti,$(dwfloatfuncs))
+sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$ 
(swfloatfuncs)))
+difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$ 
(dwfloatfuncs)))
+tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$ 
(dwfloatfuncs)))

  iter-items := $(sifuncs) $(difuncs) $(tifuncs)
  iter-labels := $(sifuncs) $(difuncs) $(difuncs)
Index: gcc/config/i386/t-darwin
===================================================================
--- gcc/config/i386/t-darwin	(revision 163732)
+++ gcc/config/i386/t-darwin	(working copy)
@@ -2,3 +2,4 @@  MULTILIB_OPTIONS = m64
  MULTILIB_DIRNAMES = x86_64
  LIB2_SIDITI_CONV_FUNCS=yes
  LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c
+LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf