This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/69074] New: Specify NaN behaviour for floating point smin and smax
- From: "jon at beniston dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Dec 2015 14:11:14 +0000
- Subject: [Bug tree-optimization/69074] New: Specify NaN behaviour for floating point smin and smax
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69074
Bug ID: 69074
Summary: Specify NaN behaviour for floating point smin and smax
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jon at beniston dot com
Target Milestone: ---
Currently, the behaviour of smin and smax is unspecified when either operand is
a NaN.
This seems to mean that floating point min/max instructions are only generated
if -ffinite-math-only is specified.
If there were some extra variants of these, that specified NaN behaviour, then
it seems these patterns could be used without -ffinite-math-only.
Two extra variants seem useful:
- One that always returns the second operand, if either operand is a NaN. This
is useful for c=a<b?a:b; type expressions. (x86 has this as minss)
- One that always returns the non-NaN operand. This would be useful for
inlining fmin()/fminf(). (aarch64 has minnm for this).