postgresql/src/backend
Tom Lane 8870917623 Apply auto-vectorization to the inner loop of numeric multiplication.
Compile numeric.c with -ftree-vectorize where available, and adjust
the innermost loop of mul_var() so that it is amenable to being
auto-vectorized.  (Mainly, that involves making it process the arrays
left-to-right not right-to-left.)

Applying -ftree-vectorize actually makes numeric.o smaller, at least
with my compiler (gcc 8.3.1 on x86_64), and it's a little faster too.
Independently of that, fixing the inner loop to be vectorizable also
makes things a bit faster.  But doing both is a huge win for
multiplications with lots of digits.  For me, the numeric regression
test is the same speed to within measurement noise, but numeric_big
is a full 45% faster.

We also looked into applying -funroll-loops, but that makes numeric.o
bloat quite a bit, and the additional speed improvement is very
marginal.

Amit Khandekar, reviewed and edited a little by me

Discussion: https://postgr.es/m/CAJ3gD9evtA_vBo+WMYMyT-u=keHX7-r8p2w7OSRfXf42LTwCZQ@mail.gmail.com
2020-09-06 21:40:39 -04:00
..
access Yet more elimination of dead stores and useless initializations. 2020-09-05 13:17:32 -04:00
bootstrap Improve some ancient, crufty code in bootstrap + initdb. 2020-09-05 16:20:04 -04:00
catalog Fix misleading error message about inconsistent moving-aggregate types. 2020-09-06 12:55:13 -04:00
commands Yet more elimination of dead stores and useless initializations. 2020-09-05 13:17:32 -04:00
executor Be more careful about the shape of hashable subplan clauses. 2020-08-14 22:14:03 -04:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Fix a few typos in JIT comments and README 2020-08-21 09:33:56 +12:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:14:23 -07:00
libpq Refactor pg_get_line() to expose an alternative StringInfo-based API. 2020-09-06 14:13:19 -04:00
main Clean up includes of s_lock.h. 2020-06-18 19:41:05 -07:00
nodes Remove variable "concurrent" from ReindexStmt 2020-09-04 10:43:32 +09:00
optimizer Remove some more useless assignments. 2020-09-04 14:32:19 -04:00
parser Remove some more useless assignments. 2020-09-04 14:32:19 -04:00
partitioning Remove some more useless assignments. 2020-09-04 14:32:19 -04:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Add huge_page_size setting for use on Linux. 2020-07-17 14:33:00 +12:00
postmaster Avoid lockup of a parallel worker when reporting a long error message. 2020-09-03 16:52:09 -04:00
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication Fix over-eager ping'ing in logical replication receiver. 2020-09-04 20:33:36 -04:00
rewrite Redefine pg_class.reltuples to be -1 before the first VACUUM or ANALYZE. 2020-08-30 12:21:51 -04:00
snowball code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
statistics Remove some more useless assignments. 2020-09-04 14:32:19 -04:00
storage Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
tcop Remove variable "concurrent" from ReindexStmt 2020-09-04 10:43:32 +09:00
tsearch Yet more elimination of dead stores and useless initializations. 2020-09-05 13:17:32 -04:00
utils Apply auto-vectorization to the inner loop of numeric multiplication. 2020-09-06 21:40:39 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00