English
Language : 

W90210F Datasheet, PDF (49/67 Pages) Winbond – PA-RISC EMBEDDED CONTROLLER
W90210F
Halfword parallel subtract
Format:
HSUB,cmplt r1,r2,t
0:5
5:10
11:15
26 27:31
02
r2 r1 0 0 1 sat 0 t
6
5 5 3 1 4 21 5
Purpose: To subtract multiple pairs of halfwords in parallel with optional saturation.
HSUB
Description:The corresponding halfwords of GR r2 are subtracted from the halfwords of GR r1 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: GR[t]{0..15} ← (GR[r1]{0..15} + − GR[r2]{0..15} + 1);
GR[t]{16..31} ← (GR[r1]{16..31} + − GR[r2]{16..31} + 1);
switch (cmplt) {
case ss:
if (max_signed_sat_L)
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 ss:
if (max_unsigned_sat_L)
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:
break;
}
Exceptions: None.
/* sat=1 */
/* sat=0 */
/* sat=3 */
49
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