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: John Naylor <johncnaylorls@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-15T00:10:20Z
Lists: pgsql-hackers

Attachments

On Mon, 14 Jul 2025 at 22:07, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> > warning: format ‘%lX’ expects argument of type ‘long unsigned int’,
> > but argument 4 has type ‘int32’ {aka ‘int’} [-Wformat=]
> >
> v4 attached.

v5 attached, fixing some more printf-related compiler warnings, this
time from the original test code.

Regards,
Dean

Commits

  1. Guard against division by zero in test_int128 module.

  2. Extend int128.h to support more numeric code.

  3. Simplify non-native 64x64-bit multiplication in int128.h.

  4. Optimise non-native 128-bit addition in int128.h.

  5. Refactor int128.h, bringing the native and non-native code together.

  6. Convert src/tools/testint128.c into a test module.