Extract and Sign-Extend a Bit Field
EXT
3-59
TMS320C62x/C67x Fixed-Point Instruction Set
Syntax
EXT (.unit)
src2, csta, cstb, dst
or
EXT (.unit)
src2, src1, dst
.unit = .S1 or .S2
Opcode map field used...
For operand type...
Unit
src2
csta
cstb
dst
sint
ucst5
ucst5
sint
.S1, .S2
src2
src1
dst
xsint
uint
sint
.S1, .S2
Opcode
Constant form:
5
z
6
5
0
dst
0
0
1
0
s
p
31
creg
29 28 27
1
3
18 17
23 22
src2
5
csta
13
5
12
1
1
8
cstb
7
5
2
0 1
Register form:
5
z
6
5
0
dst
1
0
0
0
s
p
31
creg
29 28 27
1
3
18 17
23 22
src2
5
src1
13
5
12
1
1
6
x
11
1
0 1
1
1
1
Description
The field in
src2, specified by csta and cstb, is extracted and sign-extended
to 32 bits. The extract is performed by a shift left followed by a signed shift right.
csta and cstb are the shift left amount and shift right amount, respectively. This
can be thought of in terms of the LSB and MSB of the field to be extracted. Then
csta = 31 – MSB of the field and cstb = csta + LSB of the field. The shift left and
shift right amounts may also be specified as the ten LSBs of the
src1 register
with
cstb being bits 0–4 and csta bits 5–9. In the example below, csta is 12 and
cstb is 11 + 12 = 23. Only the ten LSBs are valid for the register version of the
instruction. If any of the 22 MSBs are non-zero, the result is invalid.