-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_Fill_memset_is_safe is a dynamic property and should work for multi-byte objects with identical bytes #3167
Comments
Checking the value and branching could be significant pessimization. Instead we can implement vector fill with 2, 4, and 8 byte types, like we already have vector find. |
Sorry I'm confused, how could you avoid checking the value or branching in the 2/4/8 cases? Don't you have to ensure the value is (say) zero before you can call |
In the 2/4/8-byte cases the intent is just not calling |
Oh I see. I suppose that might work? It's confusing for me why you'd do it that way though, it seems rather roundabout. Right now I see:
The case I see missing is:
So for N-byte objects we're already incurring a branch on
Both of these would be much more general than the scalar case. |
I think we can go at least:
Though 2-byte looks more important to me, as it is about Any of these will not check values. I did a similar thing here already we had
See #2434 |
We talked about this at the weekly maintainer meeting. Vectorized algorithms to |
I've looked into the existing Lines 4900 to 4903 in e6a12f7
Guess it will not work for |
I guess |
Hi, I just wanted to mention that
_Fill_memset_is_safe
"should" work for types other thanchar
orbool
. In particular, it should work for multi-byte objects whose byte representation has the same bytes repeated (with -1 being a typical case). It would be great if this could be implemented. Thanks!STL/stl/inc/xutility
Lines 4313 to 4318 in 2f8342a
The text was updated successfully, but these errors were encountered: