Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA Darwin]: Add push_dummy_call for i386
Date: Mon, 06 Jul 2009 07:08:00 -0000	[thread overview]
Message-ID: <E3F432CF-F5DE-4D3C-8408-28048D7C7669@adacore.com> (raw)
In-Reply-To: <200907031648.n63Gm7Wn019605@brahms.sibelius.xs4all.nl>


On Jul 3, 2009, at 6:48 PM, Mark Kettenis wrote:

>> Date: Fri, 3 Jul 2009 17:51:52 +0200
>> From: Tristan Gingold <gingold@adacore.com>
>>
>> Hi,
>>
>> Darwin i386 ABI is slightly different from the SVR4 one.  In  
>> particular
>> stack alignment is 16.  As a consquence, i386 Darwin can't use the  
>> standard
>> i386-tdeo.c push_dummy_call and this patch provides a Darwin  
>> version of this
>> call.
>>
>> Regtested on i386 Darwin.
>> Tristan.
>
> Tristan, can you provide unified diffs instead of context diffs?   
> It's much easier to read the unified ones.

Sure, I can ;-)

>> + static inline int
>> + i386_m128_p (struct type *type)
>> + {
>> +   return TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
>> +     && TYPE_LENGTH (type) == 16;
>> + }
>
> Any reason why this function must be inline?  Ever since the bright
> folks in the ISO committee decided to adpot different rules for things
> like static inline and extern inline than GCC, the use of inline makes
> me nervous.  And I believe modern compilers are very well capable
> themselves of deciding if static functions should be inlined or not.

I will remove the inline.

>> + /* Check whether TYPE must be 16-byte-aligned when passed as a
>> +    function argument.  16-byte vectors, _Decimal128 and  
>> structures or
>> +    unions containing such types must be 16-byte-aligned; other
>> +    arguments are 4-byte-aligned.  */
>
> Hmm, this function actually returns the alignment (as a number of
> bytes), but the comment suggests it's a predicate.  Can you adjust the
> comment?

Sure.

>> + static int
>> + i386_darwin_arg_type_alignment (struct type *type)
>> + {
>> +   type = check_typedef (type);
>> +   /* Passing arguments.
>> +      5.  The caller places 64-bit vectors (__m64) on the  
>> parameter area,
>> +          aligned to 8-byte boundaries.
>
> "on the parameter area"?  Probably a type.

I quoted LowLevelABI.pdf.  What is wrong in this sentence ?  (Keep in  
mind that I am not a native
english speaker!)

>>
>> +   for (write_pass = 0; write_pass < 2; write_pass++)
>> +     {
>> +       int args_space = 0;
>> +       int nbr_m128 = 0;
>
> nbr_m128?  Is that supposed to mean number of m128's?  If so, would
> you be so kind to reanem this variable num_m128?

Ok.

>>
>> *************** i386_darwin_init_abi (struct gdbarch_inf
>> *** 127,133 ****
>>   tdep->sc_reg_offset = i386_darwin_thread_state_reg_offset;
>>   tdep->sc_num_regs = i386_darwin_thread_state_num_regs;
>>
>> !   tdep->jb_pc_offset = 20;
>>
>>   set_solib_ops (gdbarch, &darwin_so_ops);
>> }
>> --- 255,266 ----
>>   tdep->sc_reg_offset = i386_darwin_thread_state_reg_offset;
>>   tdep->sc_num_regs = i386_darwin_thread_state_num_regs;
>>
>> !   tdep->jb_pc_offset = 48;
>> !
>> !   /* Although the i387 extended floating-point has only 80  
>> significant
>> !      bits, a `long double' actually takes up 128, probably to  
>> enforce
>> !      alignment.  */
>> !   set_gdbarch_long_double_bit (gdbarch, 128);
>
> This is true for the 32-bit Darwin ABI as well?

This is true only for the i386 Darwin ABI.  Darwin strictly follows  
the SVR4 ABI for x86_64.

Tristan.



  reply	other threads:[~2009-07-06  7:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-03 15:52 Tristan Gingold
2009-07-03 16:49 ` Mark Kettenis
2009-07-06  7:08   ` Tristan Gingold [this message]
2009-07-06 10:16     ` Mark Kettenis
2009-07-07  8:15       ` Tristan Gingold
2009-07-03 16:55 ` Joseph S. Myers
2009-07-06  7:00   ` Tristan Gingold
2009-07-04 15:31 ` H.J. Lu
2009-07-06  6:56   ` Tristan Gingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E3F432CF-F5DE-4D3C-8408-28048D7C7669@adacore.com \
    --to=gingold@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox