28.2.8 __builtin_ashiftrt_32_16

Architecture

dsPIC33C/E/F, dsPIC30

Description

32-bit shift by n for use when the you know that n will never be larger than 16 bits; the compiler may not be able to determine that. This builtin will produce incorrect answers for shifts larger than 16.

Prototype:

int32_t __builtin_ashiftrt_32_16(int32_t X, uint16_t N);

Arguments

X - 32-bit signed number to be shifted

N - Shift amount of no more then 16 bits

Return Value

The value of X shifted by N.

Example Instruction Sequence

subr w4,#16,w5
sl w3,w5,w5
asr w3,w5,w1
lsr w2,w4,w0
ior w0,w5,w0

Error Messages

None.