If you are using the function interface, compile the AutoCode-generated source file
Note
using the compiler flag
© National Instruments Corporation
number—for each integer item and the sign are managed by the code
generator. Arithmetic expressions are scaled to emulate a fixed-point
capability, and all expressions involving the item are coded to be consistent
with the chosen radix position.
AutoCode supports a fixed-point library that implements all of the
fixed-point operations (algebraic, relational, conversion). There are
two different interfaces to the fixed-point library.
•
The default and most commonly used one is the macro interface where
the fixed-point operations are encoded as macros.
•
The other interface is the function interface where all the fixed-point
operations are implemented as functions. In this interface every
fixed-point operation can result in a function call.
FX_FUNC_INTERFACE
For example, if your platform is Solaris and you are using the fixed-point
function interface, the command line might appear as:
% acc -o gen_ap -DSOLARIS -DFX_FUNC_INTERFACE gen_ap.c
sa_*.o -lm
where
represents any AutoCode generated source file.
gen_ap.c
Because fixed-point operations get inlined while using the macro interface,
an application linked with the macro interface will execute at a faster rate
than the same application linked with the function interface.
All the files needed for the macro interface library are present in the
directory
$CASE/ACC/macro_interface
the function interface are present in the directory
function_interface
(
) is a link to the
src
macro_interface
in the directory
, the user gets to work with the macro interface. In order
src
to work with the function interface, the user must make the
link to the function interface. Files common to both directories are present
in both directories.
The supplied macros and functions are written in C. C neither allows
efficient coding of multiplication/division of 32-bit variables, nor does it
take advantage of processor-specific capabilities, such as trapping of
overflows, which can be detected in assembly code by checking the
processor's status flag. However, you can write functions in assembly
.
. By default, the system-specific source directory
directory. By linking and working
2-27
Chapter 2
C Language Reference
while the files needed for
$CASE/ACC/
directory a
src
AutoCode Reference
Need help?
Do you have a question about the AutoCode NI MATRIX and is the answer not in the manual?
Questions and answers