Is the `if` statement redundant before modulo and before assign operations?

If you want to understand what the compiler is doing, you’ll need to just pull up some assembly. I recommend this site (I already entered code from the question)): https://godbolt.org/g/FwZZOb. The first example is more interesting. int div(unsigned int num, unsigned int num2) { if( num >= num2 ) return num % num2; return num; … Read more

What is the difference between the ARM, Thumb and Thumb 2 instruction encodings?

Oh, ARM and their silly naming… It’s a common misconception, but officially there’s no such thing as a “Thumb-2 instruction set”. Ignoring ARMv8 (where everything is renamed and AArch64 complicates things), from ARMv4T to ARMv7-A there are two instruction sets: ARM and Thumb. They are both “32-bit” in the sense that they operate on up-to-32-bit-wide … Read more