From patchwork Thu Oct 10 22:55:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1174820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510707-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bLwqzBdp"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 46q5zD3kWJz9sPF for ; Fri, 11 Oct 2019 09:55:50 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=OGljd+2Yhh2GmZ3XOiercNeKh6SAnUkLHMBlkOhKUC4CipFZ7lfmZ bEbZEDUkHT0qomGTBgXr/3hOZMaplYeOjIxpMbU0/6bNuYlSAQ3GXL89mNNIuv49 7r2kpH+XYjaueDGgHqr/s/IouCGBTMEWc2F8A6ytZ3iTIgnrPdeIgU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=kWnr+1QHfKUqNAkhUe2j0zyaa08=; b=bLwqzBdpejeWSlR6YhtK W6dSlUGAkj0RcMhnWjnuGLFnZdEv7d7JSt3kTzWJS74pnUfgcLdOqb8Vpdn8AC6H YJCU7KelOl3E5vyycxI9Q0eSKaSdfredRmSJLFdfIZYSmsBb7wWp+bbQo7LthnfN 832wb9Tfkd2+gbvv+l812Jk= Received: (qmail 34611 invoked by alias); 10 Oct 2019 22:55:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 34602 invoked by uid 89); 10 Oct 2019 22:55:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=Draft, Technical, dfp, Minimum X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Oct 2019 22:55:39 +0000 IronPort-SDR: f+AXuDfbV3bJAnS86enaDzSBJq/cg1Tx+dW3FfHo6n6wN1WXo3KxoUjUfL5s7wL0mlPYUnIcXW 23U3TmWn5ciIB6Y5LLgBRF9Lp84ewb1e9nYtZYU3YTPJ7zGDI1aABHR0PInDUKc7SOEH1KvTQV 50dVLy8+WCu4ohIkkfRvPHORtktYvTvtWk83CNBVEe93kZAiJEKSrjhfZqnAnbPOdCu3Yi4Ukg HMEEFJoR/Jcq+CL8etmgGBHHpVlSGeAk6G4t+4vr1/TCjahWYwxcvGq6W/f05hUqQwjseCIa15 4SQ= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 10 Oct 2019 14:55:37 -0800 IronPort-SDR: eR1uQdOgSUdnrRNqq/n8CXXSGRP6PclwuIywdgVUx3haGI+rigKQ3C8U+V4p9jKrliRYFcvnAA 976aqmiA0MDivXoAr3K+U277dqtWbp/8AmWiTZzaaR2UMcOrUemCHxkjDD8WAwh0VJ/VZHPkZX 1RWIZYXru3Cxy2yX76rOj7lNLaxj2/E89CKqxdhOKI2PmxH+GJ1Aamo/wIEFt6HRcJtuNG9Z9k wD6lBvpwR95cTMfltSo0kvPAvLQH7iTo6wUsVVVYZLM7HgIJnELNZ218UaEYNcjD5kzznrIfcU U+4= Date: Thu, 10 Oct 2019 22:55:31 +0000 From: Joseph Myers To: Subject: Update DFP macros in float.h for C2x and TS 18661-2 Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 GCC's includes various macros for decimal floating-point types, defined if __STDC_WANT_DEC_FP__, as defined in TR 24732. TS 18661-2 and C2X make some changes to those macros. In TS 18661-2, they are to be defined if __STDC_WANT_IEC_60559_DFP_EXT__, and the *_SUBNORMAL_MIN macros are renamed to *_TRUE_MIN. In C2X, the macros are to be defined whenever DFP is supported, without needing any feature test macro to be defined. This patch updates the header accordingly. There is no existing predefined macro for whether the target supports DFP; rather than adding a new macro for that purpose, this patch changes the predefined macros used in so that they are only defined when DFP is supported and thus can be used as conditionals; this is the same way predefined macros for _FloatN and _FloatNx types work. Although formally TR 24732 and TS 18661-2 say nothing about implementations lacking DFP support, it seems appropriate to avoid defining the macros in , in the absence of DFP support, even if the respective feature test macros are defined. Bootstrapped with no regressions on x86_64-pc-linux-gnu. Also tested the c2x-float-no-dfp-* tests for aarch64-linux-gnu to make sure they do pass in a no-DFP configuration. Applied to mainline. gcc: 2019-10-10 Joseph Myers * ginclude/float.h [!__DEC32_MANT_DIG__]: Do not define DFP macros. [__STDC_WANT_IEC_60559_DFP_EXT__ || __STDC_VERSION__ > 201710L]: Also define DFP macros for these conditions. [!__STDC_WANT_DEC_FP__] (DEC32_SUBNORMAL_MIN, DEC64_SUBNORMAL_MIN, DEC128_SUBNORMAL_MIN): Do not define. [__STDC_WANT_IEC_60559_DFP_EXT__ || __STDC_VERSION__ > 201710L] (DEC32_TRUE_MIN, DEC64_TRUE_MIN, DEC128_TRUE_MIN): New macros. gcc/c-family: 2019-10-10 Joseph Myers * c-cppbuiltin.c (c_cpp_builtins): Do not define macros for DFP types if DFP not supported. gcc/testsuite: 2019-10-10 Joseph Myers * gcc.dg/c11-float-dfp-1.c, gcc.dg/c2x-float-no-dfp-1.c, gcc.dg/c2x-float-no-dfp-2.c, gcc.dg/dfp/c2x-float-dfp-1.c, gcc.dg/dfp/c2x-float-dfp-2.c, gcc.dg/dfp/c2x-float-dfp-3.c, gcc.dg/dfp/tr24732-float-dfp-1.c, gcc.dg/dfp/ts18661-2-float-dfp-1.c: New tests. Index: gcc/c-family/c-cppbuiltin.c =================================================================== --- gcc/c-family/c-cppbuiltin.c (revision 276841) +++ gcc/c-family/c-cppbuiltin.c (working copy) @@ -1151,10 +1151,16 @@ c_cpp_builtins (cpp_reader *pfile) csuffix, FLOATN_NX_TYPE_NODE (i)); } - /* For decfloat.h. */ - builtin_define_decimal_float_constants ("DEC32", "DF", dfloat32_type_node); - builtin_define_decimal_float_constants ("DEC64", "DD", dfloat64_type_node); - builtin_define_decimal_float_constants ("DEC128", "DL", dfloat128_type_node); + /* For float.h. */ + if (targetm.decimal_float_supported_p ()) + { + builtin_define_decimal_float_constants ("DEC32", "DF", + dfloat32_type_node); + builtin_define_decimal_float_constants ("DEC64", "DD", + dfloat64_type_node); + builtin_define_decimal_float_constants ("DEC128", "DL", + dfloat128_type_node); + } /* For fixed-point fibt, ibit, max, min, and epsilon. */ if (targetm.fixed_point_supported_p ()) Index: gcc/ginclude/float.h =================================================================== --- gcc/ginclude/float.h (revision 276841) +++ gcc/ginclude/float.h (working copy) @@ -426,9 +426,13 @@ see the files COPYING3 and COPYING.RUNTIME respect #endif /* __STDC_WANT_IEC_60559_TYPES_EXT__. */ -#ifdef __STDC_WANT_DEC_FP__ -/* Draft Technical Report 24732, extension for decimal floating-point - arithmetic: Characteristic of decimal floating types . */ +#ifdef __DEC32_MANT_DIG__ +#if (defined __STDC_WANT_DEC_FP__ \ + || defined __STDC_WANT_IEC_60559_DFP_EXT__ \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) +/* C2X; formerly Technical Report 24732, extension for decimal + floating-point arithmetic: Characteristic of decimal floating types + , and TS 18661-2. */ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef DEC32_MANT_DIG @@ -480,14 +484,6 @@ see the files COPYING3 and COPYING.RUNTIME respect #define DEC64_MIN __DEC64_MIN__ #define DEC128_MIN __DEC128_MIN__ -/* Minimum subnormal positive floating-point number. */ -#undef DEC32_SUBNORMAL_MIN -#undef DEC64_SUBNORMAL_MIN -#undef DEC128_SUBNORMAL_MIN -#define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__ -#define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__ -#define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__ - /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and @@ -502,6 +498,33 @@ see the files COPYING3 and COPYING.RUNTIME respect #undef DEC_EVAL_METHOD #define DEC_EVAL_METHOD __DEC_EVAL_METHOD__ -#endif /* __STDC_WANT_DEC_FP__ */ +#endif /* __STDC_WANT_DEC_FP__ || __STDC_WANT_IEC_60559_DFP_EXT__ || C2X. */ +#ifdef __STDC_WANT_DEC_FP__ + +/* Minimum subnormal positive floating-point number. */ +#undef DEC32_SUBNORMAL_MIN +#undef DEC64_SUBNORMAL_MIN +#undef DEC128_SUBNORMAL_MIN +#define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__ +#define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__ +#define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__ + +#endif /* __STDC_WANT_DEC_FP__. */ + +#if (defined __STDC_WANT_IEC_60559_DFP_EXT__ \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) + +/* Minimum subnormal positive floating-point number. */ +#undef DEC32_TRUE_MIN +#undef DEC64_TRUE_MIN +#undef DEC128_TRUE_MIN +#define DEC32_TRUE_MIN __DEC32_SUBNORMAL_MIN__ +#define DEC64_TRUE_MIN __DEC64_SUBNORMAL_MIN__ +#define DEC128_TRUE_MIN __DEC128_SUBNORMAL_MIN__ + +#endif /* __STDC_WANT_IEC_60559_DFP_EXT__ || C2X. */ + +#endif /* __DEC32_MANT_DIG__ */ + #endif /* _FLOAT_H___ */ Index: gcc/testsuite/gcc.dg/c11-float-dfp-1.c =================================================================== --- gcc/testsuite/gcc.dg/c11-float-dfp-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/c11-float-dfp-1.c (working copy) @@ -0,0 +1,5 @@ +/* Test DFP macros not defined in for C11. */ +/* { dg-do compile } */ +/* { dg-options "-std=c11" } */ + +#include "c2x-float-no-dfp-1.c" Index: gcc/testsuite/gcc.dg/c2x-float-no-dfp-1.c =================================================================== --- gcc/testsuite/gcc.dg/c2x-float-no-dfp-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/c2x-float-no-dfp-1.c (working copy) @@ -0,0 +1,101 @@ +/* Test DFP macros not defined in if no DFP support. */ +/* { dg-do compile { target { ! dfp } } } */ +/* { dg-options "-std=c2x" } */ + +#include + +#ifdef DEC32_MANT_DIG +# error "DEC32_MANT_DIG defined" +#endif + +#ifdef DEC64_MANT_DIG +# error "DEC64_MANT_DIG defined" +#endif + +#ifdef DEC128_MANT_DIG +# error "DEC128_MANT_DIG defined" +#endif + +#ifdef DEC32_MIN_EXP +# error "DEC32_MIN_EXP defined" +#endif + +#ifdef DEC64_MIN_EXP +# error "DEC64_MIN_EXP defined" +#endif + +#ifdef DEC128_MIN_EXP +# error "DEC128_MIN_EXP defined" +#endif + +#ifdef DEC32_MAX_EXP +# error "DEC32_MAX_EXP defined" +#endif + +#ifdef DEC64_MAX_EXP +# error "DEC64_MAX_EXP defined" +#endif + +#ifdef DEC128_MAX_EXP +# error "DEC128_MAX_EXP defined" +#endif + +#ifdef DEC32_MAX +# error "DEC32_MAX defined" +#endif + +#ifdef DEC64_MAX +# error "DEC64_MAX defined" +#endif + +#ifdef DEC128_MAX +# error "DEC128_MAX defined" +#endif + +#ifdef DEC32_EPSILON +# error "DEC32_EPSILON defined" +#endif + +#ifdef DEC64_EPSILON +# error "DEC64_EPSILON defined" +#endif + +#ifdef DEC128_EPSILON +# error "DEC128_EPSILON defined" +#endif + +#ifdef DEC32_MIN +# error "DEC32_MIN defined" +#endif + +#ifdef DEC64_MIN +# error "DEC64_MIN defined" +#endif + +#ifdef DEC128_MIN +# error "DEC128_MIN defined" +#endif + +#ifdef DEC32_TRUE_MIN +# error "DEC32_TRUE_MIN defined" +#endif + +#ifdef DEC64_TRUE_MIN +# error "DEC64_TRUE_MIN defined" +#endif + +#ifdef DEC128_TRUE_MIN +# error "DEC128_TRUE_MIN defined" +#endif + +#ifdef DEC32_SUBNORMAL_MIN +# error "DEC32_SUBNORMAL_MIN defined" +#endif + +#ifdef DEC64_SUBNORMAL_MIN +# error "DEC64_SUBNORMAL_MIN defined" +#endif + +#ifdef DEC128_SUBNORMAL_MIN +# error "DEC128_SUBNORMAL_MIN defined" +#endif Index: gcc/testsuite/gcc.dg/c2x-float-no-dfp-2.c =================================================================== --- gcc/testsuite/gcc.dg/c2x-float-no-dfp-2.c (nonexistent) +++ gcc/testsuite/gcc.dg/c2x-float-no-dfp-2.c (working copy) @@ -0,0 +1,9 @@ +/* Test DFP macros not defined in if no DFP support. Test + with feature test macros defined. */ +/* { dg-do compile { target { ! dfp } } } */ +/* { dg-options "-std=c2x" } */ + +#define __STDC_WANT_DEC_FP__ +#define __STDC_WANT_IEC_60559_DFP_EXT__ + +#include "c2x-float-no-dfp-1.c" Index: gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-1.c =================================================================== --- gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-1.c (working copy) @@ -0,0 +1,103 @@ +/* Test DFP macros defined in with DFP support. */ +/* { dg-do compile } */ +/* { dg-options "-std=c2x" } */ + +#include + +#ifndef DEC32_MANT_DIG +# error "DEC32_MANT_DIG not defined" +#endif + +#ifndef DEC64_MANT_DIG +# error "DEC64_MANT_DIG not defined" +#endif + +#ifndef DEC128_MANT_DIG +# error "DEC128_MANT_DIG not defined" +#endif + +#ifndef DEC32_MIN_EXP +# error "DEC32_MIN_EXP not defined" +#endif + +#ifndef DEC64_MIN_EXP +# error "DEC64_MIN_EXP not defined" +#endif + +#ifndef DEC128_MIN_EXP +# error "DEC128_MIN_EXP not defined" +#endif + +#ifndef DEC32_MAX_EXP +# error "DEC32_MAX_EXP not defined" +#endif + +#ifndef DEC64_MAX_EXP +# error "DEC64_MAX_EXP not defined" +#endif + +#ifndef DEC128_MAX_EXP +# error "DEC128_MAX_EXP not defined" +#endif + +#ifndef DEC32_MAX +# error "DEC32_MAX not defined" +#endif + +#ifndef DEC64_MAX +# error "DEC64_MAX not defined" +#endif + +#ifndef DEC128_MAX +# error "DEC128_MAX not defined" +#endif + +#ifndef DEC32_EPSILON +# error "DEC32_EPSILON not defined" +#endif + +#ifndef DEC64_EPSILON +# error "DEC64_EPSILON not defined" +#endif + +#ifndef DEC128_EPSILON +# error "DEC128_EPSILON not defined" +#endif + +#ifndef DEC32_MIN +# error "DEC32_MIN not defined" +#endif + +#ifndef DEC64_MIN +# error "DEC64_MIN not defined" +#endif + +#ifndef DEC128_MIN +# error "DEC128_MIN not defined" +#endif + +#ifndef DEC32_TRUE_MIN +# error "DEC32_TRUE_MIN not defined" +#endif + +#ifndef DEC64_TRUE_MIN +# error "DEC64_TRUE_MIN not defined" +#endif + +#ifndef DEC128_TRUE_MIN +# error "DEC128_TRUE_MIN not defined" +#endif + +/* These macros from TR 24732 should not be defined. */ + +#ifdef DEC32_SUBNORMAL_MIN +# error "DEC32_SUBNORMAL_MIN defined" +#endif + +#ifdef DEC64_SUBNORMAL_MIN +# error "DEC64_SUBNORMAL_MIN defined" +#endif + +#ifdef DEC128_SUBNORMAL_MIN +# error "DEC128_SUBNORMAL_MIN defined" +#endif Index: gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-2.c =================================================================== --- gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-2.c (nonexistent) +++ gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-2.c (working copy) @@ -0,0 +1,8 @@ +/* Test DFP macros defined in with DFP support. TS 18661-2 + feature test macro does not change what is defined. */ +/* { dg-do compile } */ +/* { dg-options "-std=c2x" } */ + +#define __STDC_WANT_IEC_60559_DFP_EXT__ + +#include "c2x-float-dfp-1.c" Index: gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-3.c =================================================================== --- gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-3.c (nonexistent) +++ gcc/testsuite/gcc.dg/dfp/c2x-float-dfp-3.c (working copy) @@ -0,0 +1,103 @@ +/* Test DFP macros defined in with DFP support. TR 24732 + feature test macro causes *_SUBNORMAL_MIN macros to be defined. */ +/* { dg-do compile } */ +/* { dg-options "-std=c2x" } */ + +#define __STDC_WANT_DEC_FP__ +#include + +#ifndef DEC32_MANT_DIG +# error "DEC32_MANT_DIG not defined" +#endif + +#ifndef DEC64_MANT_DIG +# error "DEC64_MANT_DIG not defined" +#endif + +#ifndef DEC128_MANT_DIG +# error "DEC128_MANT_DIG not defined" +#endif + +#ifndef DEC32_MIN_EXP +# error "DEC32_MIN_EXP not defined" +#endif + +#ifndef DEC64_MIN_EXP +# error "DEC64_MIN_EXP not defined" +#endif + +#ifndef DEC128_MIN_EXP +# error "DEC128_MIN_EXP not defined" +#endif + +#ifndef DEC32_MAX_EXP +# error "DEC32_MAX_EXP not defined" +#endif + +#ifndef DEC64_MAX_EXP +# error "DEC64_MAX_EXP not defined" +#endif + +#ifndef DEC128_MAX_EXP +# error "DEC128_MAX_EXP not defined" +#endif + +#ifndef DEC32_MAX +# error "DEC32_MAX not defined" +#endif + +#ifndef DEC64_MAX +# error "DEC64_MAX not defined" +#endif + +#ifndef DEC128_MAX +# error "DEC128_MAX not defined" +#endif + +#ifndef DEC32_EPSILON +# error "DEC32_EPSILON not defined" +#endif + +#ifndef DEC64_EPSILON +# error "DEC64_EPSILON not defined" +#endif + +#ifndef DEC128_EPSILON +# error "DEC128_EPSILON not defined" +#endif + +#ifndef DEC32_MIN +# error "DEC32_MIN not defined" +#endif + +#ifndef DEC64_MIN +# error "DEC64_MIN not defined" +#endif + +#ifndef DEC128_MIN +# error "DEC128_MIN not defined" +#endif + +#ifndef DEC32_TRUE_MIN +# error "DEC32_TRUE_MIN not defined" +#endif + +#ifndef DEC64_TRUE_MIN +# error "DEC64_TRUE_MIN not defined" +#endif + +#ifndef DEC128_TRUE_MIN +# error "DEC128_TRUE_MIN not defined" +#endif + +#ifndef DEC32_SUBNORMAL_MIN +# error "DEC32_SUBNORMAL_MIN not defined" +#endif + +#ifndef DEC64_SUBNORMAL_MIN +# error "DEC64_SUBNORMAL_MIN not defined" +#endif + +#ifndef DEC128_SUBNORMAL_MIN +# error "DEC128_SUBNORMAL_MIN not defined" +#endif Index: gcc/testsuite/gcc.dg/dfp/tr24732-float-dfp-1.c =================================================================== --- gcc/testsuite/gcc.dg/dfp/tr24732-float-dfp-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/dfp/tr24732-float-dfp-1.c (working copy) @@ -0,0 +1,106 @@ +/* Test DFP macros defined in with DFP support. TR 24732 + feature test macro causes SUBNORMAL_MIN macros to be defined but + not TRUE_MIN ones. */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +#define __STDC_WANT_DEC_FP__ +#include + +#ifndef DEC32_MANT_DIG +# error "DEC32_MANT_DIG not defined" +#endif + +#ifndef DEC64_MANT_DIG +# error "DEC64_MANT_DIG not defined" +#endif + +#ifndef DEC128_MANT_DIG +# error "DEC128_MANT_DIG not defined" +#endif + +#ifndef DEC32_MIN_EXP +# error "DEC32_MIN_EXP not defined" +#endif + +#ifndef DEC64_MIN_EXP +# error "DEC64_MIN_EXP not defined" +#endif + +#ifndef DEC128_MIN_EXP +# error "DEC128_MIN_EXP not defined" +#endif + +#ifndef DEC32_MAX_EXP +# error "DEC32_MAX_EXP not defined" +#endif + +#ifndef DEC64_MAX_EXP +# error "DEC64_MAX_EXP not defined" +#endif + +#ifndef DEC128_MAX_EXP +# error "DEC128_MAX_EXP not defined" +#endif + +#ifndef DEC32_MAX +# error "DEC32_MAX not defined" +#endif + +#ifndef DEC64_MAX +# error "DEC64_MAX not defined" +#endif + +#ifndef DEC128_MAX +# error "DEC128_MAX not defined" +#endif + +#ifndef DEC32_EPSILON +# error "DEC32_EPSILON not defined" +#endif + +#ifndef DEC64_EPSILON +# error "DEC64_EPSILON not defined" +#endif + +#ifndef DEC128_EPSILON +# error "DEC128_EPSILON not defined" +#endif + +#ifndef DEC32_MIN +# error "DEC32_MIN not defined" +#endif + +#ifndef DEC64_MIN +# error "DEC64_MIN not defined" +#endif + +#ifndef DEC128_MIN +# error "DEC128_MIN not defined" +#endif + +#ifndef DEC32_SUBNORMAL_MIN +# error "DEC32_SUBNORMAL_MIN not defined" +#endif + +#ifndef DEC64_SUBNORMAL_MIN +# error "DEC64_SUBNORMAL_MIN not defined" +#endif + +#ifndef DEC128_SUBNORMAL_MIN +# error "DEC128_SUBNORMAL_MIN not defined" +#endif + +/* These macros from C2X should not be defined. */ + +#ifdef DEC32_TRUE_MIN +# error "DEC32_TRUE_MIN defined" +#endif + +#ifdef DEC64_TRUE_MIN +# error "DEC64_TRUE_MIN defined" +#endif + +#ifdef DEC128_TRUE_MIN +# error "DEC128_TRUE_MIN defined" +#endif Index: gcc/testsuite/gcc.dg/dfp/ts18661-2-float-dfp-1.c =================================================================== --- gcc/testsuite/gcc.dg/dfp/ts18661-2-float-dfp-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/dfp/ts18661-2-float-dfp-1.c (working copy) @@ -0,0 +1,8 @@ +/* Test DFP macros defined in with DFP support. TS 18661-2 + feature test macro causes same macros to be defined as for C2X. */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +#define __STDC_WANT_IEC_60559_DFP_EXT__ + +#include "c2x-float-dfp-1.c"