This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

restric qualifier and compilers tools >= 6.1.11

Hi

I would like to ask if issue described in chapter 5.1.2 in  spra666.pdf is still valid for compiler 6.1.11. I know there is some improvements from Readme.txt. Assuming in additional -mt and -O3 in compiler option.

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

(...)

The compiler will now utilize the restrict keyword when it is applied to:
  - all pointer variables, including globals, function parameters, and
    variables with any scope, including block scope,
  - by-reference function parameters,
  - arrays of pointers or structs, and
  - class or structure pointer members.
-------------------------------------------------------------------------------------------------

Seems enough clear that: Yes. So apologise for obvious question, I would like to be sure and get some feedback from TI's smart guy/girl or users.

I quote this functions below.

===========================================================

LoopWithStructs(myStr * restrict s)
{
int i;
#pragma MUST_ITERATE(2,,2)
for (i=0; i<s->data->sz; i++)
s->data->q[i] = s->data->p[i];
}

and

LoopWithStructs(myStr * restrict s)
{
int i;
int * restrict p = s->data->p;
int * restrict q = s->data->q;
int sz = s->data->sz;
#pragma MUST_ITERATE(2,,2)
for (i=0; i<sz; i++)
q[i] = p[i];
}

 

===========================================================

Kind Regards

/Greg

  • Applying the restrict keyword to the pointers p and q in the structure declaration of the first example does not yield the performance of the second example.  I realize that is not what the readme says.  But such is the case in v6.1.11.  It may work that way in a future version.

    Thanks and regards,

    -George

     

  • Hi

     

    I am not sure if I understand You correctly, chapter 5.1.2 shows improvements between this two examples based on 6.0.x version. quote from page 38: "Even though s is restrict-qualified, s->data, s->data->p and s->data->q are not.".

     

    Best Regards

    /Greg