3 ms·
Performance. Historically, ARM didn’t have a “load byte and sign extend” instruction (http://www.drdobbs.com/architecture-and-design/portability-the-arm-process
by Someone 8y ago
Performance. Historically, ARM didn’t have a “load byte and sign extend” instruction (http://www.drdobbs.com/architecture-and-design/portability-the-arm-processor/184405435 http://www.drdobbs.com/architecture-and-design/portability-t...), making loading a signed char and promoting it to an int slower than loading an unsigned char and promoting it to an int.
In C, a function argument or return value of type char gets promoted to int. So, code that uses char a lot does a lot of such promotions.
- loeg 8y ago> In C, a function argument or return value of type char gets promoted to int. So, code that uses char a lot does a lot of such promotions. I think you're confusing standard C and machine/implementation-specific behavior. (If not for yourself, for people who read your comment.)
- caf 8y agoIt's worse than that, arithmetic is never done in types narrower than int so even using + with a char type will do a such a promotion.