Re: [ANN] source code optimizer - function inlining
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [ANN] source code optimizer - function inlining
- From: Philippe Lhoste <PhiLho@...>
- Date: 2009年5月15日 17:25:37 +0200
On 15/05/2009 14:14, Olivier Hamel wrote:
code, there's some un-optimized stuff IMO (unless I'm wrong):
if __v10 then
local __v12x = __v13x
local __v14x = __v12x * __v12x
__v10 = __v14x * __v14x + 1
end
Becomes:
if __v10 then
__v10 = __v13x^4 + 1
end
It would need a bit more of magic! The tool was just unrolling the function calls, thus
the operations. Transforming a series of mathematical operations to an equivalent unique
mathematical operation is a more advanced concept.
Beside, depending on platform, using an integer power operator might result in slower
operation than several multiplications. Unless I am mistaken? Is it false on boards with
floating-point operations?
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --