3 ms·
No division instructions, because they are many times slower than other arithmetic instructions. In many instruction sets the shifts are not even shifts, becaus
by fanf2 2y ago
No division instructions, because they are many times slower than other arithmetic instructions. In many instruction sets the shifts are not even shifts, because the multiply returns a double-width result in two registers and the shift is just a way of telling the compiler to use the register containing the top half of the result.
- nullc 2y agoWhich also the same sense that a form using % is not divisionless. When bittwiddlers speak of divisionless they mean not using the exceptionally slow div and divmod instructions. Also the same sense in that code that uses division by a compile time constant is divisionless-- any competent compiler will turn that into a multiply.