Analog Devices VISUALDSP++ 3.5 Manual page 114

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
/* (pseudo code) modify (shoe += sock); */
asm ("modify (%0 += %2);":"=w"(shoe):"0"(shoe),"x"(sock));
The constraint
tion as operand
input operand, and it must refer to an output operand.
Only a digit in the constraint can guarantee that one operand is in the
same place as another operand. Just because a variable (for example
in the code that follows) is used for more than one operand does not guar-
antee that the operands are in the same place in the generated assembler
code.
Do NOT try to control placement with operand names; use
/*
the % digit. The following code might NOT work.
asm ("modify (%0 += %2);":"=w"(shoe):"w"(shoe),"x"(sock));
In some cases, operands
to reloading or optimizations.
Be aware that
asm()
read operands and write operands. The example below shows a dangerous
use of such an operand. In this example,
the
operation. The compiler only knows that the output,
asm()
, has changed. Subsequent use of
result_asm
instruction may yield incorrect results since those values may have been
modified during the
int result_asm;
int *my_variable;
/* NOT recommended */
/* (pseudo code) result_asm = dm(*my_variable += 3); */
/* asm() operation changes value of my_variable */
asm("%0=DM(%1 += 3);":"=e"(result_asm):"w"(my_variable));
1-76
for operand 1 says that it must occupy the same loca-
"0"
. A digit in an operand constraint is allowed only in an
0
and
could be stored in different registers due
0
1
does not support input operands that are used as both
instruction and may not have been restored.
asm()
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
*/
is modified during
my_variable
after the
my_variable
for ADSP-219x DSPs
shoe
asm()

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