Technical information
Operating Precautions for CPDW9X/NT-CDR-V85X, Y-GHS-MULTI-V800
TM
Customer Notification r20tu0003ed1812 17
No. a6
Compiler uses library function instead of “mulh” instruction
Version Information
V3.3
Details
The compiler uses library function instead of “mulh” instruction of the V850 core.
Example:
test.c:
extern int a,b,c;
void foo(void)
{
a = ((short)(b>>16))*(short)c;
a = (a<<16)+(short)b*(short)c;
}
Command Sequence
ccv850 –c2000 –S –Ospeed –zda=all test.c
test.s:
_foo:
add -4,sp
st.w lp,0[sp] -- .bf
ld.h zdaoff(_c)[zero],r7
ld.w zdaoff(_b)[zero],r8
mov r7,r7
mov r8,r6
sar 16,r6
jarl ___MUL_S16_32,lp
st.w r10,zdaoff(_a)[zero]
mov r10,r9
shl 16,r9
mov r8,r6
shl 16,r6
sar 16,r6
mov r6,r6
jarl ___MUL_S16_32,lp
add r9,r10 -- .ef
st.w r10,zdaoff(_a)[zero]
ld.w 0[sp],lp
add 4,sp
jmp [lp]
Workaround
Use option –compat to compile with the compatibility mode compiler or use option --option=51.










