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]
Other format: [Raw text]

Re: New insns for the s390 backend (2)


Hello,

we (Ulrich Weigand and me) decided to make the application of fmadd and
fmsub dependent upon the presence of the unsafe math optimization flag.
Otherwise the visible behaviour of a progam could change if optimization is
turned on. Pointing to the implementation of multiply and add on the rs6000
David Edelsohn discussed with Ulrich Weigand that this change of behaviour
is actually conform with the C99 standard:

(6.5/8)   A floating point expression may be contracted, that is, evaluated
as though it were an atomic operation, thereby omitting rounding errors
implied by the source code and the expression evaluation method.  The
FP_CONTRACT pragma in <math.h> provides a way to disallow contracted
expressions.  Otherwise, whether and how expressions are contracted is
implementation-controlled.

(F.6/2) A contracted expression should raise floating-point exceptions in a
manner generally consistent with the basic arithmetic operations.  A
contracted expression should deliver the same value as its uncontracted
counterpart, else should be correctly rounded (once).

So we will go the rs6000 way using the -mno-fused-madd flags to let the
user choose to turn it off without affecting the whole package of
optimizations triggered through flag_unsafe_math_optimizations (how Bradley
Lucier decribed). Due to this the usage of multiply and add/sub is turned
on by default and much more code is able to take advantage of these
instructions. Thanks David Edelsohn!

Expect the appropriate patch during next days.

Andreas


******************************************************
IBM Deutschland Entwicklung GmbH
Linux for zSeries Development, Dept. 1419
Schönaicher Straße 220, 71032 Böblingen

Office: 06-133 Phone: +49-(0)7031-16-1089
External Email: krebbel1@de.ibm.com


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