TriCore
®
TC1.6P & TC1.6E
32-bit Unified Processor Core
Instruction Set
V1.0 2013-07
User Manual (Volume 2) 3-16
ADD.B
Add Packed Byte
ADD.H
Add Packed Half-word
Description
Add the contents of each byte (ADD.B) or half-word (ADD.H) of D[a] and D[b] and put the result in each
corresponding byte or half-word of D[c]. The overflow condition is calculated for each byte or half-word of the
packed quantity.
ADD.BD[c], D[a], D[b] (RR)
result_byte3 = D[a][31:24] + D[b][31:24];
result_byte2 = D[a][23:16] + D[b][23:16];
result_byte1 = D[a][15:8] + D[b][15:8];
result_byte0 = D[a][7:0] + D[b][7:0];
D[c] = {result_byte3[7:0], result_byte2[7:0], result_byte1[7:0], result_byte0[7:0]};
ADD.HD[c], D[a], D[b] (RR)
result_halfword1 = D[a][31:16] + D[b][31:16];
result_halfword0 = D[a][15:0] + D[b][15:0];
D[c] = {result_halfword1[15:0], result_halfword0[15:0]};
Status Flags
C Not set by these instructions.
VADD.B
ov_byte3 = (result_byte3 > 7F
H
) OR (result_byte3 < -80
H
);
ov_byte2 = (result_byte2 > 7F
H
) OR (result_byte2 < -80
H
);
ov_byte1 = (result_byte1 > 7F
H
) OR (result_byte1 < -80
H
);
ov_byte0 = (result_byte0 > 7F
H
) OR (result_byte0 < -80
H
);
overflow = ov_byte3 OR ov_byte2 OR ov_byte1 OR ov_byte0;
if (overflow) then PSW.V = 1 else PSW.V = 0;
ADD.H
ov_halfword1 = (result_halfword1 > 7FFF
H
) OR (result_halfword1 < -8000
H
);
ov_halfword0 = (result_halfword0 > 7FFF
H
) OR (result_halfword0 < -8000
H
);
overflow = ov_halfword1 OR ov_halfword0;
if (overflow) then PSW.V = 1 else PSW.V = 0;
SV if (overflow) then PSW.SV = 1 else PSW.SV = PSW.SV;
31
c
28 27
40
H
20 19
-
18 17
-
16 15
b
12 11
a
8 7
0B
H
0
31
c
28 27
60
H
20 19
-
18 17
-
16 15
b
12 11
a
8 7
0B
H
0