Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Register storage type |
| Date | 2011-05-12 21:57 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <iqi36a$5ek$1@dont-email.me> (permalink) |
| References | <iqhhgg$d8j$1@speranza.aioe.org> <OeGdnRorOK1J11HQnZ2dnUVZ_gSdnZ2d@bestweb.net> <iqhiie$g5j$1@speranza.aioe.org> |
On 5/12/2011 5:13 PM, Free Willy wrote:
> [...]
> Another question is array variables declared as register type - could the
> compiler put a small array say of 3 elements into different registers and
> translate array accesses to the right register?
It is possible to define an array with `register', but the
array is pretty much useless. Since all array accesses are defined
in terms of pointer operations, and since you can't form a pointer
to a register variable, you wind up with an array you can't use!
The only operation you can do with it is apply `sizeof'.
Stepping back a second and taking a wider view, I suspect your
fascination with `register' is unhealthy, and that you should
muster all your will power to forget the keyword's existence. You
mention a CPU with only a few hardware registers, and (it seems)
you imagine you'll get greater speed by dedicating them to your
most frequently-used variables. Tell me, then: If all the registers
are busy holding the values of `w', `x', `y', `z', where will the
compiler keep the intermediate results in `x * y + w * z'?
Drop it. Just drop it, and step away from the keyboard, keeping
both hands in view. Good. Now show me the MEASUREMENTS that indicate
you need to micro-optimize. If you haven't made them, I'm giving you
a ticket and a fine for Premature Optimization. Do you feel lucky?
--
Eric Sosman
esosman@ieee-dot-org.invalid
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Register storage type Free Willy <nospam@nospam.com> - 2011-05-12 20:55 +0000
Re: Register storage type Kenneth Brody <kenbrody@spamcop.net> - 2011-05-12 17:02 -0400
Re: Register storage type Free Willy <nospam@nospam.com> - 2011-05-12 21:13 +0000
Re: Register storage type Angel <angel+news@spamcop.net> - 2011-05-12 21:20 +0000
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-12 14:27 -0700
Re: Register storage type Kenneth Brody <kenbrody@spamcop.net> - 2011-05-13 13:20 -0400
Re: Register storage type Free Willy <nospam@nospam.com> - 2011-05-13 21:30 +0000
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-13 15:50 -0700
Different languages (Was: Register storage type) gazelle@shell.xmission.com (Kenny McCormack) - 2011-05-14 08:58 +0000
Re: Different languages (Was: Register storage type) Dr Nick <3-nospam@temporary-address.org.uk> - 2011-05-14 10:09 +0100
Re: Register storage type Free Willy <nospam@nospam.com> - 2011-05-14 21:27 +0000
Re: Register storage type Ian Collins <ian-news@hotmail.com> - 2011-05-15 09:55 +1200
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-14 16:46 -0700
Re: Register storage type Jens <jens.gustedt@gmail.com> - 2011-05-15 10:08 -0700
Re: Register storage type James Kuyper <jameskuyper@verizon.net> - 2011-05-15 14:09 -0400
Re: Register storage type David Thompson <dave.thompson2@verizon.net> - 2011-05-19 01:50 -0400
Re: Register storage type Stephen Sprunk <stephen@sprunk.org> - 2011-05-15 00:27 -0500
Re: Register storage type Angel <angel+news@spamcop.net> - 2011-05-15 12:56 +0000
Re: Register storage type Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-05-15 11:54 -0400
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-15 17:43 +0000
Re: Register storage type Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-18 23:37 -0700
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-19 14:37 +0000
Drift: Linguistics (was Re: Register storage type) Kenneth Brody <kenbrody@spamcop.net> - 2011-05-19 13:17 -0400
Re: Register storage type Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-19 11:05 -0700
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-19 19:08 +0000
Re: Register storage type Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 00:39 -0700
Re: Register storage type Ian Collins <ian-news@hotmail.com> - 2011-05-20 07:46 +1200
Re: Register storage type Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-05-19 22:37 -0400
Re: Register storage type Michael Press <rubrum@pacbell.net> - 2011-05-25 12:57 -0700
Re: Register storage type pete <pfiland@mindspring.com> - 2011-05-15 09:09 -0400
Re: Register storage type Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-05-12 21:57 -0400
Re: Register storage type Angel <angel+news@spamcop.net> - 2011-05-12 21:14 +0000
Re: Register storage type gordonb.unc3q@burditt.org (Gordon Burditt) - 2011-05-13 07:49 -0500
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-12 14:20 -0700
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-12 21:59 +0000
Re: Register storage type BGB <cr88192@hotmail.com> - 2011-05-12 15:50 -0700
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-12 15:49 -0700
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-12 23:19 +0000
Re: Register storage type Keith Thompson <kst-u@mib.org> - 2011-05-12 16:29 -0700
Re: Register storage type Seebs <usenet-nospam@seebs.net> - 2011-05-13 00:15 +0000
Re: Register storage type Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-12 15:24 -0700
Re: Register storage type Peter Nilsson <airia@acay.com.au> - 2011-05-12 17:39 -0700
csiph-web