This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SSE min/max take2 - documentation


On 25-Feb-2001, Jan Hubicka <jh@suse.cz> wrote:
> *** rtl.texi.old	Sun Feb 25 01:46:26 2001
> --- rtl.texi	Sun Feb 25 01:47:33 2001
> *************** the quotient.
> *** 1504,1509 ****
> --- 1504,1511 ----
>   @itemx (smax:@var{m} @var{x} @var{y})
>   Represents the smaller (for @code{smin}) or larger (for @code{smax}) of
>   @var{x} and @var{y}, interpreted as signed integers in mode @var{m}.
> + The code can be also used to for floating point values.  In that case
> + result on two zeros or operands where one is NaN is undefined.

The wording there is somewhat misleading;
saying that the result for two zeros is undefined
implies that returning any random number, e.g. 1.23, is OK.
But I'm pretty sure that you only want it to be unspecified which of
the two zeros is returned (in case their sign differs).

So how about the following instead?

	 The code can be also used to for floating point values.  In that case,
	 if both operands are zeros, or if either operand is NaN,
	 then it is unspecified which of the two operands is returned
	 as the result.

> + @cindex @code{min@var{m}3} instruction pattern
> + @cindex @code{max@var{m}3} instruction pattern
> + @itemx @samp{min@var{m}3}, @samp{max@var{m}3}, @samp{min@var{m}3}, @samp{max@var{m}3}
> + Floating point min and max operations.  Result is undefined in case one of
> + operand is NaN or both are zero.

Likewise here:

	 Floating point min and max operations.  If both operands are zeros,
	 or if either operand is NaN, then it is unspecified which of the two
	 operands is returned as the result.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]