public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/29549] matmul slow for complex matrices
Date: Sun, 10 Feb 2008 22:48:00 -0000	[thread overview]
Message-ID: <20080210224755.306.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29549-1719@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from tkoenig at gcc dot gnu dot org  2008-02-10 22:47 -------
(In reply to comment #5)
> The big culprit seems to be -fcx-limited-range. The other flags enabled by
> -ffast-math help very little.

C has some strange rules for complex types, which are mandated by the
C standard and aren't much use for other languages.

This is controlled by the variable flag_complex_method.  For C, this
is either 2 (meaning full C rules) or 0, which implies limited range
for complex division.  Complex multiplication can be expanded into
a libcall for flag_complex_method == 2 under circumstances I don't
understand (line 981, tree-complex.c).

Fortran usually has 1, which means sane rules for complex division
and multiplication.

Unfortunately, our matmul routines are written in C, so we
get what we don't need in Fortran - full C rules and possibly
a call to a library routine.

Solutions?  We could introduce an option to set flag_complex_method to
1 in C.  We could also set -fcx-limited-range for our matmul
routines, which should be safe as they don't use complex division
(at least they should not :-)

CC:ing rth as he wrote the code in question.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org,
                   |                            |tkoenig at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29549


  parent reply	other threads:[~2008-02-10 22:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 15:58 [Bug fortran/29549] New: " tobias dot burnus at physik dot fu-berlin dot de
2006-11-04 14:15 ` [Bug fortran/29549] " jb at gcc dot gnu dot org
2006-11-04 20:34 ` jb at gcc dot gnu dot org
2006-11-04 21:24 ` jb at gcc dot gnu dot org
2006-11-04 22:17 ` jb at gcc dot gnu dot org
2008-02-10 19:20 ` jb at gcc dot gnu dot org
2008-02-10 22:48 ` tkoenig at gcc dot gnu dot org [this message]
2008-02-16 18:50 ` fxcoudert at gcc dot gnu dot org
2008-02-16 19:01 ` fxcoudert at gcc dot gnu dot org
2008-02-16 21:59 ` rguenth at gcc dot gnu dot org
2008-02-16 22:33 ` jb at gcc dot gnu dot org
2008-02-19 19:34 ` jb at gcc dot gnu dot org
2008-02-25 19:22 ` jb at gcc dot gnu dot org
2008-02-25 19:28 ` jb at gcc dot gnu dot org
2008-02-26 21:15 ` jb at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080210224755.306.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).