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
{{ message }}
Repository navigation
Possible simplification of is_made_of_eight_digits_fast #32
The ! and & operations should become a test instruction on x86. So it should be the same speed as @Kristine1975 suggestion. The term val - 0x3030303030303030 is needed immediately after the check ... so calculating it during the check may save one instruction down the road.
Activity
lemire commentedon Nov 12, 2020
To be reviewed and assessed. Thanks.
aqrit commentedon Nov 12, 2020
From #28:
return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) & 0x8080808080808080));The
!and&operations should become atestinstruction on x86. So it should be the same speed as @Kristine1975 suggestion. The termval - 0x3030303030303030is needed immediately after the check ... so calculating it during the check may save one instruction down the road.