2 ms·
"ARM handles signed and unsigned numbers equally." Yep, you are right. I wrote this in a hurry and forget that what I was thinking about was arguments passing
by pietrofmaggi 16y ago
"ARM handles signed and unsigned numbers equally."
Yep, you are right.
I wrote this in a hurry and forget that what I was thinking about was arguments passing in functions. C compilers has to "trim values" if the parameter are not signed int.
- mansr 16y agoWrong again. Function parameters are passed as if the values were assigned to variables of the corresponding types using the usual implicit conversion rules. If the function parameter has type of different width than the value being passed, a truncation or sign/zero extension happens. A signed value assigned to an equal-width unsigned parameter retains the same bit pattern (in 2's complement). Unsigned to signed conversion is potentially unspecified (out of range values). All known ARM compilers convert from unsigned to signed by keeping the bits unchanged. In no case does the signedness of parameters affect the speed of the compiled code (on ARM).
- pietrofmaggi 16y agoYep^2 Thanks for remembering this. Time to take a break for today.