Simplify non-native 64x64-bit multiplication in int128.h.
Dean Rasheed <dean.a.rasheed@gmail.com>
Author:
Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2025-08-07T08:52:30Z
Releases:
19 (unreleased)
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
Files
| Path | Change | +/− |
|---|---|---|
| src/include/common/int128.h | modified | +21 −27 |
Discussion
- Improving and extending int128.h to more of numeric.c 20 messages · 2025-06-23 → 2025-10-25