public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Henrik Mannerström" <henrik.mannerstrom@helsinki.fi>
To: gcc-help@gcc.gnu.org
Subject: Re: Removing bound checks from a switch statement
Date: Thu, 18 Feb 2010 16:32:00 -0000	[thread overview]
Message-ID: <20100218173832.12491s2bi11hzsag@webmail.helsinki.fi> (raw)
In-Reply-To: <87sk8ywqvd.fsf@falma.de>

Quoting "Christoph Groth" <cwg@falma.de>:

> I do not know how to solve the problem you described, but another way of
> speeding up a switch statement might be using the GCC extension "Labels
> as Values".
>
> http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

Thank you very much! This was exactly what I was looking for.

I made a completely non-standard, spaghettisized version of the  
program and luckily it did not run any faster than the switch-based  
one, so I can stick to my -ansi option. The earlier reported speedup  
was probably just an outlier in the performance test.

Many thanks! Now I can put this behind me and work on other aspects.
Henrik

  reply	other threads:[~2010-02-18 15:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 14:22 Henrik Mannerström
2010-02-18 14:44 ` Christoph Groth
2010-02-18 16:32   ` Henrik Mannerström [this message]
2010-02-17 18:11 Henrik Mannerström
2010-02-17 19:00 ` Jeff Law

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=20100218173832.12491s2bi11hzsag@webmail.helsinki.fi \
    --to=henrik.mannerstrom@helsinki.fi \
    --cc=gcc-help@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).