]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Simplify non-native 64x64-bit multiplication in int128.h.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 7 Aug 2025 08:52:30 +0000 (09:52 +0100)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 7 Aug 2025 08:52:30 +0000 (09:52 +0100)
commitd8a08dbee46c4121bbb819df1c98533824974c45
tree31bc1c8df83f8f4614b180d32598aa9c9bf115fa
parentd9bb8ef093d62763cfd19d37e6bb8182998a3f88
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
src/include/common/int128.h