In Blackfin, this is probably not a simple answer to the fact that 32 or 16-bit types will generate better performance because it supports 16, 32 and 64-bit commands and has two 16-bit MAC addresses. It will depend on the operations, but I suggest you trust your compiler optimizer to make such decisions, it knows more about the time and schedule of processor instructions than you probably care.
This means that in your compiler, int and short are the same size anyway. Consult the documentation, with the sizeof test, or look at the limits.h heading for numerical ranges that will determine the width or various types.
If you really want to limit the size of the data type, use stdint.h types such as int16_t .
stdint.h also defines the fastest integer types of minimum width , such as int_fast16_t , this guarantees a minimum width, but will use a larger one if it is faster on your target. This is perhaps the most portable way to solve your problem, but it relies on the developer making the right decisions about the appropriate types of use. On most architectures, it is little or no different, but on RISC and DSP architectures, which may not be the same. It may also not be the case that the specific size is the fastest under any circumstances, and this is probably especially true for Blackfin.
In some cases (when large amounts of data are transferred from external memory), the fastest size is likely to correspond to the width of the data bus.
source share