English
Language : 

W90210F Datasheet, PDF (65/67 Pages) Winbond – PA-RISC EMBEDDED CONTROLLER
W90210F
Halfword Absolute and Add
HABSADD
Format:
0:5
05
6
HABSADD, cmplt
r1, r2,t
6:10
11:15 16:17 18:20 21:25 26 27:31
r2 r1 sat - 13 - t
5 5 2 3 515
Purpose: To add multiple pairs of halfwords in parallel with absolute and optional saturation.
Description:The corresponding halfwords of GR r1 are added with the halfwords of absoluted GR r2 in
parallel. Optional saturation is performed, which forces each halfword result to either the
maximum or the minimum value, if the result would have been out of the range of the target
format. The halfword results are placed in GR t.
The completer, cmplt, determines whether modular, signed-saturation, or unsigned-saturation
arithmetic is performed. When no completer is specified (sat=3) modular arithmetic is
performed. The completer "ss" (sat=1) designates signed saturation. The completer "us" (sat=0)
indicates unsigned saturation. For signed saturation, all operands are treated as signed numbers,
and the results are signed numbers. For unsigned saturation, the first operands, from GR r1, are
treated as unsigned numbers, the second operands, from GR r2, are treated as signed numbers,
and the results are unsigned numbers.
Operation:
if (GR[r2]{0} == 1) GR[t]{0..15} ← GR[r1]{0..15} + (~GR[r2]{0..15} + 1);
else
GR[t]{0..15} ← GR[r1]{0..15} + GR[r2]{0..15} ;
if(GR[r2]{16} == 1) GR[t]{16..31} ← GR[r1]{16:31} + (~GR[r2]{16..31} + 1);
else
GR[t]{16..31} ← GR[r1]{16:31} + GR[r2]{16..31};
switch (cmplt) {
case ss: if(max_signed_sat_L)
/* sat=1*/
GR[t]{0:15} ← 0x7FFF;
else if (min_signed_sat_L)
GR[t]{0:15} ← 0x8000;
if(max_signed_sat_R)
GR[t]{16:31} ← 0x7FFF;
else if (min_signed_sat_R)
GR[t]{16:31} ← 0x8000;
break;
case us: if(max_unsigned_sat_L)
/*sat=0*/
GR[t]{0:15} ← 0xFFFF;
else if (min_unsigned_sat_L)
GR[t]{0:15} ← 0x0000;
if(max_unsigned_sat_R)
GR[t]{16:31} ← 0xFFFF;
else if (min_unsigned_sat_R)
GR[t]{16:31} ← 0x0000;
break;
default:
/*sat=3*/
break;
}
Exceptions: None
Restriction: Winbond defined instruction for W90210F.
65
The above information is the exclusive intellectual property of Winbond Electronics Corp. and shall not be disclosed, distributed or reproduced without permission from Winbond.
Version 1.4, 10/8/97