<html><body>
<p><font size="2" color="#800080">----- Forwarded by Robert Enenkel/Toronto/IBM</font><font size="2" color="#800080"> on 06/03/2010 01:08 PM</font><font size="2" color="#800080"> -----</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Ian McIntosh/Toronto/IBM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Rajan Bhakta/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Cc:</font></td><td width="100%" valign="middle"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Raymond Mak/Toronto/IBM@IBMCA, Robert Enenkel/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">06/02/2010 07:45 PM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Re: Fw: proposed masked test to categorize floating point values</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
In
<ul> <font color="#0000FF">       Issue:  The _Imaginary types need to be supported.</font><br>
<font color="#0000FF">                      One way would be to say that this same family of functions works on imaginary types too; eg, testfpf64x would work on _Imaginary _Float64x.</font><br>
<font color="#0000FF">                      Another approach would be to define additional functions.</font><br>
<b><font color="#FF0000">We can't do this without tgmath support.</font></b></ul>
<br>
Which suggestion can we not do without tgmath support (just using the same functions?  or defining additional functions?  or doing anything at all?)<br>
What are the implications?<br>
Do we currently have tgmath support?<br>
Do we plan it?<br>
Do others have it?<br>
What wording should I put?<br>
<br>
<br>
<br>
<b><font size="4">All:</font></b>  I should send this tomorrow morning.  Since we haven't had time to come to a single IBM position, it will probably go out roughly as is.  I'm wondering if I should change the &quot;testfp&quot; suggestion to &quot;classifyfp&quot; or &quot;fpclassify&quot; (the existing macro name)?<br>
<br>
- Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development<br>
<br>
<br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Rajan Bhakta/Toronto/IBM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Ian McIntosh/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Cc:</font></td><td width="100%" valign="middle"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Raymond Mak/Toronto/IBM@IBMCA, Robert Enenkel/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">06/02/2010 12:51 PM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Re: Fw: proposed masked test to categorize floating point values</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
My preferences in <font color="#FF0000">red </font>below.<br>
My comments in <b><font color="#FF0000">bold red </font></b>below.<br>
<br>
Regards,<br>
<br>
Rajan Bhakta<br>
z/OS C/C++ Technical Architect<br>
ISO C Standards Representative for Canada, IBM<br>
C Compiler Development<br>
Contact: rbhakta@ca.ibm.com, Rajan Bhakta/Toronto/IBM<br>
Telephone: (905) 413-3995<br>
<br>
<br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Ian McIntosh/Toronto/IBM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Robert Enenkel/Toronto/IBM@IBMCA, Raymond Mak/Toronto/IBM@IBMCA, Rajan Bhakta/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">06/02/2010 10:54 AM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Fw: proposed masked test to categorize floating point values</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
A couple of changes<font color="#0000FF">, in blue</font>.<br>
<br>
- Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development<br>
<br>
<font size="2" color="#800080">----- Forwarded by Ian McIntosh/Toronto/IBM on 06/02/2010 10:04 AM -----</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Ian McIntosh/Toronto/IBM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">Robert Enenkel/Toronto/IBM@IBMCA, Raymond Mak/Toronto/IBM@IBMCA, Rajan Bhakta/Toronto/IBM@IBMCA</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">06/01/2010 08:04 PM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:1__=0ABBFDA4DFCDB5938f9e8a93df938@ca.ibm.com" border="0" alt=""><br>
<font size="2">proposed masked test to categorize floating point values</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
This is based on what Robert and I discussed, with some additional options.  Please comment.<br>
<br>
<font color="#0000FF">This would offer a capability similar to the fpclassify macro, but with a mask parameter.  It could, like fpclassify, be a macro instead of a function.</font><br>
<br>
Function Name:<br>
<font color="#0000FF">    Issue:  What name(s) should be used?</font><br>
    <font color="#0000FF">Proposal 1:</font><br>
        <b>testfp</b>&lt;suffix&gt;                        where &lt;suffix&gt; is null for double, &quot;f&quot; for float, &quot;ld&quot; for long double, &quot;f128&quot;, &quot;f64&quot;, &quot;f32&quot; or &quot;f16&quot; for binary, &quot;f64x&quot;, &quot;f32x&quot; etc. for extended binary, &quot;d32&quot;, &quot;d64&quot; or &quot;d128&quot; for dfp.<br>
                                        This tests one scalar value.<br>
<font color="#0000FF">        Issue:  The _Imaginary types need to be supported.</font><br>
<font color="#0000FF">                      One way would be to say that this same family of functions works on imaginary types too; eg, testfpf64x would work on _Imaginary _Float64x.</font><br>
<font color="#0000FF">                      Another approach would be to define additional functions.</font><br>
<b><font color="#FF0000">We can't do this without tgmath support.</font></b><br>
<font color="#0000FF">        Issue:  The _Complex types need to be supported.</font><br>
<font color="#0000FF">                      One way would be to define additional functions; eg, testfpcomplexf64x, with semantics like testfpvectorany below.</font><br>
<font color="#0000FF">                      Another would be to define functions like all three below.</font><br>
<br>
<font color="#0000FF">        The C Standard does not include vector types, but many implementations do.  The following are included here not to become part of the standard yet, but to suggest a future approach.</font><br>
        <b>testfpvector</b>&lt;#&gt;&lt;suffix&gt;        where &lt;#&gt; is the vector length (number of values) and &lt;suffix&gt; is as above.<br>
                                        This tests a vector of # values of the type implied by the suffix.<br>
                                        Example:  testfpvector4f32 tests 4  32 bit values and gives 4 results.<br>
        <b>testfpvectorany</b>&lt;#&gt;&lt;suffix&gt;        similar to testfpvector, returning a single result.<br>
        <b>testfpvectorall</b>&lt;#&gt;&lt;suffix&gt;        similar to testfpvector, returning a single result.<br>
<font color="#0000FF">        Issue:  What about a vector of complex?</font><br>
<b><font color="#FF0000">Can be treated as suggested for _Complex types above.</font></b><br>
<font color="#0000FF">    Proposal 2:</font><br>
<font color="#0000FF">        Same, but using &quot;classify&quot; instead of &quot;test&quot;.</font><br>
<font color="#0000FF">    Proposal 3:</font><br>
<font color="#0000FF">        Same, but using &quot;categorize&quot; instead of test&quot;.</font><br>
<font color="#0000FF">    Proposal 4:</font><br>
<font color="#0000FF">        Shorten names by abbreviating the verb and/or omitting &quot;fp&quot;.</font><br>
<font color="#0000FF">    Proposal 5:</font><br>
<font color="#0000FF">        Make it an overloaded macro, like fpclassify is.</font><br>
<font color="#0000FF">    Proposal 6:</font><br>
<font color="#0000FF">        Overload the fpclassify macro - if there is only one parameter it acts like now, but if there is a second parameter is is a mask.</font><br>
<br>
<font color="#0000FF">Issue:  S</font>hould <font color="#0000FF">we </font>define macros set by the compiler to indicate which functions are present and fast/slow<font color="#0000FF">, as is done for the fma functions?</font><br>
<br>
Function Parameters:<br>
        value                type double, float, long double, _Float#, _Float#x, _Decimal#, etc., or a vector of one of those.<br>
        mask                unsigned long, containing zero or more mask bits ored together:<br>
                        We need to choose macro names for these:<br>
<br>
                             Proposal 1:<br>
                                Result is true iff any of the conditions is true.  The sign is ignored.<br>
                                0x01        zero<br>
                                0x02        normal not equal to zero<br>
                                0x04        subnormal<br>
                                0x08        infinity<br>
                                0x10        quiet NaN<br>
                                0x20        signaling NaN<br>
                                0x40        noncanonical (dfp only)<br>
                                eg, 0x38 means infinities and NaNs.<br>
                            Proposal 2:<br>
                                Result is true iff either of the first two conditions is true and any of the other conditions is true.<br>
                                0x01        positive<br>
                                0x02        negative<br>
                                0x04        zero<br>
                                0x08        normal not equal to zero<br>
                                0x10        subnormal<br>
                                0x20        infinity<br>
                                0x40        quiet NaN<br>
                                0x80        signaling NaN<br>
                                0x100        noncanonical (dfp only)<br>
                                eg, 0xe3 means negative or positive infinities and NaNs, 0x1fe means all negatives, 0x15 means positive zero or subnormal.<br>
                            Proposal 3:<br>
                                Same as proposal 2, except that 0x01 means &quot;only positive&quot; and 0x02 means &quot;only negative&quot;, so in the normal case one need not add/or in 3 to get both signs (simplifies typical usage).<br>
                        <font color="#0000FF">Issue:  Which proposal?  Or something else?  </font>I recommend proposal 3.<br>
<font color="#0000FF">                        Issue:  Should the type be int or unsigned int?</font><br>
<font color="#FF0000">I think it should stay unsigned long (for flexibility/expansion), and it certainly should not be a signed type.</font><br>
<font color="#0000FF">                        Issue:  We should define macros for each of these; for example, in proposal 3 the way to specify infinities and NaNs might be &quot;FP_CLASS_INF | FP_CLASS_SNAN | FP_CLASS_QNAN&quot;.</font><br>
<font color="#FF0000">I think this would be useful for a programmer.</font><br>
<br>
Function Result:<br>
                        For testfp:                _Bool, true if the condition is true, false if it is not.<br>
                        For testfpvector:                unsigned long, with # rightmost bits true or false, corresponding to the vector values<br>
<font color="#0000FF">                                                Issue:  Should the type be int or iunsigned int, like fpclassify returns?</font><br>
<font color="#FF0000">I think it should stay unsigned long (for flexibility/expansion), and it certainly should not be a signed type.</font><br>
                        For testfpvectorany:        _Bool, true if f the condition is true for <b>any</b> of the vector values, false if it is not.<br>
                        For testfpvectorall:        _Bool, true if f the condition is true for <b>all</b> of the vector values, false if it is not.<br>
<br>
<br>
- Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development<br>
<br>
<br>
<br>
<br>
<br>
</body></html>