* [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64
@ 2022-05-20 9:06 Christophe Lyon
2022-05-20 9:06 ` [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point) Christophe Lyon
2022-05-20 16:17 ` [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Tom Tromey
0 siblings, 2 replies; 5+ messages in thread
From: Christophe Lyon @ 2022-05-20 9:06 UTC (permalink / raw)
To: gdb-patches
Hi,
I have just added support in GCC for Decimal Floating Point (DFP) on AArch64.
These two patches enable it in GDB:
1- Merge the necessary update to dfp.m4 from GCC, so that DFP is
enabled at configure time.
2- Add DFP support in GDB when calling or returning from a function
with DFP arguments or return value.
2022-04-28 Christophe Lyon <christophe.lyon@arm.com>
config/
* dfp.m4 (enable_decimal_float): Enable BID for AArch64.
libdecnumber/
* configure: Regenerate.
---
config/dfp.m4 | 21 ++++++++++++++++++++-
libdecnumber/configure | 3 ++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/config/dfp.m4 b/config/dfp.m4
index a137ddebf8c..d1d151b2da7 100644
--- a/config/dfp.m4
+++ b/config/dfp.m4
@@ -1,3 +1,21 @@
+# Copyright (C) 2010-2022 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any
+# later version.
+
+# GCC is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet])
dnl
dnl Enable C extension for decimal float if target supports it.
@@ -20,6 +38,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
],
[
case $1 in
+ aarch64* | \
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
@@ -37,7 +56,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
case x$enable_decimal_float in
xyes)
case $1 in
- i?86*-*-* | x86_64*-*-*)
+ aarch64* | i?86*-*-* | x86_64*-*-*)
enable_decimal_float=bid
;;
*)
diff --git a/libdecnumber/configure b/libdecnumber/configure
index 14c103a0718..87f3bd5e457 100755
--- a/libdecnumber/configure
+++ b/libdecnumber/configure
@@ -4761,6 +4761,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'." "$LINENO" 5 ;;
else
case $target in
+ aarch64* | \
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
@@ -4781,7 +4782,7 @@ fi
case x$enable_decimal_float in
xyes)
case $target in
- i?86*-*-* | x86_64*-*-*)
+ aarch64* | i?86*-*-* | x86_64*-*-*)
enable_decimal_float=bid
;;
*)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point)
2022-05-20 9:06 [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Christophe Lyon
@ 2022-05-20 9:06 ` Christophe Lyon
2022-05-24 7:55 ` Christophe Lyon
2022-05-20 16:17 ` [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Tom Tromey
1 sibling, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2022-05-20 9:06 UTC (permalink / raw)
To: gdb-patches
This small patch adds support for TYPE_CODE_DECFLOAT in
aapcs_is_vfp_call_or_return_candidate_1 and pass_in_v_vfp_candidate,
so that GDB for AArch64 knows how to pass DFP parameters and how to
read DFP results when calling a function.
Tested on aarch64-linux-gnu, with a GCC with DFP support in the PATH,
all of GDB's DFP tests pass.
---
gdb/aarch64-tdep.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index e35c083454d..67a3f96e1a7 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1470,6 +1470,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
switch (type->code ())
{
case TYPE_CODE_FLT:
+ case TYPE_CODE_DECFLOAT:
if (TYPE_LENGTH (type) > 16)
return -1;
@@ -1780,6 +1781,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
switch (arg_type->code ())
{
case TYPE_CODE_FLT:
+ case TYPE_CODE_DECFLOAT:
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
value_contents (arg).data ());
break;
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64
2022-05-20 9:06 [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Christophe Lyon
2022-05-20 9:06 ` [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point) Christophe Lyon
@ 2022-05-20 16:17 ` Tom Tromey
1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2022-05-20 16:17 UTC (permalink / raw)
To: Christophe Lyon via Gdb-patches
>>>>> "Christophe" == Christophe Lyon via Gdb-patches <gdb-patches@sourceware.org> writes:
Christophe> I have just added support in GCC for Decimal Floating Point (DFP) on AArch64.
Christophe> These two patches enable it in GDB:
If this went in to GCC, then it's fine here as well. Thank you.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point)
2022-05-20 9:06 ` [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point) Christophe Lyon
@ 2022-05-24 7:55 ` Christophe Lyon
2022-05-24 8:10 ` Luis Machado
0 siblings, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2022-05-24 7:55 UTC (permalink / raw)
To: gdb-patches, Luis Machado
On 5/20/22 11:06, Christophe Lyon wrote:
> This small patch adds support for TYPE_CODE_DECFLOAT in
> aapcs_is_vfp_call_or_return_candidate_1 and pass_in_v_vfp_candidate,
> so that GDB for AArch64 knows how to pass DFP parameters and how to
> read DFP results when calling a function.
>
> Tested on aarch64-linux-gnu, with a GCC with DFP support in the PATH,
> all of GDB's DFP tests pass.
More precisely, patch 1/2 has a side-effect of enabling the GDB DFP
tests, some of which fail without this patch 2/2:
gdb.base/dfp-test.exp: Call function with many _Decimal128 arguments.
gdb.base/dfp-test.exp: Call function with many _Decimal32 arguments.
gdb.base/dfp-test.exp: Call function with many _Decimal64 arguments.
gdb.base/dfp-test.exp: Call function with many mixed decimal float
arguments.
gdb.base/dfp-test.exp: Call function with mixed decimal float arguments
TEST.
gdb.base/dfp-test.exp: Call function with mixed decimal float arguments.
gdb.base/dfp-test.exp: backtrace function with correct _Decimal128
arguments.
gdb.base/dfp-test.exp: backtrace function with correct _Decimal32 arguments.
gdb.base/dfp-test.exp: backtrace function with correct _Decimal64 arguments.
OK?
Christophe
> ---
> gdb/aarch64-tdep.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index e35c083454d..67a3f96e1a7 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -1470,6 +1470,7 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type,
> switch (type->code ())
> {
> case TYPE_CODE_FLT:
> + case TYPE_CODE_DECFLOAT:
> if (TYPE_LENGTH (type) > 16)
> return -1;
>
> @@ -1780,6 +1781,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
> switch (arg_type->code ())
> {
> case TYPE_CODE_FLT:
> + case TYPE_CODE_DECFLOAT:
> return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
> value_contents (arg).data ());
> break;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point)
2022-05-24 7:55 ` Christophe Lyon
@ 2022-05-24 8:10 ` Luis Machado
0 siblings, 0 replies; 5+ messages in thread
From: Luis Machado @ 2022-05-24 8:10 UTC (permalink / raw)
To: Christophe Lyon, gdb-patches
On 5/24/22 08:55, Christophe Lyon wrote:
>
>
> On 5/20/22 11:06, Christophe Lyon wrote:
>> This small patch adds support for TYPE_CODE_DECFLOAT in
>> aapcs_is_vfp_call_or_return_candidate_1 and pass_in_v_vfp_candidate,
>> so that GDB for AArch64 knows how to pass DFP parameters and how to
>> read DFP results when calling a function.
>>
>> Tested on aarch64-linux-gnu, with a GCC with DFP support in the PATH,
>> all of GDB's DFP tests pass.
>
> More precisely, patch 1/2 has a side-effect of enabling the GDB DFP tests, some of which fail without this patch 2/2:
> gdb.base/dfp-test.exp: Call function with many _Decimal128 arguments.
> gdb.base/dfp-test.exp: Call function with many _Decimal32 arguments.
> gdb.base/dfp-test.exp: Call function with many _Decimal64 arguments.
> gdb.base/dfp-test.exp: Call function with many mixed decimal float arguments.
> gdb.base/dfp-test.exp: Call function with mixed decimal float arguments TEST.
> gdb.base/dfp-test.exp: Call function with mixed decimal float arguments.
> gdb.base/dfp-test.exp: backtrace function with correct _Decimal128 arguments.
> gdb.base/dfp-test.exp: backtrace function with correct _Decimal32 arguments.
> gdb.base/dfp-test.exp: backtrace function with correct _Decimal64 arguments.
>
> OK?
This is OK. Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-24 8:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 9:06 [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Christophe Lyon
2022-05-20 9:06 ` [PATCH 2/2] AArch64: add support for DFP (Decimal Floating point) Christophe Lyon
2022-05-24 7:55 ` Christophe Lyon
2022-05-24 8:10 ` Luis Machado
2022-05-20 16:17 ` [PATCH 1/2] Merge config/ changes from GCC, to enable DFP on AArch64 Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).