Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: introduce masked memeq #41774
This is an idea to experiment with. I don't know whether it'll yield enough fruit to be worth the added code.
Consider this type:
We could, however, introduce a masked memeq, to which the compiler passes not only the length of the memory to compare but also a repeating mask, probably of a fixed size. For T, the mask would be something like
This would also work for structs containing blank fields (fields named _).
This could also work for hash routines: Mask out bytes before feeding them to the regular hash routine.
We could also use this as the first step in other alg routines. For example,