public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Ico <gcc@zevv.nl>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Floating point performance issue
Date: Tue, 20 Dec 2011 10:34:00 -0000	[thread overview]
Message-ID: <CAH6eHdSz-g2QFJG3RRGCWvOr8azXy51XsjGpJHm-gvLVguYmFw@mail.gmail.com> (raw)
In-Reply-To: <1324376083-sup-8851@pruts.nl>

On 20 December 2011 10:20, Ico wrote:
>
> Still, I'm not sure if sse is part of the problem and/or solution.

It's the solution.

> I have been reducing the program to see what the smallest code is that still
> shows this behaviour. Latest version is below.
>
>
> $ gcc -msse -mfpmath=sse -O3 -march=native test.c

What is "native" for your system, i686? (also, what does gcc -dumpmachine show?)
i686 doesn't support SSE, you need at least pentium3.

Remove the -msse and see if you get a warning telling you SSE
instructions are disabled.

Try -march=pentium3 -mfpmath=sse instead (without -msse)

If you don't have at least a pentium3, you're stuck with the 387 FP
registers, and have to use horrible code.

> $ time ./a.out 0.9
>
> real    0m2.653s
> user    0m2.648s
> sys     0m0.002s

That looks as though you're still not using SSE registers.

> $ time ./a.out 0.001
>
> real    0m0.144s
> user    0m0.140s
> sys     0m0.002s

  reply	other threads:[~2011-12-20 10:34 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  9:52 Ico
2011-12-20 10:05 ` Marcin Mirosław
2011-12-20 10:20   ` Ico
2011-12-20 10:34     ` Jonathan Wakely [this message]
2011-12-20 10:43       ` Ico
2011-12-20 11:24       ` Vincent Lefevre
2011-12-20 11:51         ` Dario Saccavino
2011-12-20 12:02           ` Ico
2011-12-20 12:12           ` Vincent Lefevre
2011-12-20 12:28             ` Tim Prince
2011-12-20 12:43             ` Segher Boessenkool
2011-12-20 13:02               ` Vincent Lefevre
2011-12-20 19:51                 ` Segher Boessenkool
2011-12-20 21:02                   ` Vincent Lefevre
2011-12-21  4:36                     ` Segher Boessenkool
2011-12-21  6:15                       ` Segher Boessenkool
2011-12-23 20:25                         ` Vincent Lefevre
2011-12-20 13:43             ` David Brown
2011-12-20 13:58               ` Vincent Lefevre
2011-12-20 14:25                 ` David Brown
2011-12-20 15:05                   ` Vincent Lefevre
2011-12-20 15:44                     ` David Brown
2011-12-20 16:18                       ` Vincent Lefevre
2011-12-20 22:32                         ` David Brown
2011-12-23 20:11                           ` Vincent Lefevre
2011-12-24  7:38                             ` Vincent Lefevre
2011-12-24 11:11                             ` David Brown
2011-12-26  1:15                               ` Vincent Lefevre
2011-12-26 11:48                                 ` David Brown
2011-12-26 13:07                                   ` Vincent Lefevre
2011-12-26 13:37                                     ` Tim Prince
2011-12-26 14:01                                       ` Vincent Lefevre
2011-12-26 14:39                                         ` Tim Prince
2011-12-26 16:40                                           ` Vincent Lefevre
2011-12-21  1:19                       ` Miles Bader
2011-12-21  2:19                         ` David Brown
2011-12-21  4:03                           ` Miles Bader
2011-12-21  8:32                             ` David Brown
2011-12-21  9:02                               ` Miles Bader
2011-12-21  9:23                                 ` David Brown
2011-12-21 11:58                                   ` Miles Bader
2011-12-21 16:49                                     ` David Brown
2011-12-22  3:23                                       ` Miles Bader
2011-12-23 21:15                               ` Vincent Lefevre
2011-12-24 17:18                                 ` David Brown
2011-12-26  8:12                                   ` Vincent Lefevre
2011-12-26 13:00                                     ` David Brown
2011-12-26 13:22                                       ` Vincent Lefevre
2011-12-20 15:45                     ` Jeff Kenton
2011-12-20 11:44     ` David Brown
2011-12-20 11:49       ` David Brown
2011-12-20 10:46 ` Marc Glisse
2011-12-20 11:11   ` Ico
2011-12-20 11:16   ` Vincent Lefevre
2011-12-20 12:00     ` Vincent Lefevre
2011-12-20 12:21 ` Tim Prince

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=CAH6eHdSz-g2QFJG3RRGCWvOr8azXy51XsjGpJHm-gvLVguYmFw@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc@zevv.nl \
    /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).