aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2022-02-27 10:15:46 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2022-02-27 10:15:46 +0000
commite3d41d08a17549fdc60a8b9450c0511c11d666d7 (patch)
tree502d340d44984e6fc6d9ddc279e716593b818c6f /src/backend/tcop/postgres.c
parent6b04abdfc5e0653542ac5d586e639185a8c61a39 (diff)
downloadpostgresql-e3d41d08a17549fdc60a8b9450c0511c11d666d7.tar.gz
postgresql-e3d41d08a17549fdc60a8b9450c0511c11d666d7.zip
Apply auto-vectorization to the inner loop of div_var_fast().
This loop is basically the same as the inner loop of mul_var(), which was auto-vectorized in commit 8870917623, but the compiler will only consider auto-vectorizing the div_var_fast() loop if the assignment target div[qi + i] is replaced by div_qi[i], where div_qi = &div[qi]. Additionally, since the compiler doesn't know that qdigit is guaranteed to fit in a 16-bit NumericDigit, cast it to NumericDigit before multiplying to make the resulting auto-vectorized code more efficient (avoiding unnecessary multiplication of the high 16 bits). While at it, per suggestion from Tom Lane, change var1digit in mul_var() to be a NumericDigit rather than an int for the same reason. This actually makes no difference with modern gcc, but it might help other compilers generate more efficient assembly. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCVwsBi-ND-t82Cuuh1=8ee6jdOpzsmGN+CUZB6yjLg9jw@mail.gmail.com
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions