Hacker News new | ask | show | jobs
by stephencanon 4536 days ago
AND with 0xefffffff would become BIC ("bit clear", aka "and not") with 0x10000000. But yes, the basic idea of your comment is correct. Fortunately, compilers are quite good at this sort of thing.
1 comments

And if you need something like ~(byte << N) for any purpose there's still MVN (move-not).

     MVN r0, #0x10000000 ; ro = 0xefffffff
Oh, the joy :-).
CMN is the real gem. It's an endless source of bugs in the time between when compiler writers discover it and when they figure out how it actually sets flags. ARM would have done well to provide a "here's how you actually use this instruction" guide in the architecture reference manual.