Instruction Set
321
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Programmable Real-Time Unit Subsystem (PRUSS)
Table 13-5. Logical Instructions
Mnemonic
Instruction
Description
CPI
AND
Bitwise And
Bitwise ANDs Rs1 with Op2 and stores to Rd.
1
OR
Bitwise Or
Bitwise ORs Rs1 with Op2 and stores to Rd.
1
XOR
Bitwise Exclusive Or
Bitwise exclusive ORs Rs1 with Op2 and stores to Rd.
1
NOT
Bitwise Invert
Bitwise inverts Rs1 and stores to Rd.
1
LSR
Logical Shift Right
Shifts Rs1 right (with zero fill) by the value given in the 5 LSBs of
Op2 and stores to Rd.
1
LSL
Logical Shift Left
Shifts Rs1 left (with zero fill) by the value given in the 5 LSBs of
Op2 and stores to Rd.
1
MIN
Minimum
Compares Rs1 and Op2 and the smaller value is copied to Rd.
1
MAX
Maximum
Compares Rs1 and Op2 and the larger value is copied to Rd.
1
CLR
Clear Bit
Copies Rs1 to Rd but with a bit specied by the 5 LSBs of Op2
cleared during the copy.
1
SET
Set Bit
Copies Rs1 to Rd but with a bit specied by the 5 LSBs of Op2
set during the copy.
1
LMBD
Left-most Bit Detect
Scans Rs1 from the leftmost bit for a bit equal to bit 0 of Rs2.
When found, the bit number (0 to 31) is written to Rd. If not
found, the value 32 is written to Rd.
1
SCAN
Scan Register File
Scans the register file for a byte pattern of a programmable
length (up to 4 bytes) with a programmable field count and field
stride.
The Op1 register contains 4 fields: Rn.b0 = offset in the register
file from R0.b0 to start scanning Rn.b1 = fc (field count), the
number of fields to scan Rn.b2 = fw (field width), the size in bytes
of the field to scan for (1, 2, or 4 bytes) Rn.b3 = fs (field stride),
the number of bytes to advance to the next field in the register
file (1 to 4 bytes)
Op1 is updated after the scan with the offset of the match (or
0xFF if no match) in Rn.b0, and the fields remaining in the scan
(including the matching field) in Rn.b1.
The Op2 is the field to scan for.
IF fw = fs
2+((fc*fw+3)/4)
ELSE 2+fc
This is a worst
case cycle
count. Matching
scans could take
fewer cycles.