Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-09

Inlining SarInt64

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

August Oktobar

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.

Reply by email

Jonas Maebe
to August Oktobar
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

Reply by email

August Oktobar
to Jonas Maebe

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

Reply by email