This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: revised x86_64-pc-mingw32 patch

Richard Henderson <> wrote on 27.03.2007 16:56:40:

> On Tue, Mar 27, 2007 at 12:50:06PM +0200, Kai Tietz wrote:
> > I tried your patch with a mingw64 runtime and had especially problems 
> > floatings. Therefore I suggest the following code as replacement for 
> > yours. I built as cross on i386-linux and i386-cygwin and it seems to 
> > fine.
> You need to tell me *what* problems you had.

Problem one the @GOTPCREL issue as I wrote
>> The use of pic seems to be producing problems by the @GOTPCREL prefix, 
which the coff version of gas does not understand. But
>> AFAIS we need not producing pic code, because coff (PE) is by 
architecture position independent. Just the patch in is
>> necessary for having memonics with size to be relocated by PE loader.

Second one is the floating point issue while compiling libgcc as I wrote.
>> The register calling convention is may easier than my suggested code 
looks like. May this can be eased dramatically, but this
>> adopted code of existing x86_64 ABI code solved all the floating point 
failures I had. 

> I certainly cannot accept your wholesale copying of the Unix
> x86_64 code, which is *vastly* different to the MS ABI.

AFAIK, uses the x86_64 abi of MS the following general rules:
        a) Any function uses 4 general registers [RCX,RDX,R8,R9] (and do 
stack-safe too for them) as fast call.
        b) Any argument passed not having the size 1,2,4,8 have to be 
passed by memory reference.
        c) There is no splitting of larger values to multiple registers.
        d) The x87 register set is not used for passing.
        e) Floating point arguments are using XMM0L,XMM1L,XMM2L,XMM3L 
registers for fast call.
           For va_arg sake they are shadowed in the 4 general registers 
and shadow stack is reserved.
        f) Any parameter after the 4th is passed on stack.

AFAIK, MS does not have vector-types as a non structure type, nor does it 
have a TFmode "long double" type. My idea was just to provide these 
non-interferring types to gcc, to have faster code and easier support for 
allready existing gcc libraries. By the win32 and mingw32 header-set 
(beside of the non-MS complex and extended-doubles allready *very* gcc 
specific) no method passes a structure or a type bigger than 1,2,4, or 8 
bytes size.
Therefore I did not made out a good reason to fullfil the points b) and 
c). But may you can give me a hint, where this is so important ?
BTW what you call unix x86_64 code is more a reflection of the AMD x86_64 
abi from AFAICS.

 i.A. Kai Tietz

  OneVision Software Entwicklungs GmbH & Co. KG
  Dr.-Leo-Ritter-StraÃe 9 - 93049 Regensburg
  Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 -
  Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
  Handelsregister: HRA 6744, Amtsgericht Regensburg
  KomplementÃrin: OneVision Software Entwicklungs Verwaltungs GmbH
  Dr.-Leo-Ritter-StraÃe 9 â 93049 Regensburg
  Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÃftsfÃhrer: 
Ulrike DÃhler, Manuela Kluger

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]