To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2143
2142  |  2144
Subject: 
Re: floating point operation
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 28 Nov 2001 20:46:20 GMT
Viewed: 
1438 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR