> On 2010-08-13 23:21:30, Gabe Black wrote: > > src/base/intmath.hh, line 84 > > <http://reviews.m5sim.org/r/164/diff/1/?file=1817#file1817line84> > > > > This isn't particularly efficient. A better algorithm would be to > > square n over and over and multiply it in if the appropriate bit in e is > > set. I'm surprised there isn't already a standard library function to do > > this, but I wasn't able to find one quickly with Google. > > > > Also, by setting result = 1, e == 0 doesn't need to be a special case.
It depends on what the typical exponents are... looking at where this is used, I expect them to be very small. In that case, I prefer the simplicity of this approach. There is a pow() function in the C library for doubles, but I doubt that it would be more efficient with the conversion overhead. I suggest adding a warn() when this overflows, since that would be easy to do. - Steve ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/164/#review176 ----------------------------------------------------------- On 2010-08-13 09:44:12, Ali Saidi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.m5sim.org/r/164/ > ----------------------------------------------------------- > > (Updated 2010-08-13 09:44:12) > > > Review request for Default. > > > Summary > ------- > > ARM: Add I/O devices for booting linux > > > Diffs > ----- > > src/base/intmath.hh 3c48b2b3cb83 > src/dev/arm/RealView.py PRE-CREATION > src/dev/arm/SConscript 3c48b2b3cb83 > src/dev/arm/Versatile.py 3c48b2b3cb83 > src/dev/arm/amba_device.hh PRE-CREATION > src/dev/arm/amba_device.cc PRE-CREATION > src/dev/arm/amba_fake.hh PRE-CREATION > src/dev/arm/amba_fake.cc PRE-CREATION > src/dev/arm/gic.hh PRE-CREATION > src/dev/arm/gic.cc PRE-CREATION > src/dev/arm/pl011.hh PRE-CREATION > src/dev/arm/pl011.cc PRE-CREATION > src/dev/arm/realview.hh PRE-CREATION > src/dev/arm/realview.cc PRE-CREATION > src/dev/arm/rv_ctrl.hh PRE-CREATION > src/dev/arm/rv_ctrl.cc PRE-CREATION > src/dev/arm/timer_sp804.hh PRE-CREATION > src/dev/arm/timer_sp804.cc PRE-CREATION > src/dev/arm/versatile.hh 3c48b2b3cb83 > src/dev/arm/versatile.cc 3c48b2b3cb83 > > Diff: http://reviews.m5sim.org/r/164/diff > > > Testing > ------- > > > Thanks, > > Ali > > _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev