Re: Improving and extending int128.h to more of numeric.c

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving and extending int128.h to more of numeric.c
Date: 2025-07-10 19:14:58
Message-ID: CAEZATCXrEpV=668zK3aF_OrjUjDJ4oaOVkcY_wLPwrn3O6nVLQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 10 Jul 2025 at 15:06, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>
> > Yes, perhaps we should convert src/tools/testint128.c into a new test
> > extension, src/test/modules/test_int128
>
> Here's an update doing that (in 0001). 0002-0005 are unchanged.

v3 attached, fixing a couple of issues revealed by the cfbot:

1. The tests, as currently written, require a native int128 type to
run. To fix that, for now at least, skip the tests if the platform
lacks a native int128 type. We could perhaps improve on that by using
numerics to compute the expected results.

2. Fix Visual Studio compiler warning about applying a unary minus
operator to an unsigned type.

Regards,
Dean

Attachment Content-Type Size
v3-0001-Convert-src-tools-testint128.c-into-a-test-module.patch text/x-patch 7.0 KB
v3-0002-Refactor-int128.h-bringing-the-native-and-non-nat.patch text/x-patch 5.4 KB
v3-0004-Simplify-non-native-64x64-bit-multiplication-in-i.patch text/x-patch 3.4 KB
v3-0005-Extend-int128.h-to-support-more-numeric-code.patch text/x-patch 38.1 KB
v3-0003-Optimise-non-native-128-bit-addition-in-int128.h.patch text/x-patch 3.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-07-10 19:29:33 Re: AIO v2.5
Previous Message David E. Wheeler 2025-07-10 19:07:47 Re: encode/decode support for base64url