Why this function cannot be inlined? In some code doing int64 shifting/dividing math, it is not inlined as other similar compiler functions (round, odd etc.)? i am using FPC 2.7.1 32 bit.
Mailing lists / fpc-devel / 2013-09
Inlining SarInt64
3 messages · 2 people · –
- AAugust Oktobar 2
- JJonas Maebe 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
August Oktobar wroteWhy this function cannot be inlined? In some code doing int64 shifting/dividing math, it is not inlined as other similar compiler functions (round, odd etc.)? i am using FPC 2.7.1 32 bit.
It's not inline because it is not declared as "inline". Always inlining it is probably not a good idea, because that function is not really small and hence will code significant code bloat. Adaptive inlining (depending on the number of constant parameters and the resulting code size, or possibly based on profiling information) would be nice, but FPC does not support this.
Jonas
I understand. BTW, in GCC compilers this is always inlined (int64 div X) .
Jonas Maebe wrote 23 lines
On 25 Sep 2013, at 00:11, August Oktobar wrote:
Why this function cannot be inlined? In some code doing int64
shifting/dividing math, it is not inlined as other similar compiler
functions (round, odd etc.)? i am using FPC 2.7.1 32 bit.
It's not inline because it is not declared as "inline". Always inlining it
is probably not a good idea, because that function is not really small and
hence will code significant code bloat. Adaptive inlining (depending on the
number of constant parameters and the resulting code size, or possibly
based on profiling information) would be nice, but FPC does not support
this.
Jonas
_______________________________________________
fpc-devel maillist -
http://lists.freepascal.org/mailman/listinfo/fpc-devel
