This is the mail archive of the gcc@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: flag_complex_method = 2 in C++?


Hi Mark,

I'd prefer not to introduce a situation in which compiling the same code
with "gcc" and with "g++" behaves differently and which performs worse
in one case than the other.  Users expect the C subset of C++ to perform
like C.

If we want the C99 rules, let's just turn them on everywhere, and then
let users who want "quick and dirty" complex arithmetic to use the flag
that turns that on.  And, turn that on by default for -ffast-math?

Let's start again from the end of your answer: fast-math includes cx_limited_range, which in turn leads to the very fast method *0* being used. Therefore, in any case, we cannot have performance issues in fast-math mode.

I briefly remind that currently we have *3* different methods, and method 1 is the default but for C99, where the default is 2:

/* 0 means straightforward implementation of complex divide acceptable.
  1 means wide ranges of inputs must work for complex divide.
  2 means C99-like requirements for complex multiply and divide.  */

Therefore, I'm not sure... I would certainly like to see method 2 becoming the default everywhere, on the other hand, I'm not sure if method 2 isn't too slow as default for C89 (outside fast-math, I repeat). Shall we carry out performance tests perhaps, or peak performance outside fast-math aren't really an issue here? I don't know.

In case of doubt, I would still switch to method 2 as default together with C++0x, in that case the reference C language is C99 and things are very neat...

Paolo.


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