Subject:
|
Re: floating point operation
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 28 Nov 2001 20:46:20 GMT
|
Viewed:
|
1537 times
|
| |
| |
Kekoa Proudfoot <kekoa@graphics.stanford.edu> wrote:
> The compiler can see that t is not used. Try returning t, or copying t to
> a global before you return from main. That will make things closer I
> think, but of course the first version will still run faster in the end.
I should clarify that this is true for the first version only. For some
reason, the compiler does not optimize the second version in the same way.
Anyways, what I see in the disassembly for the first version is a loop to
100 inside a loop to 1000, with no math for t done in those loops.
Returning t, copying it to a global, or just making t a global all force
the computations on t to actually be performed.
-Kekoa
|
|
Message is in Reply To:
| | Re: floating point operation
|
| (...) Compiler optimization? At least, a disassembly of similar code showed me that that seemed to be the case. The compiler can see that t is not used. Try returning t, or copying t to a global before you return from main. That will make things (...) (23 years ago, 28-Nov-01, to lugnet.robotics.rcx.legos)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|