Re: Improving and extending int128.h to more of numeric.c
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: John Naylor <johncnaylorls@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-10T19:14:58Z
Lists: pgsql-hackers
Attachments
- v3-0001-Convert-src-tools-testint128.c-into-a-test-module.patch (text/x-patch) patch v3-0001
- v3-0002-Refactor-int128.h-bringing-the-native-and-non-nat.patch (text/x-patch) patch v3-0002
- v3-0004-Simplify-non-native-64x64-bit-multiplication-in-i.patch (text/x-patch) patch v3-0004
- v3-0005-Extend-int128.h-to-support-more-numeric-code.patch (text/x-patch) patch v3-0005
- v3-0003-Optimise-non-native-128-bit-addition-in-int128.h.patch (text/x-patch) patch v3-0003
On Thu, 10 Jul 2025 at 15:06, Dean Rasheed <dean.a.rasheed@gmail.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
Commits
-
Guard against division by zero in test_int128 module.
- 7e2af1fb1118 19 (unreleased) landed
-
Extend int128.h to support more numeric code.
- d699687b329e 19 (unreleased) landed
-
Simplify non-native 64x64-bit multiplication in int128.h.
- d8a08dbee46c 19 (unreleased) landed
-
Optimise non-native 128-bit addition in int128.h.
- d9bb8ef093d6 19 (unreleased) landed
-
Refactor int128.h, bringing the native and non-native code together.
- 5761d991c984 19 (unreleased) landed
-
Convert src/tools/testint128.c into a test module.
- 8c7445a00810 19 (unreleased) landed