Re: [HACKERS] Use static inline functions for Float <-> Datum conversions

2016-08-31 Thread Tom Lane
Heikki Linnakangas writes: > On 08/31/2016 02:38 PM, Tom Lane wrote: >> I wonder whether there is a compiler-dependent way of avoiding the union >> trick ... or maybe gcc is already smart enough that it doesn't matter? > It seems to compile into a single instruction, so it can't get any > better

Re: [HACKERS] Use static inline functions for Float <-> Datum conversions

2016-08-31 Thread Heikki Linnakangas
On 08/31/2016 02:38 PM, Tom Lane wrote: Heikki Linnakangas writes: Now that we are OK with static inline functions, we can save some cycles from floating-point functions, by turning Float4GetDatum, Float8GetDatum, and DatumGetFloat8 into static inlines. Looks good to me. Ok, will push. I

Re: [HACKERS] Use static inline functions for Float <-> Datum conversions

2016-08-31 Thread Tom Lane
Heikki Linnakangas writes: > Now that we are OK with static inline functions, we can save some cycles > from floating-point functions, by turning Float4GetDatum, > Float8GetDatum, and DatumGetFloat8 into static inlines. Looks good to me. I wonder whether there is a compiler-dependent way of av

[HACKERS] Use static inline functions for Float <-> Datum conversions

2016-08-31 Thread Heikki Linnakangas
Hi, Now that we are OK with static inline functions, we can save some cycles from floating-point functions, by turning Float4GetDatum, Float8GetDatum, and DatumGetFloat8 into static inlines. They are only a few instructions, but couldn't be implemented as macros before, because they need a lo