
D-4
L-Intrinsic Functions
Copyright 1999-2002 by LSI Logic Corporation. All rights reserved.
Long L_mac2b (long var3,
long var1, long var2)
The lower 16 bits of the variable
var1
is
multiplied with the lower 16 bits of the
variable
var2
. The higher 16 bits of the
variable
var1
is multiplied with the
higher 16 bits of variable
var2
, and the
two 32-bit results are added to the
variable
var3
, which is the return value.
Long norm_l (long var1)
This function produces the number of
left shifts required to normalize a 32-bit
variable
var1
. The number is a 32-bit
result.
int norm_s (int var1)
This function produces the number of
left shifts required to normalize a 16-bit
variable
var1
. The number is a 16-bit
result.
Long L_deposit_h (int var1)
This function returns a 32-bit result,
where the high-order 16 bits is the input
16-bit variable
var1
, and the low-order
16 bits are zeroed.
int extract_h (long)
This function returns a 16-bit result
which is the high-order 16 bits of the
32-bit input.
Long L_abs (long var1)
This function returns a 32-bit result
which is the absolute value of the 32-bit
variable
var1
. Note that
abs
(0x8000)
returns 0x7FFF.
int abs_s (int var1)
This function returns a 16-bit result
which is the absolute value of the 16-bit
variable
var1
. Note that
abs.s
(0x8000)
returns 0x7FFF.
int round (long)
This function returns a 16-bit result. The
result is obtained by rounding the lower
16 bits of the 32-bit input number and
storing it in the higher 16 bits with
saturation. This value is then shifted
right by 16 bits to obtain the result.