public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: "Godmar Back" <godmar@gmail.com>
Cc: "Diego Novillo" <dnovillo@google.com>, gcc-help@gcc.gnu.org
Subject: Re: optimization of switch statements on i386
Date: Mon, 11 Feb 2008 20:01:00 -0000	[thread overview]
Message-ID: <m3tzkfqn56.fsf@localhost.localdomain> (raw)
In-Reply-To: <719dced30802111152j6c033002nfa6841e660fa0b48@mail.gmail.com>

"Godmar Back" <godmar@gmail.com> writes:

> If the reasoning of gcc's developers is correct, and it's the lack of
> a casesi instruction on x86 that set the minimum of arm to use a table
> jump to 5, then I may be able to produce faster code for 4 arms using
> computed gotos; especially since I cannot convince gcc to eliminate
> the check for the default case. Do you agree with that?

Given the branch prediction cache and out-of-order execution of modern
x86 processors, it's unlikely that you'll see much or any speedup.
But the only way to know for sure is to measure the execution time of
the code.

Ian

      reply	other threads:[~2008-02-11 20:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <719dced30802081629g19f67f6fi76dfaa0ede35b7aa@mail.gmail.com>
2008-02-09  0:31 ` Godmar Back
2008-02-09  2:05   ` Ian Lance Taylor
2008-02-09  2:43     ` Godmar Back
2008-02-09  2:52       ` Ian Lance Taylor
2008-02-09  3:02     ` Godmar Back
2008-02-11 17:55       ` Ian Lance Taylor
2008-02-11 18:13         ` Godmar Back
2008-02-11 19:31           ` Ian Lance Taylor
2008-02-11 18:47         ` Diego Novillo
2008-02-11 19:52           ` Godmar Back
2008-02-11 20:01             ` Ian Lance Taylor [this message]

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=m3tzkfqn56.fsf@localhost.localdomain \
    --to=iant@google.com \
    --cc=dnovillo@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=godmar@gmail.com \
    /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).