AnsweredAssumed Answered

About VDSP + + compiler problem

Question asked by qian on Aug 1, 2011
Latest reply on Aug 2, 2011 by CraigG

hi all:

 


I use VDSP++ version:
VDSP++ 5.0 updata 9
product  5.0.9.0

 

I am porting a code, but code execution results of some error.

Here is a problem in C + + code:

Original:
test_class::test_function()
{
for()
{
    if()
    {
    }
    else if()
    {
    }
    vec += stepvec; //This overloads the "+ ="  . operator+= (ICOORD & op1, const ICOORD & op2)
}
}

 

Modified:
test_class::test_function()
{
for()
{
    if()
    {
    }
    else if()
    {
    }
    vec += stepvec;
  asm("nop;");     //here
  asm("nop;");
}
}

 

----------------------------------------

adsp: bf548
SDRAM: 64MB

System Heap  : L3
System Stack : L3

 

problem:
Added only two asm("nop;"),Execution results are correct.
Why is this?

 

 

 

 

/**********************************************************************
* operator+=
*
* Add 2 ICOORDS.
**********************************************************************/

inline ICOORD &
operator+= (                     //sum vectors
ICOORD & op1,                    //operands
const ICOORD & op2)
{
  op1.xcoord += op2.xcoord;
  op1.ycoord += op2.ycoord;
  return op1;
}

Outcomes