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

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: John Naylor <johncnaylorls@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-15T12:42:12Z
Lists: pgsql-hackers
Hi,

On 2025-07-14 22:07:38 +0100, Dean Rasheed wrote:
> (The cfbot reports the same warnings, but you have to scroll through a
> lot of output to see them. It would be nice if the commitfest app had
> an indicator to show if there were any compiler warnings.)

FWIW, for many warnings the CompilerWarnings task will fail. It's "just" the
32bit build and msvc windows builds that currently don't...

There was a patch adding it for the msvc build at some point, but ...

Greetings,

Andres Freund



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.