From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82832 invoked by alias); 22 Aug 2016 10:48:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78051 invoked by uid 89); 22 Aug 2016 10:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.4 required=5.0 tests=BAYES_50,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=float32x, fNx, fltn_*, IEEE X-Spam-User: qpsmtpd, 2 recipients X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Aug 2016 10:47:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97D2F3C; Mon, 22 Aug 2016 03:49:30 -0700 (PDT) Received: from [10.2.206.222] (e108033-lin.cambridge.arm.com [10.2.206.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 36D6E3F5B0; Mon, 22 Aug 2016 03:47:52 -0700 (PDT) Subject: Re: Implement C _FloatN, _FloatNx types [version 6] To: Joseph Myers References: <20160817154244.GA39270@arm.com> Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org From: Matthew Wahab Message-ID: <57BAD856.1020206@foss.arm.com> Date: Mon, 22 Aug 2016 10:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg01515.txt.bz2 Hello, On 17/08/16 21:17, Joseph Myers wrote: > [Version 6 changes the testsuite to use dg-add-options systematically > to add any options that may be needed for the types to be supported; > this should allow the _Float128 and _Float64x tests to run for > powerpc64le, but I have not tested that; it could do with powerpc > maintainer testing that the tests do indeed run. It also has fixes > for the fp-int-convert issues pointed out in > . There are > no changes to the patch outside the testsuite and associated > documentation of effective-target and dg-add-options keywords.] > > > ISO/IEC TS 18661-3:2015 defines C bindings to IEEE interchange and > extended types, in the form of _FloatN and _FloatNx type names with > corresponding fN/FN and fNx/FNx constant suffixes and FLTN_* / FLTNX_* > macros. This patch implements support for this feature in > GCC. > There are some test failure on arm that appear to be due to this patch. > Index: gcc/testsuite/gcc.dg/torture/fp-int-convert-float32x-timode.c > =================================================================== > --- gcc/testsuite/gcc.dg/torture/fp-int-convert-float32x-timode.c (nonexistent) > +++ gcc/testsuite/gcc.dg/torture/fp-int-convert-float32x-timode.c (working copy) > @@ -0,0 +1,16 @@ > +/* Test floating-point conversions. _Float32x type with TImode. */ > +/* { dg-do run } */ > +/* { dg-options "" } */ > +/* { dg-add-options float32x } */ > +/* { dg-require-effective-target float32x_runtime } */ > + > +#define __STDC_WANT_IEC_60559_TYPES_EXT__ > +#include > +#include "fp-int-convert.h" > + > +int > +main (void) > +{ > + TEST_I_F(TItype, UTItype, _Float32, FLT32X_MANT_DIG, FLT32X_MAX_EXP); > + exit (0); > + This test fails with an abort at runtime. The other float32x tests pass. > Index: gcc/testsuite/gcc.dg/torture/fp-int-convert.h > =================================================================== > --- gcc/testsuite/gcc.dg/torture/fp-int-convert.h (revision 239543) > +++ gcc/testsuite/gcc.dg/torture/fp-int-convert.h (working copy) > @@ -15,20 +15,21 @@ typedef long TItype; > typedef unsigned long UTItype; > #endif > > -/* TEST_I_F(I, U, F, P) tests conversions between the pair of signed > - and unsigned integer types I and U and the floating-point type F, > - where P is the binary precision of the floating point type. We > - test conversions of the values 0, 1, 0x7...f, 0x8...0, 0xf...f. We > - also test conversions of values half way between two > - representable values (rounding both ways), just above half way, and > - just below half way. */ > -#define TEST_I_F(I, U, F, P) \ > +/* TEST_I_F(I, U, F, P, M) tests conversions between the pair of > + signed and unsigned integer types I and U and the floating-point > + type F, where P is the binary precision of the floating point type > + and M is the MAX_EXP value for that type (so 2^M overflows, 2^(M-1) > + does not). We test conversions of the values 0, 1, 0x7...f, > + 0x8...0, 0xf...f. We also test conversions of values half way > + between two representable values (rounding both ways), just above > + half way, and just below half way. */ > +#define TEST_I_F(I, U, F, P, M) \ This change makes gcc.dg/torture/arm-fp16-int-convert-{alt,ieee].c fail because they still pass four arguments to the macro, not five. Matthew