From patchwork Tue Jun 5 22:21:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 27655 Received: (qmail 51389 invoked by alias); 5 Jun 2018 22:21:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 50936 invoked by uid 89); 5 Jun 2018 22:21:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=wishes X-HELO: mo20.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [RFC PATCH v2 3/3] RFC: powerpc64le: Convert default long double format to IEEE binary128 Date: Tue, 5 Jun 2018 19:21:20 -0300 Message-ID: <20180605222120.24696-4-gabriel@inconstante.eti.br> In-Reply-To: <20180605222120.24696-1-gabriel@inconstante.eti.br> References: <20180605222120.24696-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 X-ClientProxiedBy: EX3.emp.local (172.16.2.3) To EX4.emp.local (172.16.2.4) X-Ovh-Tracer-Id: 933371022916112067 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrjeeggddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu Do not commit! A commit similar to this would be added only when all other changes are ready, but without the temporary header redirections (explained below). I'm sending this in the RFC in case someone wishes to test the previous patches. A note about temporary header redirections: On powerpc64le, the implementation of long double with IEEE binary128 format is not complete. The redirections of the stdio.h functions are supposed to be implemented in bits/stdio-ldbl.h, however, we can only redirect all or none. In the meantime, bits/stdio-ieee128.h allows us to redirect part of them for testing purposes. */ --- libio/stdio.h | 13 ++++++++ sysdeps/ieee754/ldbl-128ibm-compat/Makefile | 9 +++++ .../ldbl-128ibm-compat/bits/stdio-ieee128.h | 38 ++++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/Implies-before | 1 + .../sysv/linux/powerpc/powerpc64/libc-le.abilist | 1 + 5 files changed, 62 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/bits/stdio-ieee128.h diff --git a/libio/stdio.h b/libio/stdio.h index 731f8e56f4..002f2ef33b 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -864,6 +864,19 @@ extern int __overflow (FILE *, int); # include #endif +/* XXX: DO NOT COMMIT. + + On powerpc64le, the implementation of long double with IEEE binary128 + format is not complete. The redirections of the stdio.h functions + are supposed to be implemented in bits/stdio-ldbl.h, however, we can + only redirect all or none. In the meantime, bits/stdio-ieee128.h + allows us to redirect part of them for testing purposes. */ +#include +#if __HAVE_DISTINCT_FLOAT128 && __LDBL_MANT_DIG__ == 113 && \ + ! defined __BUILDING_EXTRA_LDBL_FORMAT +# include +#endif + __END_DECLS #endif /* included. */ diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile index 87c3241622..ad82b42585 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile @@ -31,4 +31,13 @@ $(objpfx)test-printf-ibm128.out: \ $(objpfx)test-printf-ibm128 $(SHELL) $^ '$(test-program-prefix)' $@; \ $(evaluate-test) + +# XXX: DO NOT COMMIT. +# +# On powerpc64le, the implementation of long double with IEEE binary128 +# format is not complete. The redirections of the stdio.h functions +# are supposed to be implemented in bits/stdio-ldbl.h, however, we can +# only redirect all or none. In the meantime, bits/stdio-ieee128.h +# allows us to redirect part of them for testing purposes. */ +headers += bits/stdio-ieee128.h endif diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/bits/stdio-ieee128.h b/sysdeps/ieee754/ldbl-128ibm-compat/bits/stdio-ieee128.h new file mode 100644 index 0000000000..f3fa782a78 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/bits/stdio-ieee128.h @@ -0,0 +1,38 @@ +/* Redirections for stdio functions for -mabi=ieeelongdouble. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* XXX: DO NOT COMMIT. + + On powerpc64le, the implementation of long double with IEEE binary128 + format is not complete. The redirections of the stdio.h functions + are supposed to be implemented in bits/stdio-ldbl.h, however, we can + only redirect all or none. In the meantime, bits/stdio-ieee128.h + allows us to redirect part of them for testing purposes. */ + +#ifndef _STDIO_H +# error "Never include directly; use instead." +#endif + +#include + +#define __IBM128_REDIR(name) \ + extern __typeof (name) __ieee128_##name; \ + extern __typeof (name) name __asm (__ASMNAME ("__ieee128_" #name)); + +__IBM128_REDIR (vfprintf) +/* To be completed with the other functions. */ diff --git a/sysdeps/powerpc/powerpc64/le/Implies-before b/sysdeps/powerpc/powerpc64/le/Implies-before index 7c20db4e97..2139f4dae8 100644 --- a/sysdeps/powerpc/powerpc64/le/Implies-before +++ b/sysdeps/powerpc/powerpc64/le/Implies-before @@ -1,4 +1,5 @@ # On PowerPC we use the IBM extended long double format. +ieee754/ldbl-128ibm-compat ieee754/ldbl-128ibm ieee754/ldbl-opt ieee754/dbl-64 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist index 9869feb56b..d8e028ed13 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist @@ -2221,3 +2221,4 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 __ieee128_vfprintf F