Custom Operations
All of custom operations use "unsigned int" as arguments. The
following are all of the operations you might find useful:
A
- ALLOCATE(a, n) -- Allocate n blocks in the cache starting at a.
- ASLI(shift, a) -- Arithmetic shift left immediate.
- ASRI(shift, a) -- Arithmetic shift right immediate.
B
- BITANDINV(a, b) -- Compute the bitwise, logical and of the first argument with
the one's complement of the second argument.
- BORROW(a, b) -- Compute borrow bit from unsigned subtract.
C
- CARRY(a, b) -- Compute carry bit from unsigned add.
- COPYBACK(a, n) -- Copy back to memory location a, n bytes.
D
- DSPIABS(a) -- Clipped absolute value.
- DSPIADD(a, b) -- Clipped signed add.
- DSPIDUALABS(a) -- Dual clipped absolute value of signed 16-bit halfwords.
- DSPIDUALADD(a, b) -- Dual clipped add of signed 16-bit halfwords.
- DSPIDUALSUB(a, b) -- Dual clipped subtraction of signed 16-bit halfwords.
- DSPIDUALMUL(a, b) -- Dual clipped multiplication of signed
16-bit halfwords.
- DSPIMUL(a, b) -- Clipped signed multiplication.
- DSPISUB(a, b) -- Clipped signed subtract.
- DSPUMUL(a, b) -- Clipped unsigned multiplication.
- DSPUQUADADUI(a, b) -- Quad clipped add of unsigned/signed bytes.
- DSPUSUB(a, b) -- Clipped unsigned subtraction.
- DUALASR(a, b) -- Dul 16 arithmetic shift right.
F
- FUNSHIFT1(a, b) -- Funnel-shift 1 byte.
- FUNSHIFT2(a, b) -- Funnel-shift 2 bytes.
- FUNSHIFT3(a, b) -- Funnel-shift 3 bytes.
I
- IABS(a) -- The absolute value of a.
- IADDI(imm, a) -- Integer add with immediate.
- IAVGONEP(a, b) -- Signed average.
- IBYTESEL(a, sel) -- Select signed byte.
- ICLIPI(a, b) -- Clip signed to signed.
- IEQLI(imm, a) -- Signed compare equal with immediate.
- IFIR16(a, b) -- Sum of products of signed 16-bit halfwords.
- IFIR8II(a, b) -- Signed sum of products of signed bytes.
- IFIR8IU(a, b) -- Signed sum of products of signed/unsigned bytes.
- IFIR8UI(a, b) -- Signed sum of products of unsigned/signed bytes.
- IFLIP(a, b) -- If non-zero, negate.
- IGEQI(imm, a) -- Signed compare greater than or equal to with immediate.
- IGTRI(imm, a) -- Signed compare greater than with immediate.
- ILESI(imm, a) -- Signed compare less with immediate.
- ILEQI(imm, a) -- Signed compare less than or equal to with
immediate.
- IMAX(a, b) -- The integer maximum between a and b
- IMIN(a, b) -- The integer minimum between a and b.
- IMULM(a, b) -- Signed multiply, return most-significant 32 bits
- INEG(a) -- The negation of a.
- INEQI(imm, a) -- Signed compare not equal with immediate.
- INONZERO(a, b) -- If nonzero, selecgt non-zero.
- INVALIDATE(a, n) -- Invalidate in the cache address a for n
bytes.
- ISUBI(imm, a) -- Integer subtract with immediate.
- IZERO(a, b) -- If zero, select zero.
L
- LSRI(shift, a) -- Logical shift right immediate.
- LSLI(shift, a) -- Logical shift left immediate.
M
- MERGEDUAL16LSB(a, b) -- Merge dual 16 bit least significant bytes.
- MERGELSB(a, b) -- Merge least significant bytes.
- MERGEMSB(a, b) -- Merge most significant bytes.
- MUX(a, b, c) -- If a is true, return b, otherwise return c.
P
- PACKBYTES(a, b) -- Pack least significant byte. (returns lsbs of a:b)
- PACK16MSB(a, b) -- Pack 16 most significant bits.
- PACK16LSB(a, b) -- Pack 16 least significant bits.
- PREFETCH(a, n) -- Prefetch n blocks (1 block = 64 bytes) starting
at a into the cache.
Q
- QUADAVG(a, b) -- Unsigned byte-wise quad average.
- QUADUMAX(a, b) -- Unsigned byte-wise quad maximum.
- QUADUMIN(a, b) -- Unsigned byte-wise quad minimum.
- QUADUMULMSB(a, b) -- Unsigned quad 8-bit multiply most significant.
R
- ROL(a, b) -- Rotate a left b times.
- ROLI(shift, a) -- Rotate left immediate.
S
- SEX8(a) -- Sign extend eight bits.
- SEX16(a) -- Sign extend sixteen bits.
U
- UBYTESEL(a, sel) -- Select unsigned byte.
- UCLIPI(a, b) -- Clip signed to unsigned.
- UCLIPU(a, b) -- Clip unsigned to unsigned.
- UEQLI(imm, a) -- Unsigned compare equal with immediate.
- UFIR16(a, b) -- Sum of products of unsigned 16-bit halfwords.
- UFIR8UU(a, b) -- Unsigned sum of products of unsigned bytes.
- UGEQI(imm, a) -- Unsigned compare greater than or equal to with immediate.
- UGTRI(imm, a) -- Unsigned compare greater than with immediate.
- ULEQI(imm, a) -- Unsigned compare less than or equal to
immediate.
- ULESI(imm, a) -- Unsigned compare less than immediate.
- UME8II(a, b) -- Unsigned sum of absolute values of signed 8-bit differences.
- UME8UU(a, b) -- Sum of absolute values of unsigned 8-bit
differences.
- UMULM(a, b) -- Unsigned multiply, return most-significant 32 bits.
- UNEQI(imm, a) -- Unsigned compare not equal with immediate.
Z
- ZEX8(a) -- Zero extend eight bits.
- ZEX16(a) -- Zero extend sixteen bits.
CS122B, Winter 2002.