Technical information

Operating Precautions for CPDW9X/NT-CDR-V85X, Y-GHS-MULTI-V800
TM
Customer Notification r20tu0003ed1812 74
No. a62
16-bit multiply and divide are used instead of 32-bit operations
Version Information
V3.5.1
Details
A 16-bit multiply/divide operation is in some cases used when a 32-bit operation is needed. This
is due to the peephole optimisation which doesn’t check the type of size of operation parameter
to determine the legality of the operation.
Example:
------------
void sub2(unsigned short);
void ng_new(short para1,short para2)
add -4,sp
st.w lp,0[sp]
{
unsigned short data;
if(para1<123)
{
sxh r7
sxh r6
addi -123,r6,zero
bge .L4
data = (unsigned short)((para2 * (240 - para1) * 17) >> 12) >>10;
movea 240,zero,r15
sub r6,r15
mul r15,r7,zero
mulhi 17,r7,r11 <- this should 32bit x 32bit
shr 12,r11
andi 64512,r11,r11
sar 10,r11
mov r11,r6
zxh r6
.L4:
}
sub2(data);
jarl _sub2,lp
Command Line
ccv850e O
ccv850e Ospace
ccv850e Ospeed
Workaround
Disable peephole optimisation : -Onopeep