* [RFA] Support for calling functions with decimal float arguments in x86 and x86_64
@ 2008-02-13 16:39 Thiago Jung Bauermann
2008-02-20 17:41 ` Thiago Jung Bauermann
2008-03-04 19:51 ` [RFA] Support for calling functions with decimal float arguments in " Joel Brobecker
0 siblings, 2 replies; 7+ messages in thread
From: Thiago Jung Bauermann @ 2008-02-13 16:39 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
Hi,
The attached patch implements the calling convention for decimal
floating point in x86 32-bits and x86_64 (arguments and return value).
Now all DFP tests pass in these architectures.
For x86 it was very easy. The only case which needs special attention is
a function returning a _Decimal128 value, which uses struct return
convention.
For x86_64, I just had to update the classification function with the
proper class for the DFP types, as specified by the AMD64 ABI Draft
version 0.99.
This patch introduces no regression (tested in Linux/i686 and
Linux/x86_64). Ok to commit?
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
[-- Attachment #2: dfp-infcall-x86.diff --]
[-- Type: text/x-patch, Size: 2349 bytes --]
2008-02-13 Thiago Jung Bauermann <bauerman@br.ibm.com>
* amd64-tdep.c (amd64_classify): Add support for decimal float
types.
* i386-tdep.c (i386_return_value): Make 128-bit decimal float
use the struct return convention.
diff -r 4210c09bccd5 -r ada730f9adc3 gdb/amd64-tdep.c
--- a/gdb/amd64-tdep.c Mon Feb 11 03:15:07 2008 -0800
+++ b/gdb/amd64-tdep.c Wed Feb 13 14:03:14 2008 -0200
@@ -364,15 +364,19 @@ amd64_classify (struct type *type, enum
&& (len == 1 || len == 2 || len == 4 || len == 8))
class[0] = AMD64_INTEGER;
- /* Arguments of types float, double and __m64 are in class SSE. */
- else if (code == TYPE_CODE_FLT && (len == 4 || len == 8))
+ /* Arguments of types float, double, _Decimal32, _Decimal64 and __m64
+ are in class SSE. */
+ else if ((code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
+ && (len == 4 || len == 8))
/* FIXME: __m64 . */
class[0] = AMD64_SSE;
- /* Arguments of types __float128 and __m128 are split into two
- halves. The least significant ones belong to class SSE, the most
+ /* Arguments of types __float128, _Decimal128 and __m128 are split into
+ two halves. The least significant ones belong to class SSE, the most
significant one to class SSEUP. */
- /* FIXME: __float128, __m128. */
+ else if (code == TYPE_CODE_DECFLOAT && len == 16)
+ /* FIXME: __float128, __m128. */
+ class[0] = AMD64_SSE, class[1] = AMD64_SSEUP;
/* The 64-bit mantissa of arguments of type long double belongs to
class X87, the 16-bit exponent plus 6 bytes of padding belongs to
diff -r 4210c09bccd5 -r ada730f9adc3 gdb/i386-tdep.c
--- a/gdb/i386-tdep.c Mon Feb 11 03:15:07 2008 -0800
+++ b/gdb/i386-tdep.c Wed Feb 13 14:03:14 2008 -0200
@@ -1579,10 +1579,12 @@ i386_return_value (struct gdbarch *gdbar
{
enum type_code code = TYPE_CODE (type);
- if ((code == TYPE_CODE_STRUCT
- || code == TYPE_CODE_UNION
- || code == TYPE_CODE_ARRAY)
- && !i386_reg_struct_return_p (gdbarch, type))
+ if (((code == TYPE_CODE_STRUCT
+ || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_ARRAY)
+ && !i386_reg_struct_return_p (gdbarch, type))
+ /* 128-bit decimal float uses the struct return convention. */
+ || (code == TYPE_CODE_DECFLOAT && TYPE_LENGTH (type) == 16))
{
/* The System V ABI says that:
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float arguments in x86 and x86_64
2008-02-13 16:39 [RFA] Support for calling functions with decimal float arguments in x86 and x86_64 Thiago Jung Bauermann
@ 2008-02-20 17:41 ` Thiago Jung Bauermann
2008-02-20 23:54 ` [RFA] Support for calling functions with decimal float ?arguments ?in " Mark Kettenis
2008-03-04 19:51 ` [RFA] Support for calling functions with decimal float arguments in " Joel Brobecker
1 sibling, 1 reply; 7+ messages in thread
From: Thiago Jung Bauermann @ 2008-02-20 17:41 UTC (permalink / raw)
To: gdb-patches
On Wed, 2008-02-13 at 14:38 -0200, Thiago Jung Bauermann wrote:
> The attached patch implements the calling convention for decimal
> floating point in x86 32-bits and x86_64 (arguments and return value).
Ping? I am hoping to get this in before the branch...
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float ?arguments ?in x86 and x86_64
2008-02-20 17:41 ` Thiago Jung Bauermann
@ 2008-02-20 23:54 ` Mark Kettenis
2008-02-21 2:25 ` Thiago Jung Bauermann
0 siblings, 1 reply; 7+ messages in thread
From: Mark Kettenis @ 2008-02-20 23:54 UTC (permalink / raw)
To: bauerman; +Cc: gdb-patches
> From: "Thiago Jung Bauermann" <bauerman@br.ibm.com>
> Date: Wed, 20 Feb 2008 14:41:17 -0300
>
> On Wed, 2008-02-13 at 14:38 -0200, Thiago Jung Bauermann wrote:
> > The attached patch implements the calling convention for decimal
> > floating point in x86 32-bits and x86_64 (arguments and return value).
>
> Ping? I am hoping to get this in before the branch...
The diff looked ok to me. Only wondered whether there is some
semi-official ABI specification for i386 for this, but even if there
isn't, this diff makes sense.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float ?arguments ?in x86 and x86_64
2008-02-20 23:54 ` [RFA] Support for calling functions with decimal float ?arguments ?in " Mark Kettenis
@ 2008-02-21 2:25 ` Thiago Jung Bauermann
2008-02-21 9:20 ` Thiago Jung Bauermann
0 siblings, 1 reply; 7+ messages in thread
From: Thiago Jung Bauermann @ 2008-02-21 2:25 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Thu, 2008-02-21 at 00:54 +0100, Mark Kettenis wrote:
> > From: "Thiago Jung Bauermann" <bauerman@br.ibm.com>
> > Date: Wed, 20 Feb 2008 14:41:17 -0300
> >
> > On Wed, 2008-02-13 at 14:38 -0200, Thiago Jung Bauermann wrote:
> > > The attached patch implements the calling convention for decimal
> > > floating point in x86 32-bits and x86_64 (arguments and return value).
> >
> > Ping? I am hoping to get this in before the branch...
>
> The diff looked ok to me. Only wondered whether there is some
> semi-official ABI specification for i386 for this, but even if there
> isn't, this diff makes sense.
Ben Elliston implemented this in x86 and x86_64. I had a brief e-mail
conversation with him about it:
<bauermann> However, I couldn't find an ABI spec for DFP in x86. It
<bauermann> seems that it's very simple, just throwing all arguments in
>bauermann> the stack while respecting word alignment.
<bje> Conversely, I don't think I did write up an ABI spec for x86.
<bje> But my recollection is that you are right: we just throw
<bje> everything onto the stack.
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float ?arguments ?in x86 and x86_64
2008-02-21 9:20 ` Thiago Jung Bauermann
@ 2008-02-21 4:14 ` Thiago Jung Bauermann
0 siblings, 0 replies; 7+ messages in thread
From: Thiago Jung Bauermann @ 2008-02-21 4:14 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Wed, 2008-02-20 at 23:25 -0300, Thiago Jung Bauermann wrote:
> Ben Elliston implemented this in x86 and x86_64.
Well, by "this" I mean the gcc implementation, one year ago. I wasn't
clear.
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float ?arguments ?in x86 and x86_64
2008-02-21 2:25 ` Thiago Jung Bauermann
@ 2008-02-21 9:20 ` Thiago Jung Bauermann
2008-02-21 4:14 ` Thiago Jung Bauermann
0 siblings, 1 reply; 7+ messages in thread
From: Thiago Jung Bauermann @ 2008-02-21 9:20 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Wed, 2008-02-20 at 23:25 -0300, Thiago Jung Bauermann wrote:
> Ben Elliston implemented this in x86 and x86_64.
Well, by "this" I mean the gcc implementation, one year ago. I wasn't
clear.
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Support for calling functions with decimal float arguments in x86 and x86_64
2008-02-13 16:39 [RFA] Support for calling functions with decimal float arguments in x86 and x86_64 Thiago Jung Bauermann
2008-02-20 17:41 ` Thiago Jung Bauermann
@ 2008-03-04 19:51 ` Joel Brobecker
1 sibling, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2008-03-04 19:51 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: gdb-patches
> 2008-02-13 Thiago Jung Bauermann <bauerman@br.ibm.com>
>
> * amd64-tdep.c (amd64_classify): Add support for decimal float
> types.
> * i386-tdep.c (i386_return_value): Make 128-bit decimal float
> use the struct return convention.
As discussed a while ago, I put this change in the 6.8 branch.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-03-04 19:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13 16:39 [RFA] Support for calling functions with decimal float arguments in x86 and x86_64 Thiago Jung Bauermann
2008-02-20 17:41 ` Thiago Jung Bauermann
2008-02-20 23:54 ` [RFA] Support for calling functions with decimal float ?arguments ?in " Mark Kettenis
2008-02-21 2:25 ` Thiago Jung Bauermann
2008-02-21 9:20 ` Thiago Jung Bauermann
2008-02-21 4:14 ` Thiago Jung Bauermann
2008-03-04 19:51 ` [RFA] Support for calling functions with decimal float arguments in " Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox