home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.misc
- Subject: Re: Pointers
- Date: 16 Nov 92 13:55:34
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 28
- Message-ID: <TMB.92Nov16135534@arolla.idiap.ch>
- References: <721539019@sheol.UUCP> <BxLyv1.CG4@mentor.cc.purdue.edu> <721626972@sheol.UUCP>
- <BxpsHo.MID@mentor.cc.purdue.edu> <721864322@sheol.UUCP>
- Reply-To: tmb@idiap.ch
- NNTP-Posting-Host: arolla.idiap.ch
- In-reply-to: throopw@sheol.UUCP's message of 16 Nov 92 00:15:16 GMT
-
- In article <721864322@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
-
- : From: hrubin@mentor.cc.purdue.edu (Herman Rubin)
- : This is not a change in subject. It is the question of whether one
- : is allowed to directly use the machine hardware, or whether one must
- : HOPE that the compiler writer considered what you are doing when the
- : compiler was produced.
-
- Nonsense. Even if your notation is a pointer notation, you must HOPE
- that the compiler writer will translate that into the machine
- instructions you think are best for your task.
-
- In fact, more importantly, if you use pointer notation when you mean
- array indexing, you are going to get less then optimal performance on
- different hardware. Array indexing can be transformed relatively
- easily by a compiler into pointer code, but the reverse transformation
- is much harder.
-
- This lesson generalizes: if you provide a wide array of high-level
- abstractions, the compiler can choose the best implementation for the
- given hardware, and if you choose your abstractions well, there need
- not be any runtime cost associated with this. On the other hand, if
- you program directly in terms of low-level features, you may be able
- to optimize your code for one particular architecture (but only if you
- know exactly what you are doing), but you will get poor performance on
- other architectures.
-
- Thomas.
-