pgsql: Simplify non-native 64x64-bit multiplication in int128.h. - Mailing list pgsql-committers

From Dean Rasheed
Subject pgsql: Simplify non-native 64x64-bit multiplication in int128.h.
Date
Msg-id E1ujwOB-001CA8-1x@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Dean Rasheed
Date:
Subject: pgsql: Optimise non-native 128-bit addition in int128.h.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: pg_upgrade: Improve message indentation