Generating MAC Instruction Set

The compiler generates the imac.l instruction if the C code performs multiplication on two long operands which are casted to short type; and the product is added to a long type. For example, the following code:

short a;

short b;

long c;

.....

long d = c+((long)a*(long)b); 

.....

generates the following assembly:

move.w X:0x000000,Y0 ; Fa

move.w X:0x000000,B ; Fb

move.l X:0x000000,A ; Fc

imac.l B1,Y0,A