pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify non-native 64x64-bit multiplication in int128.h.
Date: Thu, 07 Aug 2025 08:54:20 +0000
Message-ID: <E1ujwOB-001CA8-1x@gemulon.postgresql.org> (raw)

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

In the non-native code in int128_add_int64_mul_int64(), use signed
64-bit integer multiplication instead of unsigned multiplication for
the first three product terms. This simplifies the code needed to add
each product term to the result, leading to more compact and efficient
code. The actual performance gain is quite modest, but it seems worth
it to improve the code's readability.

Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://postgr.es/m/CAEZATCWgBMc9ZwKMYqQpaQz2X6gaamYRB+RnMsUNcdMcL2Mj_w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d8a08dbee46c4121bbb819df1c98533824974c45

Modified Files
--------------
src/include/common/int128.h | 48 ++++++++++++++++++++-------------------------
1 file changed, 21 insertions(+), 27 deletions(-)



Message-ID: <E1ujwOB-001CA8-1x@gemulon.postgresql.org>
Permalink:  ../E1ujwOB-001CA8-1x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ujwOB-001CA8-1x@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Simplify non-native 64x64-bit multiplication in int128.h.
  In-Reply-To: <E1ujwOB-001CA8-1x@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox