
Built-in Intrinsic Functions (prototype.h)
SC100 C Compiler
7-21
Word64 D_set(long L_var1,
unsigned long L_var2)
Double precision concatenation. Concatenates two 32-bit
values,
L_var1
and unsigned
L_var2
, into one 64-bit
value.
Word64 D_sub(Word64 D_var1,
Word64 D_var2)
Double precision subtract. 64-bit subtraction of the two
64-bit variables
(D_var1-D_var2)
with overflow control
and saturation.
void debug()
Generates assembly instruction to enter
Debug
mode.
void debugev()
Generates assembly instruction to issue
Debug
event.
void di()
Generates assembly instruction to disable interrupts.
short div_s(short var1,short var2)
Short divide. Produces a result which is the fractional
integer division of
var1
by
var2
;
var1
and
var2
must be
positive, and
var2
must be greater or equal to
var1
.
The
result is positive (leading bit equal to 0) and truncated to 16
bits. If
var1 = var2
then
div(var1,var2) = 32767
.
void ei()
Generates assembly instruction to enable interrupts.
EndBitReverse
Frees bit reverse iterator.
short extract_h(long L_var1)
Long extract high. Returns the 16 MSB of
L_var1
.
short extract_l(long L_var1)
Long extract low. Returns the 16 LSB of
L_var1
.
void illegal()
Generates assembly instruction to execute
illegal
exception.
InitBitReverse
Allocates a bit reverse iterator.
long L_abs(long L_var1)
Long absolute value of
L_var1
. Saturates in cases where
the value is
-214783648
.
long L_add(long L_var1,long L_var2)
Long add. 32-bit addition of the two 32-bit variables
(L_var1+L_var2)
with overflow control and saturation.
The result is set at
+2147483647
when overflow occurs, or
at
-2147483648
when underflow occurs.
long L_deposit_h(short var1)
Deposit short in MSB. Deposits the 16-bit
var1
into the 16
MS bits of the 32-bit output. The 16 LS bits of the output
are zeroed.
long L_deposit_l(short var1)
Deposit short in LSB. Deposits the 16-bit
var1
into the 16
LS bits of the 32-bit output. The 16 MS bits of the output
are sign extended.
long L_mac(long L_var3,short var1,
short var2)
Multiply accumulate. Multiplies
var1
by
var2
and shifts
the result left by 1. Adds the 32-bit result to
L_var3
with
saturation, and returns a 32-bit result. For example:
L_mac(L_var3,var1,var2) =
L_add(L_var3,L_mult(var1,var2))
.
long L_max(long L_var1,long L_var2)
Compares the values of two 32-bit variables and returns
the higher value of the two.
long L_min(long L_var1,long L_var2)
Compares the values of two 32-bit variables and returns
the lower value of the two.
Table 7-35. Built-in Intrinsic Functions (Continued)
Function
Purpose