You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggested by @ahsonkhan to avoid integer overflow in bound checking inside SSE/AVX intrinsics implementation, i.e. change all while (pCurrent + 8 OR 4 <= pEnd) into while (pEnd - pCurrent >= 8 OR 4).
Perf tests results before and after the change are shown below:
Both SSE and AVX implementations are slower by 10-20% after this change.
In my opinion, after seeing the perf results, I may not recommend merging this PR. I may wait until the alternative suggested by @tannergooding in an earlier PR review has been implemented (2nd item under "Functionality" in briancylui#2):
Another question I have is: would pDstCurrent + 8 OR 4 ever have the possibility to result in integer overflow? According to my knowledge, pEnd is initialized as pDstCurrent + count, and there are Contract.Asserts in the wrapper class to check that count does not exceed the original array length. I'm not sure, and am open to any PR comments and advice.
#821 references and aims to solve this issue.
Suggested by @ahsonkhan to avoid integer overflow in bound checking inside SSE/AVX intrinsics implementation, i.e. change all
while (pCurrent + 8 OR 4 <= pEnd)
intowhile (pEnd - pCurrent >= 8 OR 4)
.Perf tests results before and after the change are shown below:
Before the change:
After the change:
Both SSE and AVX implementations are slower by 10-20% after this change.
In my opinion, after seeing the perf results, I may not recommend merging this PR. I may wait until the alternative suggested by @tannergooding in an earlier PR review has been implemented (2nd item under "Functionality" in briancylui#2):
Another question I have is: would
pDstCurrent + 8 OR 4
ever have the possibility to result in integer overflow? According to my knowledge,pEnd
is initialized aspDstCurrent + count
, and there areContract.Asserts
in the wrapper class to check thatcount
does not exceed the original array length. I'm not sure, and am open to any PR comments and advice.cc: @danmosemsft @eerhardt @tannergooding @ahsonkhan @markusweimer
The text was updated successfully, but these errors were encountered: