Runtime  Version 1.0
PULP Kernel Library
 All Files Functions Typedefs Groups Pages

Functions

unsigned int __builtin_pulp_fl1 (int x)
 Bit position of the last bit set in x starting from MSB. More...
 
unsigned int __builtin_pulp_ff1 (int x)
 Bit position of the first bit set in x, starting from LSB. More...
 
unsigned int __builtin_pulp_clb (int x)
 Count leading bits of x. More...
 
unsigned int __builtin_pulp_cnt (int x)
 Count number of bits at 1 in x. More...
 
unsigned int __builtin_pulp_parity (int x)
 Returns x's parity. More...
 
int __builtin_pulp_bclr (int x, unsigned int mask)
 Clears x's bit not at 1 in mask, mask = ~((2^size -1)<<pos), mask is immediate. More...
 
int __builtin_pulp_bclr_r (int x, unsigned int mask)
 Clears size x's bit starting from off, mask[9..5] = size-1, mask[4..0] = off. More...
 
int __builtin_pulp_bset (int x, unsigned int mask)
 Sets x's at 1 in mask, mask = (2^size -1)<<pos, mask is immediate. More...
 
int __builtin_pulp_bset_r (int x, unsigned int mask)
 Sets size x's starting at off, mask = (2^size -1)<<pos. More...
 
int __builtin_pulp_bextract (int x, unsigned int size, unsigned int off)
 Extracts size bits from x starting at offset off, sign extended. size and off immediates and in [0..31], (off+size)<=32. More...
 
int __builtin_pulp_bextract_r (int x, unsigned int mask)
 Extracts size bits from x starting at offset off, size-1 in mask[9..5], off in mask[4..0], sign extended. More...
 
unsigned int __builtin_pulp_bextractu (int x, unsigned int size, unsigned int off)
 Extracts size bits from x starting at offset off, zero extended. size and off immediates and in [0..31], (off+size)<=32. More...
 
unsigned int __builtin_pulp_bextractu_r (int x, unsigned int mask)
 Extracts size bits from x starting at offset off, size-1 in mask[9..5], off in mask[4..0], zero extended. More...
 
int __builtin_pulp_binsert (int dst, unsigned int not_mask_imm, int src, unsigned int mask_imm, unsigned int off)
 Inserts first size bits of src into dst at offset off. size and off given by 2 immediate masks: not_mask_imm, mask_imm. More...
 
int __builtin_pulp_binsert_r (int dst, int src, unsigned int mask_extract_insert, unsigned int off)
 Inserts first size bits of src into dst at offset off. size-1 in mask_extract_insert[9..5], off in mask_extract_insert[4..0]. More...
 
int __builtin_pulp_rotr (int x)
 One bit right rotation. More...
 

Description

Function Documentation

int __builtin_pulp_bclr ( int  x,
unsigned int  mask 
)

Clears x's bit not at 1 in mask, mask = ~((2^size -1)<<pos), mask is immediate.

Available macros:

    gap8_bitclr(x, size, off);
    __BITCLR(x, size, off);
Parameters
xArgument
maskmask = ~((2^size -1)<<pos), immediate

Referenced by __BITCLR(), and gap8_bitclr().

int __builtin_pulp_bclr_r ( int  x,
unsigned int  mask 
)

Clears size x's bit starting from off, mask[9..5] = size-1, mask[4..0] = off.

Available macros:

    gap8_bitclr_r(x, size, off)
    __BITCLR_R(x, size, off)
Parameters
xArgument
maskmask[9..5] = size-1, mask[4..0] = off

Referenced by __BITCLR_R(), __BITCLR_R_SAFE(), gap8_bitclr_r(), and gap8_bitclr_r_safe().

int __builtin_pulp_bextract ( int  x,
unsigned int  size,
unsigned int  off 
)

Extracts size bits from x starting at offset off, sign extended. size and off immediates and in [0..31], (off+size)<=32

Available macros:

    gap8_bitextract(x, size, off)
    __BITEXTRACT(x, size, off)
Parameters
xArgument
sizeExtract size bits from x
offExtract from x at position off, in [0..31]

Referenced by __BITEXTRACT(), and gap8_bitextract().

int __builtin_pulp_bextract_r ( int  x,
unsigned int  mask 
)

Extracts size bits from x starting at offset off, size-1 in mask[9..5], off in mask[4..0], sign extended.

Available macros:

    gap8_bitextract_r(x, size, off)
    __BITEXTRACT_R(x, size, off)
Parameters
xArgument
maskmask[9..5]: extract size, mask[4..0]: extract offset

Referenced by __BITEXTRACT_R(), __BITEXTRACT_R_SAFE(), gap8_bitextract_r(), and gap8_bitextract_r_safe().

unsigned int __builtin_pulp_bextractu ( int  x,
unsigned int  size,
unsigned int  off 
)

Extracts size bits from x starting at offset off, zero extended. size and off immediates and in [0..31], (off+size)<=32

Available macros:

    gap8_bitextractu(x, size, off)
    __BITEXTRACTU(x, size, off)
Parameters
xArgument
sizeExtract size bits from x
offExtract from x at position off, in [0..31]

Referenced by __BITEXTRACTU(), and gap8_bitextractu().

unsigned int __builtin_pulp_bextractu_r ( int  x,
unsigned int  mask 
)

Extracts size bits from x starting at offset off, size-1 in mask[9..5], off in mask[4..0], zero extended.

Available macros:

    gap8_bitextractu_r(x, size, off)
    __BITEXTRACTU_R(x, size, off)
Parameters
xArgument
maskmask[9..5]: extract size, mask[4..0]: extract offset

Referenced by __BITEXTRACTU_R(), __BITEXTRACTU_R_SAFE(), gap8_bitextractu_r(), and gap8_bitextractu_r_safe().

int __builtin_pulp_binsert ( int  dst,
unsigned int  not_mask_imm,
int  src,
unsigned int  mask_imm,
unsigned int  off 
)

Inserts first size bits of src into dst at offset off. size and off given by 2 immediate masks: not_mask_imm, mask_imm. Returns dst after insertion of src.

    Given size and off:
            not_mask_imm = ~((2^size-1)<<off)
            mask_imm = ((2^size-1)<<off)
    Warning: if mask_imm != ~not_mask_imm an error wil be generated

Available macros:

    gap8_bitinsert(x, size, off)
    __BITINSERT(x, size, off)
Parameters
dstInsert into dst
not_mask_immNot extraction mask: ~((2^size-1)<<off)
srcSource. First size bits of src are inserted into dst at position off
mask_immExtraction mask: (2^size-1)<<off
offoffset, in [0..31]

Referenced by __BITINSERT(), and gap8_bitinsert().

int __builtin_pulp_binsert_r ( int  dst,
int  src,
unsigned int  mask_extract_insert,
unsigned int  off 
)

Inserts first size bits of src into dst at offset off. size-1 in mask_extract_insert[9..5], off in mask_extract_insert[4..0].xi Returns dst after insertion of src.

Available macros:

    gap8_bitinsert_r(x, size, off)
    __BITINSERT_R(x, size, off)
Parameters
dstDestination
srcSource. First size bits of src are inserted into dst at position off
mask_extract_insertsize-1 in mask_extract_insert[9..5], off in mask_extract_insert[4..0]
offextraction offset, also present of mask_insert_extract

Referenced by __BITINSERT_R(), __BITINSERT_R_SAFE(), gap8_bitinsert_r(), and gap8_bitinsert_r_safe().

int __builtin_pulp_bset ( int  x,
unsigned int  mask 
)

Sets x's at 1 in mask, mask = (2^size -1)<<pos, mask is immedidate.

Available macros:

    gap8_bitset(x, size, off)
    __BITSET(x, size, off)
Parameters
xArgument
maskmask = (2^size -1)<<pos, mask is immediate.

Referenced by __BITSET(), and gap8_bitset().

int __builtin_pulp_bset_r ( int  x,
unsigned int  mask 
)

Sets size x's starting at off, mask = (2^size -1)<<pos

Available macros:

    gap8_bitset_r(x, size, off)
    __BITSET_R(x, size, off)
Parameters
xArgument
maskmask[9..5] = size-1, mask[4..0] = off

Referenced by __BITSET_R(), __BITSET_R_SAFE(), gap8_bitset_r(), and gap8_bitset_r_safe().

unsigned int __builtin_pulp_clb ( int  x)

Count leading bits of x. This is the number of consecutive 1’s or 0’s from MSB. If x0 is 0, returns 0.

Equivalent to pure gcc sequence __builtin_clrsb((x))

Parameters
xArgument

Referenced by __CLB(), and gap8_clb().

unsigned int __builtin_pulp_cnt ( int  x)

Count number of bits at 1 in x.

Equivalent to pure gcc sequence __builtin_popcount((x))

Parameters
xArgument
unsigned int __builtin_pulp_ff1 ( int  x)

Bit position of the first bit set in x, starting from LSB. If bit 0 is set, returns 0. If only bit 31 is set, returns 31. If x is 0, returns 32.

Equivalent to pure gcc __builtin_ctz((x))

Parameters
xArgument
unsigned int __builtin_pulp_fl1 ( int  x)

Bit position of the last bit set in x starting from MSB. If bit 31 is set, returns 31. If only bit 0 is set returns 0. If x is 0, returns 32.

Equivalent to pure gcc sequence (31 - __builtin_clz((x)))

Parameters
xArgument

Referenced by __FL1(), and gap8_fl1().

unsigned int __builtin_pulp_parity ( int  x)

Returns x's parity.

Equivalent to pure gcc sequence __builtin_parity((x))

Parameters
xArgument
int __builtin_pulp_rotr ( int  x)

One bit right rotation

Available macros:

    gap8_rotr(x, size, off)
    __ROTR(x, size, off)
Parameters
xArgument

Referenced by __ROTR(), and gap8_rotr().