From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 67E941F454 for ; Mon, 4 Nov 2019 17:47:09 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=eBGQBNvAmZN6un3b urj8X+MSo0OEP5kzpxsZr/GoZtkYVZEL4slYTQReqYcwazfkHTWQOCwjt4cgCqI/ WEZpyPdYwjzeLlyjUgCkcOw4nqB4uQR//+VK8wgzyZLx5vy9HHyz2ZvkS8rHqmVs XsqnvKfFNuKoS5nwwIGlylZQaRs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=HtmDp9S2htHW2Bea1bxlE/ uiSec=; b=Gkq6ZaVFFCSBW6QCP/KT0fwgWIhF+d/tq207j537B4MHBnvw5n4x/M zDsGL+CCeExARtd5ynzSpZbOKmRE2b0H+ibWhJZt4rDhxH5YD3KHtFIFXzfEFnHe 8z7xyNPoX6Q/K/kwu+Dtlk9UDx+h41aTRSsOBh2p7KqV9+gwqsCOw= Received: (qmail 127082 invoked by alias); 4 Nov 2019 17:47:07 -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 Received: (qmail 127071 invoked by uid 89); 4 Nov 2019 17:47:06 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx0a-001b2d01.pphosted.com Subject: Re: [PATCH v2 08/30] ldbl-128ibm-compat: Add wide character scanning functions To: "Gabriel F. T. Gomes" , libc-alpha@sourceware.org References: <20191025153410.15405-1-gabriel@inconstante.net.br> <20191025153410.15405-9-gabriel@inconstante.net.br> From: Paul E Murphy Message-ID: Date: Mon, 4 Nov 2019 11:46:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20191025153410.15405-9-gabriel@inconstante.net.br> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 10/25/19 10:33 AM, Gabriel F. T. Gomes wrote: > From: "Gabriel F. T. Gomes" > > No changes since v1. > > -- 8< -- > Similarly to what was done for regular character scanning functions, > this patch uses the new mode mask, SCANF_LDBL_USES_FLOAT128, in the > 'mode' argument of the wide characters scanning function, > __vfwscanf_internal (which is also extended to support scanning > floating-point values with IEEE binary128, by redirecting calls to > __wcstold_internal to __wcstof128_internal). > > Tested for powerpc64le. > --- > sysdeps/ieee754/ldbl-128ibm-compat/Makefile | 33 ++++++++++++++- > sysdeps/ieee754/ldbl-128ibm-compat/Versions | 8 ++++ > .../ldbl-128ibm-compat/ieee128-fwscanf.c | 35 ++++++++++++++++ > .../ldbl-128ibm-compat/ieee128-swscanf.c | 40 +++++++++++++++++++ > .../ldbl-128ibm-compat/ieee128-vfwscanf.c | 27 +++++++++++++ > .../ldbl-128ibm-compat/ieee128-vswscanf.c | 32 +++++++++++++++ > .../ldbl-128ibm-compat/ieee128-vwscanf.c | 27 +++++++++++++ > .../ldbl-128ibm-compat/ieee128-wscanf.c | 35 ++++++++++++++++ > .../ldbl-128ibm-compat/test-wscanf-ibm128.c | 1 + > .../ldbl-128ibm-compat/test-wscanf-ieee128.c | 1 + > .../test-wscanf-ldbl-compat.c | 10 +++++ > 11 files changed, 248 insertions(+), 1 deletion(-) > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fwscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-swscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfwscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vswscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vwscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/ieee128-wscanf.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ibm128.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ieee128.c > create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c With exception to some minor comments in my previous reviews, are there any additional suggestions from the community? The *printf and *scanf patches look ready to commit. Reviewed-By Paul E. Murphy > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile > index a1f0f7d74e..031ee0b38f 100644 > --- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile > @@ -1,3 +1,11 @@ > +ifeq ($(subdir),libio) > +ldbl-extra-routines += fwscanf \ > + swscanf \ > + wscanf \ > + vswscanf \ > + vwscanf > +endif > + > ifeq ($(subdir),stdio-common) > ldbl-extra-routines += printf_size \ > asprintf \ > @@ -23,7 +31,8 @@ ldbl-extra-routines += printf_size \ > sscanf \ > vfscanf \ > vscanf \ > - vsscanf > + vsscanf \ > + vfwscanf > > # Printing long double values with IEEE binary128 format reuses part > # of the internal float128 implementation (__printf_fp, __printf_fphex, > @@ -34,6 +43,7 @@ ldbl-extra-routines += printf_size \ > CFLAGS-vfprintf-internal.c += -mfloat128 -mabi=ibmlongdouble > CFLAGS-vfwprintf-internal.c += -mfloat128 -mabi=ibmlongdouble > CFLAGS-vfscanf-internal.c += -mfloat128 -mabi=ibmlongdouble > +CFLAGS-vfwscanf-internal.c += -mfloat128 -mabi=ibmlongdouble > > # Basic tests for the implementation of long double with IEEE binary128 > # format and for the related redirections in installed headers. > @@ -51,9 +61,18 @@ CFLAGS-test-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi > > $(objpfx)test-scanf-ieee128: gnulib-tests += $(f128-loader-link) > > +tests-internal += test-wscanf-ieee128 test-wscanf-ibm128 > +CFLAGS-test-wscanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi > +CFLAGS-test-wscanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi > + > +$(objpfx)test-wscanf-ieee128: gnulib-tests += $(f128-loader-link) > + > ifeq ($(run-built-tests),yes) > tests-special += $(objpfx)test-scanf-ieee128.out > tests-special += $(objpfx)test-scanf-ibm128.out > + > +tests-special += $(objpfx)test-wscanf-ieee128.out > +tests-special += $(objpfx)test-wscanf-ibm128.out > endif > > $(objpfx)test-scanf-ieee128.out: \ > @@ -68,6 +87,18 @@ $(objpfx)test-scanf-ibm128.out: \ > $(SHELL) $^ '$(test-program-prefix)' $@; \ > $(evaluate-test) > > +$(objpfx)test-wscanf-ieee128.out: \ > + ../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \ > + $(objpfx)test-wscanf-ieee128 > + $(SHELL) $^ '$(test-program-prefix)' $@; \ > + $(evaluate-test) > + > +$(objpfx)test-wscanf-ibm128.out: \ > + ../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \ > + $(objpfx)test-wscanf-ibm128 > + $(SHELL) $^ '$(test-program-prefix)' $@; \ > + $(evaluate-test) > + > tests-internal += test-printf-size-ieee128 test-printf-size-ibm128 > CFLAGS-test-printf-size-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi > CFLAGS-test-printf-size-ibm128.c += -mabi=ibmlongdouble -Wno-psabi OK > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions OK > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fwscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fwscanf.c > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-swscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-swscanf.c > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfwscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfwscanf. > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vswscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vswscanf.c > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vwscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vwscanf.c > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-wscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-wscanf.c OK > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ibm128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ibm128.c > new file mode 100644 > index 0000000000..ef21fc4741 > --- /dev/null > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ibm128.c > @@ -0,0 +1 @@ > +#include > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ieee128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ieee128.c > new file mode 100644 > index 0000000000..ef21fc4741 > --- /dev/null > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ieee128.c > @@ -0,0 +1 @@ > +#include > diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c > new file mode 100644 > index 0000000000..e93cf3b9bd > --- /dev/null > +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c > @@ -0,0 +1,10 @@ > +#define CHAR wchar_t > +#define L(x) L##x > +#define FSCANF fwscanf > +#define SSCANF swscanf > +#define SCANF wscanf > +#define VFSCANF vfwscanf > +#define VSSCANF vswscanf > +#define VSCANF vwscanf > +#define STRCPY wcscpy > +#include > OK