Pragma Const; Pragma Regs_Clobbered String - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

C/C++ Compiler Language Extensions
int i;
long s = 0;
for (i = 1; i < 10; ++i)
s += sdot(a, b, n);
return s;}
the compiler can replace the ten calls to
before the loop.

#pragma const

The
#pragma const
the compiler that the function does not read from global variables as well
as not writing to them or reading or writing volatile variables. The result
of the function is therefore a function of its parameters. If any of the
parameters are pointers, the function may not even read the data they
point at.

#pragma regs_clobbered string

The
#pragma regs_clobbered string
ration or definition to specify which registers are modified (or clobbered)
by that function. The
case-insensitive.
When used with an external function declaration, this pragma acts as an
assertion telling the compiler something it would not be able to discover
for itself. In the example,
#pragma regs_clobbered ar m7
void f(void);
the compiler will know that only registers
the call to
, so it may keep local variables in other registers across that
f
call.
1-130
// call can get hoisted out of loop
is a more restrictive form of the
contains a list of registers and is
string
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
with a single call made
sdot
pure
may be used with a function decla-
and
may be modified by
ar
m7
for ADSP-219x DSPs
pragma. It tells

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents