Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 5: Supplementary attributes

ISO/IEC TS 18661-5:2016 extends programming language C to include support for attributes specified and recommended in ISO/IEC/IEEE 60559:2011.

Titre manque — Partie 5: Titre manque

General Information

Status
Not Published
Current Stage
5000 - FDIS registered for formal approval
Start Date
24-Dec-2024
Completion Date
23-Aug-2024
Ref Project

Relations

Buy Standard

Draft
ISO/IEC DTS 18661-5 - Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 5: Supplementary attributes Released:11/25/2024
English language
20 pages
sale 15% off
Preview
sale 15% off
Preview
Draft
REDLINE ISO/IEC DTS 18661-5 - Programming languages, their environments, and system software interfaces — Floating-point extensions for C — Part 5: Supplementary attributes Released:11/25/2024
English language
20 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


FINAL DRAFT
Technical
Specification
ISO/IEC DTS
18661-5
ISO/IEC JTC 1/SC 22
Programming languages, their
Secretariat: ANSI
environments, and system software
Voting begins on:
interfaces — Floating-point
2024-12-09
extensions for C —
Voting terminates on:
2025-02-03
Part 5:
Supplementary attributes
RECIPIENTS OF THIS DRAFT ARE INVITED TO SUBMIT,
WITH THEIR COMMENTS, NOTIFICATION OF ANY
RELEVANT PATENT RIGHTS OF WHICH THEY ARE AWARE
AND TO PROVIDE SUPPOR TING DOCUMENTATION.
IN ADDITION TO THEIR EVALUATION AS
BEING ACCEPTABLE FOR INDUSTRIAL, TECHNO-
LOGICAL, COMMERCIAL AND USER PURPOSES, DRAFT
INTERNATIONAL STANDARDS MAY ON OCCASION HAVE
TO BE CONSIDERED IN THE LIGHT OF THEIR POTENTIAL
TO BECOME STAN DARDS TO WHICH REFERENCE MAY BE
MADE IN NATIONAL REGULATIONS.
Reference number
FINAL DRAFT
Technical
Specification
ISO/IEC DTS
18661-5
ISO/IEC JTC 1/SC 22
Programming languages, their
Secretariat: ANSI
environments, and system software
Voting begins on:
interfaces — Floating-point
extensions for C —
Voting terminates on:
Part 5:
Supplementary attributes
RECIPIENTS OF THIS DRAFT ARE INVITED TO SUBMIT,
WITH THEIR COMMENTS, NOTIFICATION OF ANY
RELEVANT PATENT RIGHTS OF WHICH THEY ARE AWARE
AND TO PROVIDE SUPPOR TING DOCUMENTATION.
© ISO/IEC 2024
IN ADDITION TO THEIR EVALUATION AS
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
BEING ACCEPTABLE FOR INDUSTRIAL, TECHNO-
LOGICAL, COMMERCIAL AND USER PURPOSES, DRAFT
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
INTERNATIONAL STANDARDS MAY ON OCCASION HAVE
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
TO BE CONSIDERED IN THE LIGHT OF THEIR POTENTIAL
or ISO’s member body in the country of the requester.
TO BECOME STAN DARDS TO WHICH REFERENCE MAY BE
MADE IN NATIONAL REGULATIONS.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland Reference number
© ISO/IEC 2024 – All rights reserved
ii
Contents Page
Foreword .iv
Introduction .v
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Conformance . 1
5 C standard conformance . 2
5.1 Freestanding implementations . .2
5.2 Predefined macros .2
5.3 Standard headers .2
6 Standard pragmas . 2
7 Evaluation formats . 3
7.1 General .3
7.2 Evaluation method pragma .3
7.3 Evaluation method pragma for decimal floating types .4
7.4 Effective evaluation method macros .4
7.5 Evaluation type macros .4
7.6 Evaluation formats for .5
8 Optimization controls . 5
8.1 General .5
8.2 The FP_ALLOW_VALUE_CHANGING_OPTIMIZATION pragma .6
8.3 The FP_ALLOW_ASSOCIATIVE_LAW pragma .6
8.4 The FP_ALLOW_DISTRIBUTIVE_LAW pragma .7
8.5 The FP_ALLOW_MULTIPLY_BY_RECIPROCAL pragma .7
8.6 The FP_ALLOW_ZERO_SUBNORMAL pragma .8
8.7 The FP_ALLOW_CONTRACT_FMA pragma .8
8.8 The FP_ALLOW_CONTRACT_OPERATION_CONVERSION pragma .9
8.9 The FP_ALLOW_CONTRACT pragma .9
9 Reproducibility . 10
9.1 General .10
9.2 The FP_REPRODUCIBLE pragma.10
9.3 Reproducible code .11
10 Alternate exception handling .12
10.1 General . 12
10.2 The FENV_EXCEPT pragma . 13
Bibliography .20

© ISO/IEC 2024 – All rights reserved
iii
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations,
governmental and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are described
in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types
of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/
IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/refdocs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the
use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not
received notice of (a) patent(s) which may be required to implement this document. However, implementers
are cautioned that this may not represent the latest information, which may be obtained from the patent
database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be held
responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions
related to conformity assessment, as well as information about ISO's adherence to the World Trade
Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/foreword.html.
In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 22, Programming languages, their environments and system software interfaces.
This second edition cancels and replaces the first edition (ISO/IEC TS 18661-5:2016), which has been
technically revised.
The main changes are as follows:
— The specification has been updated to extend ISO/IEC 9899:2024.
— Conformance macros have been added to allow conformance to each of the four feature sets (evaluation
formats, optimization controls, reproducibility, and alternate exception handling) independently.
A list of all parts in the ISO 18661 series can be found on the ISO website.

© ISO/IEC 2024 – All rights reserved
iv
Introduction
The IEEE 754-1985 standard for binary floating-point arithmetic was motivated by an expanding diversity
in floating-point data representation and arithmetic, which made writing reliable programs, debugging
and moving programs between systems exceedingly difficult. Now the great majority of systems provide
data formats and arithmetic operations according to IEEE 754. Corresponding versions of IEEE 754 and
ISO/IEC 60559 have equivalent content.
Support for IEEE 754-1985 was added in ISO/IEC 9899:1999 (also referred to as C99), and ISO/IEC 9899:2018
is still based on IEEE 754-1985. However, IEEE 754 underwent a major revision in 2008 and a minor revision
in 2019, which added several new features.
The purpose of the ISO/IEC TS 18661 series (first published 2014 through 2016) has been to specify C language
support for the new features introduced into IEEE 754 since 1985. Most of the ISO/IEC TS 18661 series has
been incorporated into ISO/IEC 9899:2024 (also referred to as C23 because major work on this revision was
completed in 2023), which supports all required and most recommended features in IEEE 754-2019.
IEEE 754 defines alternatives for certain attributes of floating-point semantics, and aims to provide, through
programming languages, a means by which a program can specify which of the alternative semantics apply
to a given block of code. The program specification of attributes is constant (fixed at translation time), not
dynamic (changeable at execution time).
The FENV_ROUND and FENV_DEC_ROUND pragmas in C23 provide the rounding direction attributes required by
IEEE 754.
IEEE 754 also recommends other attributes that are not supported in C23, including:
— preferredWidth: evaluation formats for floating-point operations;
— value-changing optimizations: allow/disallow program transformations
...


DRAFT TECHNICAL SPECIFICATION
ISO/IEC JTC 1/SC 22
Secretariat: ANSI
Second edition
Date: 2024-10-1711-25
Programming languages, their environments, and system software interfaces —
Floating-point extensions for C —
Part 5:
Supplementary attributes
Technologies de l’information — Langages de programmation, leurs environnements et interfaces du logiciel
système — Extensions à virgule flottante pour C —
Partie 5: Attributs supplémentaires

FDIS stage
© ISO/IEC 2024, Published in Switzerland
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this
publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including
photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested
from either ISO at the address below or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +Phone: + 41 22 749 01 11
E-mail: copyright@iso.org
Website: www.iso.org
Published in SwitzerlandFax +41 22 749 09 47
copyright@iso.org
www.iso.org
Foreword . iv
Introduction . v
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Conformance . 1
5 C standard conformance . 2
5.1 Freestanding implementations . 2
5.2 Predefined macros . 2
5.3 Standard headers . 2
6 Standard pragmas . 2
7 Evaluation formats . 3
7.1 General . 3
7.2 Evaluation method pragma . 3
7.3 Evaluation method pragma for decimal floating types . 4
7.4 Effective evaluation method macros . 5
7.5 Evaluation type macros . 5
7.6 Evaluation formats for . 5
8 Optimization controls . 6
8.1 General . 6
8.2 The FP_ALLOW_VALUE_CHANGING_OPTIMIZATION pragma . 7
8.3 The FP_ALLOW_ASSOCIATIVE_LAW pragma . 7
8.4 The FP_ALLOW_DISTRIBUTIVE_LAW pragma . 8
8.5 The FP_ALLOW_MULTIPLY_BY_RECIPROCAL pragma . 9
8.6 The FP_ALLOW_ZERO_SUBNORMAL pragma . 9
8.7 The FP_ALLOW_CONTRACT_FMA pragma . 10
8.8 The FP_ALLOW_CONTRACT_OPERATION_CONVERSION pragma . 10
8.9 The FP_ALLOW_CONTRACT pragma . 11
9 Reproducibility . 11
9.1 General . 11
9.2 The FP_REPRODUCIBLE pragma . 12
9.3 Reproducible code . 13
10 Alternate exception handling . 14
10.1 General . 14
10.2 The FENV_EXCEPT pragma . 15
Bibliography . 23

© ISO/IEC 2024 – All rights reserved

iii
© ISO/IEC 2024 – All rights reserved

iv
Contents
Foreword . vi
Introduction . viii
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Conformance . 1
5 C standard conformance . 2
5.1 Freestanding implementations . 2
5.2 Predefined macros . 2
5.3 Standard headers . 2
6 Standard pragmas . 2
7 Evaluation formats . 3
7.1 General . 3
7.2 Evaluation method pragma . 4
7.3 Evaluation method pragma for decimal floating types . 5
7.4 Effective evaluation method macros . 6
7.5 Evaluation type macros . 6
7.6 Evaluation formats for . 6
8 Optimization controls . 7
8.1 General . 7
8.2 The FP_ALLOW_VALUE_CHANGING_OPTIMIZATION pragma . 8
8.3 The FP_ALLOW_ASSOCIATIVE_LAW pragma . 8
8.4 The FP_ALLOW_DISTRIBUTIVE_LAW pragma . 10
8.5 The FP_ALLOW_MULTIPLY_BY_RECIPROCAL pragma . 11
8.6 The FP_ALLOW_ZERO_SUBNORMAL pragma . 12
8.7 The FP_ALLOW_CONTRACT_FMA pragma . 12
8.8 The FP_ALLOW_CONTRACT_OPERATION_CONVERSION pragma. 13
8.9 The FP_ALLOW_CONTRACT pragma . 14
9 Reproducibility . 15
9.1 General . 15
9.2 The FP_REPRODUCIBLE pragma . 16
9.3 Reproducible code . 18
10 Alternate exception handling . 19
10.1 General . 19
10.2 The FENV_EXCEPT pragma . 20
Bibliography . 33

© ISO/IEC 2024 – All rights reserved

v
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are members
of ISO or IEC participate in the development of International Standards through technical committees
established by the respective organization to deal with particular fields of technical activity. ISO and IEC
technical committees collaborate in fields of mutual interest. Other international organizations,
governmental and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the
different types of document should be noted. This document was drafted in accordance with the editorial
rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directiveswww.iso.org/directives or
www.iec.ch/members_experts/refdocswww.iec.ch/members_experts/refdocs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the use
of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not
received notice of (a) patent(s) which may be required to implement this document. However,
implementers are cautioned that this may not represent the latest information, which may be obtained from
the patent database available at www.iso.org/patents and https://patents.iec.ch.www.iso.org/patents and
https://patents.iec.ch. ISO and IEC shall not be held responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standar
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.