Hacker News new | ask | show | jobs
by david-given 4124 days ago
I don't think that'll work. Consider the positive integer 0b01: the shift yields 0b10, then the and yields 0.

I've actually tried to come up with a simpler example. It's tougher than you'd think, and you pretty much have to do weird stuff with flags. The superoptimiser trick is pretty neat.