postgresql/src/include/common
Dean Rasheed d699687b32 Extend int128.h to support more numeric code.
This adds a few more functions to int128.h, allowing more of numeric.c
to use 128-bit integers on all platforms.

Specifically, int64_div_fast_to_numeric() and the following aggregate
functions can now use 128-bit integers for improved performance on all
platforms, rather than just platforms with native support for int128:

- SUM(int8)
- AVG(int8)
- STDDEV_POP(int2 or int4)
- STDDEV_SAMP(int2 or int4)
- VAR_POP(int2 or int4)
- VAR_SAMP(int2 or int4)

In addition to improved performance on platforms lacking native
128-bit integer support, this significantly simplifies this numeric
code by allowing a lot of conditionally compiled code to be deleted.

A couple of numeric functions (div_var_int64() and sqrt_var()) still
contain conditionally compiled 128-bit integer code that only works on
platforms with native 128-bit integer support. Making those work more
generally would require rolling our own higher precision 128-bit
division, which isn't supported for now.

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
2025-08-07 15:49:24 +01:00
..
archive.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
base64.h Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
blkreftable.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
checksum_helper.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
compression.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
config_info.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
connect.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
controldata_utils.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
cryptohash.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
fe_memutils.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
file_perm.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
file_utils.h pg_upgrade: Add --swap for faster file transfer. 2025-03-25 16:02:35 -05:00
hashfn.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
hashfn_unstable.h Silence warning in older versions of Valgrind 2025-02-24 18:03:29 +07:00
hmac.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
int.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
int128.h Extend int128.h to support more numeric code. 2025-08-07 15:49:24 +01:00
ip.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonapi.h Be clearer about when jsonapi's need_escapes is needed 2025-01-19 09:09:58 -05:00
keywords.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
kwlookup.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
link-canary.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
logging.h Show more-intuitive titles for psql commands \dt, \di, etc. 2025-02-05 12:45:58 -05:00
md5.h Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
oauth-common.h Add support for OAUTHBEARER SASL mechanism 2025-02-20 16:25:17 +01:00
openssl.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
parse_manifest.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
percentrepl.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_lzcompress.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pg_prng.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
relpath.h Change relpath() et al to return path by value 2025-02-25 09:02:07 -05:00
restricted_token.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
saslprep.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
scram-common.h Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
sha1.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
sha2.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
shortest_dec.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
string.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
unicode_case.h Add support for Unicode case folding. 2025-01-23 09:06:50 -08:00
unicode_case_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_category.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
unicode_category_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_east_asian_fw_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_nonspacing_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_norm.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
unicode_norm_hashfunc.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_norm_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_normprops_table.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
unicode_version.h Update Unicode data to Unicode 16.0.0 2025-04-03 12:00:09 +02:00
username.h Update copyright for 2025 2025-01-01 11:21:55 -05:00