forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite3d41d0
committed
Apply auto-vectorization to the inner loop of div_var_fast().
This loop is basically the same as the inner loop of mul_var(), whichwas auto-vectorized in commit8870917, but the compiler will onlyconsider auto-vectorizing the div_var_fast() loop if the assignmenttarget div[qi + i] is replaced by div_qi[i], where div_qi = &div[qi].Additionally, since the compiler doesn't know that qdigit isguaranteed to fit in a 16-bit NumericDigit, cast it to NumericDigitbefore multiplying to make the resulting auto-vectorized code moreefficient (avoiding unnecessary multiplication of the high 16 bits).While at it, per suggestion from Tom Lane, change var1digit inmul_var() to be a NumericDigit rather than an int for the samereason. This actually makes no difference with modern gcc, but itmight 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.com1 parent6b04abd commite3d41d0
1 file changed
+11
-2
lines changedLines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8323 | 8323 |
| |
8324 | 8324 |
| |
8325 | 8325 |
| |
8326 |
| - | |
| 8326 | + | |
8327 | 8327 |
| |
8328 | 8328 |
| |
8329 | 8329 |
| |
| |||
8908 | 8908 |
| |
8909 | 8909 |
| |
8910 | 8910 |
| |
| 8911 | + | |
| 8912 | + | |
| 8913 | + | |
| 8914 | + | |
| 8915 | + | |
| 8916 | + | |
| 8917 | + | |
| 8918 | + | |
8911 | 8919 |
| |
8912 | 8920 |
| |
8913 | 8921 |
| |
8914 | 8922 |
| |
| 8923 | + | |
8915 | 8924 |
| |
8916 | 8925 |
| |
8917 |
| - | |
| 8926 | + | |
8918 | 8927 |
| |
8919 | 8928 |
| |
8920 | 8929 |
| |
|
0 commit comments
Comments
(0)