public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alfred Perlstein <bright@rush.net>
To: egcs@egcs.cygnus.com
Subject: optimization hints?
Date: Fri, 11 Jun 1999 01:47:00 -0000	[thread overview]
Message-ID: <Pine.BSF.3.96.990611035502.14320R-100000@cygnus.rush.net> (raw)

It has always seemed weird that C, the langue usually chosen because
it's closeness to the machine level wouldn't have a hint like 
system for doing branches.

Is there such a way to do this?

case in point:


  do {
    if ((ret = poll(pfds, num_pfds, INFTIM)) == -1)
        switch(ret = errno) {
        case EINTR:
             continue;
        default:
             panic("internal poll error %s", strerror(ret));
        }
    }
  ......
  } while (...);

just the fact that I don't expect an error (poll() returning -1),
I was hoping to be able to tell it that this code isn't likely to
execute and perhaps even move it someplace else to maximize the
instruction cache utilization of my code.

does this make sense?  is there anything in the works to do this, or
perhaps something I missed?

isn't it about time C developers had this kind of control over thier
code?

it'd be nice to have a "maybe((ret = poll(pfds, num_pfds, INFTIM)) == -1)"
or something :)

thanks,
-Alfred 

WARNING: multiple messages have this Message-ID
From: Alfred Perlstein <bright@rush.net>
To: egcs@egcs.cygnus.com
Subject: optimization hints?
Date: Wed, 30 Jun 1999 15:43:00 -0000	[thread overview]
Message-ID: <Pine.BSF.3.96.990611035502.14320R-100000@cygnus.rush.net> (raw)
Message-ID: <19990630154300.Gyjx1qXezqDUlotGF5E5Ct4QQjs0D5DOV5p8CMWIX94@z> (raw)

It has always seemed weird that C, the langue usually chosen because
it's closeness to the machine level wouldn't have a hint like 
system for doing branches.

Is there such a way to do this?

case in point:


  do {
    if ((ret = poll(pfds, num_pfds, INFTIM)) == -1)
        switch(ret = errno) {
        case EINTR:
             continue;
        default:
             panic("internal poll error %s", strerror(ret));
        }
    }
  ......
  } while (...);

just the fact that I don't expect an error (poll() returning -1),
I was hoping to be able to tell it that this code isn't likely to
execute and perhaps even move it someplace else to maximize the
instruction cache utilization of my code.

does this make sense?  is there anything in the works to do this, or
perhaps something I missed?

isn't it about time C developers had this kind of control over thier
code?

it'd be nice to have a "maybe((ret = poll(pfds, num_pfds, INFTIM)) == -1)"
or something :)

thanks,
-Alfred 

             reply	other threads:[~1999-06-11  1:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-11  1:47 Alfred Perlstein [this message]
1999-06-11  1:58 ` Jeffrey A Law
1999-06-30 15:43   ` Jeffrey A Law
1999-06-11  6:08 ` Robert Lipe
1999-06-11  9:12   ` Joe Buck
1999-06-30 15:43     ` Joe Buck
1999-06-11 18:28   ` Benjamin Scherrey
1999-06-11 19:17     ` Robert Lipe
1999-06-30 15:43       ` Robert Lipe
1999-06-30 15:43     ` Benjamin Scherrey
1999-06-30 15:43   ` Robert Lipe
1999-06-30 15:43 ` Alfred Perlstein
1999-06-11 10:34 Mike Stump
1999-06-16  9:42 ` Alfred Perlstein
1999-06-30 15:43   ` Alfred Perlstein
1999-06-30 15:43 ` Mike Stump
1999-06-11 16:50 Alex Rosenberg
1999-06-30 15:43 ` Alex Rosenberg
1999-06-11 17:43 Mike Stump
1999-06-30 15:43 ` Mike Stump

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=Pine.BSF.3.96.990611035502.14320R-100000@cygnus.rush.net \
    --to=bright@rush.net \
    --cc=egcs@egcs.cygnus.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).