
=
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed, distributed or reproduced without permission from Winbond.
163
Versi on 0. 4, March/2000
Halfword Multiply And Subtract
Format:
HMSB, cmplt r1,r2,t
0:5 6:10 11:15 16:18 19 20
21:25 26 27:31
05
r2
r1
~
r
1
05
6 5 5 3 1
1 5 1 5
Purpose:
To multiply two sign 16-bit halfword of GR[r1] and GR[r2], then subtract the
multiplied result from {HI, LO} accumulate register.
Description:
The corresponding 16-bit halfwords of GR[r1] and GR[r2] are interpretted as signed
operands, and are arithmetically multiplied and subtract the product from the present contents of
the {HI, LO} register, the 64-bit result is placed in {HI, LO} register, and word result is placed in
GR[t]. The bit in AIR[25] which indicates operates in integer or fraction mode determines the
high-order halfword or low-order halfword of GR[r1], GR[r2] will be as the two operands .
The completer
"
r
"
indicates operating in rounding mode, the multiply result can be truncated
the lower 16 bits when the least 16th bit is zero. IF the the least 16th bit is one, add one the high-
order 16 bits and truncate the low-order 16 bits.
Operation:
Integer mode operation (AIR[25] = 0) :
switch (cmplt) {
case r: (r=1, rounding mode){
GR[t]{0:31}
←
sign_ext(GR[r2]{16:31})
+ 16h8000)){32:63};
{HI, LO}
←
({HI, LO} - ((sign_ext(GR[r1]{16:31}) *
sign_ext(GR[r2]{16:31})
+16h8000)){0:63};
break;
}
default : (r=0, unrounding mode){
GR[t]{0:31}
←
sign_ext(GR[r2]{16:31}){32:63};
{HI,
LO}
sign_ext(GR[r2]{16:31});
break;
}
}
Fraction mode opeartion (AIR[25] = 1) :
HMSB
~
t
({HI,
LO}
-
((sign_ext(GR[r1]{16:31})
*
{HI,
LO}
-
sign_ext(GR[r1]{16:31})
*
←
{HI,
LO}
-
sign_ext(GR[r1]{16:31})
*