X3J3/97-126 page 1 of 1 Date: February 11, 1997 To: X3J3 From: /HPC Subject: IEEE "I/O" As everyone knows, the IEEE 754 standard defines hardware/software effects, such as base conversion, not language constructs such as I/O. Base conversion can, in principle, apply to I/O and to compilation time constant expression evaluation. It should be noted that this facility, while possibly helpful to people trying to code their own interval arithmetic, is of general use and not restricted to people attempting interval implementation. For example, if one has carefully analyzed the numerical properties of an algorithm and has used the IEEE facilities to ensure last ulp handling carefully, one may well be surprised at multi-ulp "lossage" upon writing out the result. The careful programmer could provide their own base conversion, or at least flag their results with a caveat about its displayed accuracy. We propose that: 1. We provide inquiry functions that allow a programmer to determine if the I/O system performs base conversion as described in the IEEE standard. 2. We provide a facility to allow the programmer to set (if available) the rounding mode in effect during execution of a particular I/O transaction. We can additionally define support for inquiry and control of compile time expression evaluation. While arguably desirable this paper does not describe such a facility, nor do we propose to do so. A brief discussion of what might be involved is provided. Illustrative syntax: IEEE_SUPPORT_IO([x],[full]) where x establishes the kind type parameter (viz. Like the current IEEE_SUPPORT function on a per datatype basis, when present and for all supported datatypes when absent). The optional full (logical type, .true. for full range) allows the user to determine if the processor supports base conversion on the minimal range required by the IEEE standard, or if the processor maintains equivalent fidelity for the entire range. If, and only if, IEEE_SUPPORT_IO is true for a given kind, IEEE_IO_GET_ROUNDING_MODE(round_value) and IEEE_IO_SET_ROUNDING_MODE(round_value) allow the programmer to control rounding during base conversion just as the TR already provides for computation. It would be possible simply to use the rounding mode in effect, a straw vote to establish direction in this area is solicited. Compile time expression evaluation is a potentially messy subject. As we don’t have C’s concept of an integral preprocessor, there is no obvious way for a user to interrogate the processor about it’s handling of compile time expressions, nor (without pragmas or equivalent) to control them. If there is interest in making a similar set of compile time inquiries and controls, we will probably have to embrace something along the lines of built-in macros and pragmas. Subgroup has not extensively analyzed this, nor is it proposing them at this time.