Re: GiST penalty functions [PoC]

From: Михаил Бахтерев <mob(at)k(dot)imm(dot)uran(dot)ru>
To: amborodin(at)acm(dot)org
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Subject: Re: GiST penalty functions [PoC]
Date: 2016-09-08 21:10:51
Message-ID: 20160908211051.GA1449@kite
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If you are still interested in. Here are 3 versions of pack-float. The
union version of pack-float should run faster. The code is simpler, the
dependencies are easier.

But it may be less accurate or even wrong, as for signed integers (x>>2)
and (x/4) are not the same. Consider x = -1.

You may try pack_float_good, which gives the same asm as v3, but without
warnings.

- Mikhail, respectfully

On Thu, Sep 08, 2016 at 01:29:36PM +0500, Andrew Borodin wrote:
> >autoconf check for IEEE 754 floats
> Autoconf man says folowing:
> >it is safe to assume IEEE-754 in most portable code these days
> https://www.gnu.org/software/autoconf/manual/autoconf.html#Floating-Point-Portability
>
> > A union might be more readable
> Here is union version of the patch. It's slower 10% than original cube
> and dereference version. Have no idea why.
> Select performance is improved as in v3.
>

Attachment Content-Type Size
pack-float.c text/x-c 760 bytes
pack-float.s text/x-asm 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-09-08 21:13:06 Re: CVE-2016-1238 fix breaks (at least) pg_rewind tests
Previous Message Tom Lane 2016-09-08 21:09:34 Re: Is tuplesort_heap_siftup() a misnomer?