Hi,
There is a function in my program,which contains some loop codes.The feedback in
the asm file reads "Disqualified loop:loop contains control code".The
code is shown in the following(C64X):
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00,r01,r10,r11;
...
if (8 == pDIBOriginal->m_bitCount)
{
double c00,c01,c10,c11;
...
d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff;
}
else
{
double R00,R01,R10,R11;
double G00,G01,G10,G11;
double B00,B01,B10,B11;
unsigned int r,g,b;
...
d = ((b<<16)+(g<<8)+r) & 0xff;
}
...
}
}
I'm sure the problem lies in the "d = ((unsigned
int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff" and "d =
((b<<16)+(g<<8)+r) & 0xff".Because when I remarked these
two sentences,
software pipeline can be generated.
What can I do in order to generate software pipeline?
Thanks in advance.
Regards,
wangfeng
Disqualified loop:loop contains control code
Started by ●August 2, 2005
Reply by ●August 3, 20052005-08-03
Hi,
the reason is the if-then-else in your loop. Unless there are no realy
simple statements in the then or else part CCS is not able to optimise
them. Try to avoid if-then-else in a loop.
HTH
Gustl
wang feng wrote:
> Hi, There is a function in my program,which contains some loop
> codes.The feedback in the asm file reads "Disqualified loop:loop
> contains control code".The code is shown in the following(C64X):
>
> int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
> double R00,R01,R10,R11; double G00,G01,G10,G11; double
> B00,B01,B10,B11; unsigned int r,g,b;
>
> ... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
> lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> 0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
> these two sentences, software pipeline can be generated. What can I
> do in order to generate software pipeline? Thanks in advance.
>
> Regards, wangfeng >
>
> NEW! You can now post a message or access and search the archives of
> this group on DSPRelated.com:
> http://www.dsprelated.com/groups/c6x/1.php
>
> _____________________________________ Note: If you do a simple
> "reply" with your email client, only the author of this message will
> receive your answer. You need to do a "reply all" if you want your
> answer to be distributed to the entire group.
>
> _____________________________________ About this discussion group:
>
> Archives: http://www.dsprelated.com/groups/c6x/1.php
>
> To Post: Send an email to c6x@c6x@...
>
> Other DSP Related Groups: http://www.dsprelated.com/groups.php Yahoo!
> Groups Links
the reason is the if-then-else in your loop. Unless there are no realy
simple statements in the then or else part CCS is not able to optimise
them. Try to avoid if-then-else in a loop.
HTH
Gustl
wang feng wrote:
> Hi, There is a function in my program,which contains some loop
> codes.The feedback in the asm file reads "Disqualified loop:loop
> contains control code".The code is shown in the following(C64X):
>
> int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
> double R00,R01,R10,R11; double G00,G01,G10,G11; double
> B00,B01,B10,B11; unsigned int r,g,b;
>
> ... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
> lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> 0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
> these two sentences, software pipeline can be generated. What can I
> do in order to generate software pipeline? Thanks in advance.
>
> Regards, wangfeng >
>
> NEW! You can now post a message or access and search the archives of
> this group on DSPRelated.com:
> http://www.dsprelated.com/groups/c6x/1.php
>
> _____________________________________ Note: If you do a simple
> "reply" with your email client, only the author of this message will
> receive your answer. You need to do a "reply all" if you want your
> answer to be distributed to the entire group.
>
> _____________________________________ About this discussion group:
>
> Archives: http://www.dsprelated.com/groups/c6x/1.php
>
> To Post: Send an email to c6x@c6x@...
>
> Other DSP Related Groups: http://www.dsprelated.com/groups.php Yahoo!
> Groups Links
Reply by ●August 3, 20052005-08-03
Hi,
I would say that the problem is the code uses floating point
operations which must be implemented on the c64x as function calls to
C library functions. The condition seems to be simple enough and the
problem goes away when all the arithmetic with the floating point
values is removed and the condition left in.
The only solutions would be to use a floating point dsp (C67x) or
change all the code to fixed point representation to avoid the
function calls.
Gregory Lee
On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> Hi,
>
> the reason is the if-then-else in your loop. Unless there are no realy
> simple statements in the then or else part CCS is not able to optimise
> them. Try to avoid if-then-else in a loop.
>
> HTH
>
> Gustl
>
> wang feng wrote:
> > Hi, There is a function in my program,which contains some loop
> > codes.The feedback in the asm file reads "Disqualified loop:loop
> > contains control code".The code is shown in the following(C64X):
> >
> > int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> > for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> > pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> > ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
> > double R00,R01,R10,R11; double G00,G01,G10,G11; double
> > B00,B01,B10,B11; unsigned int r,g,b;
> >
> > ... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
> > lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> > 0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
> > these two sentences, software pipeline can be generated. What can I
> > do in order to generate software pipeline? Thanks in advance.
> >
> > Regards, wangfeng
> >
> >
> >
> >
> >
> >
> >
> >
>
--
Gregory Lee
I would say that the problem is the code uses floating point
operations which must be implemented on the c64x as function calls to
C library functions. The condition seems to be simple enough and the
problem goes away when all the arithmetic with the floating point
values is removed and the condition left in.
The only solutions would be to use a floating point dsp (C67x) or
change all the code to fixed point representation to avoid the
function calls.
Gregory Lee
On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> Hi,
>
> the reason is the if-then-else in your loop. Unless there are no realy
> simple statements in the then or else part CCS is not able to optimise
> them. Try to avoid if-then-else in a loop.
>
> HTH
>
> Gustl
>
> wang feng wrote:
> > Hi, There is a function in my program,which contains some loop
> > codes.The feedback in the asm file reads "Disqualified loop:loop
> > contains control code".The code is shown in the following(C64X):
> >
> > int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> > for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> > pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> > ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
> > double R00,R01,R10,R11; double G00,G01,G10,G11; double
> > B00,B01,B10,B11; unsigned int r,g,b;
> >
> > ... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
> > lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> > 0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
> > these two sentences, software pipeline can be generated. What can I
> > do in order to generate software pipeline? Thanks in advance.
> >
> > Regards, wangfeng
> >
> >
> >
> >
> >
> >
> >
> >
>
--
Gregory Lee
Reply by ●August 4, 20052005-08-04
Hi Gregory,
you may be right, but in this case the massege should read somthing like
this: "Disqualified loop:loop contains call"
Gustl
Gregory Lee wrote:
> Hi,
>
> I would say that the problem is the code uses floating point
> operations which must be implemented on the c64x as function calls to
> C library functions. The condition seems to be simple enough and the
> problem goes away when all the arithmetic with the floating point
> values is removed and the condition left in.
>
> The only solutions would be to use a floating point dsp (C67x) or
> change all the code to fixed point representation to avoid the
> function calls.
>
> Gregory Lee
>
> On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
>
>>Hi,
>>
>>the reason is the if-then-else in your loop. Unless there are no realy
>>simple statements in the then or else part CCS is not able to optimise
>>them. Try to avoid if-then-else in a loop.
>>
>>HTH
>>
>>Gustl
>>
>>wang feng wrote:
>>
>>>Hi, There is a function in my program,which contains some loop
>>>codes.The feedback in the asm file reads "Disqualified loop:loop
>>>contains control code".The code is shown in the following(C64X):
>>>
>>>int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
>>>for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
>>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
>>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
>>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
>>>B00,B01,B10,B11; unsigned int r,g,b;
>>>
>>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
>>>lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
>>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
>>>these two sentences, software pipeline can be generated. What can I
>>>do in order to generate software pipeline? Thanks in advance.
>>>
>>>Regards, wangfeng
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
> >
you may be right, but in this case the massege should read somthing like
this: "Disqualified loop:loop contains call"
Gustl
Gregory Lee wrote:
> Hi,
>
> I would say that the problem is the code uses floating point
> operations which must be implemented on the c64x as function calls to
> C library functions. The condition seems to be simple enough and the
> problem goes away when all the arithmetic with the floating point
> values is removed and the condition left in.
>
> The only solutions would be to use a floating point dsp (C67x) or
> change all the code to fixed point representation to avoid the
> function calls.
>
> Gregory Lee
>
> On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
>
>>Hi,
>>
>>the reason is the if-then-else in your loop. Unless there are no realy
>>simple statements in the then or else part CCS is not able to optimise
>>them. Try to avoid if-then-else in a loop.
>>
>>HTH
>>
>>Gustl
>>
>>wang feng wrote:
>>
>>>Hi, There is a function in my program,which contains some loop
>>>codes.The feedback in the asm file reads "Disqualified loop:loop
>>>contains control code".The code is shown in the following(C64X):
>>>
>>>int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
>>>for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
>>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
>>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; } else {
>>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
>>>B00,B01,B10,B11; unsigned int r,g,b;
>>>
>>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the problem
>>>lies in the "d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
>>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I remarked
>>>these two sentences, software pipeline can be generated. What can I
>>>do in order to generate software pipeline? Thanks in advance.
>>>
>>>Regards, wangfeng
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
> >
Reply by ●August 4, 20052005-08-04
hi,
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> >>>for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> >>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer <gustl@gust...> wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1<w;x1++) {
> >>>for(y1=0;y1<h;y1++) { double r00,r01,r10,r11; ... if (8 ==
> >>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
Reply by ●August 4, 20052005-08-04
Hi,
Thanks for your help.
I don't think your analysis is the right answer.According to the document of TI,there are 64 registers in C64X.I don't think I had used too many registers inside the loop.
Actually,if I revised the code as the following,the problem still exists:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00,r01,r10,r11;
...
{
double c00,c01,c10,c11;
...
d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff;
}
...
}
}
I don't know what's wrong with the setense
"d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff".
If I replace it with "d=((unsigned int)127.5*1.2) & 0xff",the software pipeline can be generated.
Your help is greatly appreciated.
regards
wangfeng venu <bvg_1@bvg_...> д
hi,
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1> >>>for(y1=0;y1> >>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
---------------------------------
Thanks for your help.
I don't think your analysis is the right answer.According to the document of TI,there are 64 registers in C64X.I don't think I had used too many registers inside the loop.
Actually,if I revised the code as the following,the problem still exists:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00,r01,r10,r11;
...
{
double c00,c01,c10,c11;
...
d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff;
}
...
}
}
I don't know what's wrong with the setense
"d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff".
If I replace it with "d=((unsigned int)127.5*1.2) & 0xff",the software pipeline can be generated.
Your help is greatly appreciated.
regards
wangfeng venu <bvg_1@bvg_...> д
hi,
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1> >>>for(y1=0;y1> >>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
---------------------------------
Reply by ●August 5, 20052005-08-05
Hi wangfeng,
According to a TIs document, Software pipelining is a
technique used to schedule instructions from a loop so that multiple
iterations of the loop execute in parallel.
But in your case, there are 4 multiplications, a comparison, and
possibly a branch operation in every iterations. As there are only 2
multipliers in the DSP, multiple iterations of the loop cannot execute
in parallel C hence the loop will not qualify for pipelining.
Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
because, there is only one multiplication involved in each iteration.
The message "Disqualified loop: loop contains control code" is because,
the code may have failed to qualify for pipelining for more than one
reasons. And the first of the reasons might be the control code.
Suggestion to make the code qualify for the pipelining is to split the
loop such that the code inside every split loop is small.
Experts, correct me if I am wrong.
Hope this helps,
Ramanan
-----Original Message-----
From: c6x@c6x@... [mailto:c6x@c6x@...] On Behalf Of wang
feng
Sent: Friday, August 05, 2005 7:27 AM
To: bvg_1@bvg_...; Bernhard 'Gustl' Bauer; c6x@c6x@...
Subject: Re: [c6x] Disqualified loop:loop contains control code
Hi,
Thanks for your help.
I don't think your analysis is the right answer.According to the
document of TI,there are 64 registers in C64X.I don't think I had used
too many registers inside the loop.
Actually,if I revised the code as the following,the problem still
exists:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00,r01,r10,r11;
...
{
double c00,c01,c10,c11;
...
d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff;
}
...
}
}
I don't know what's wrong with the setense
"d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff".
If I replace it with "d=((unsigned int)127.5*1.2) & 0xff",the software
pipeline can be generated.
Your help is greatly appreciated.
regards
wangfeng venu <bvg_1@bvg_...> д
hi,
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1> >>>for(y1=0;y1>
>>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
---------------------------------
According to a TIs document, Software pipelining is a
technique used to schedule instructions from a loop so that multiple
iterations of the loop execute in parallel.
But in your case, there are 4 multiplications, a comparison, and
possibly a branch operation in every iterations. As there are only 2
multipliers in the DSP, multiple iterations of the loop cannot execute
in parallel C hence the loop will not qualify for pipelining.
Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
because, there is only one multiplication involved in each iteration.
The message "Disqualified loop: loop contains control code" is because,
the code may have failed to qualify for pipelining for more than one
reasons. And the first of the reasons might be the control code.
Suggestion to make the code qualify for the pipelining is to split the
loop such that the code inside every split loop is small.
Experts, correct me if I am wrong.
Hope this helps,
Ramanan
-----Original Message-----
From: c6x@c6x@... [mailto:c6x@c6x@...] On Behalf Of wang
feng
Sent: Friday, August 05, 2005 7:27 AM
To: bvg_1@bvg_...; Bernhard 'Gustl' Bauer; c6x@c6x@...
Subject: Re: [c6x] Disqualified loop:loop contains control code
Hi,
Thanks for your help.
I don't think your analysis is the right answer.According to the
document of TI,there are 64 registers in C64X.I don't think I had used
too many registers inside the loop.
Actually,if I revised the code as the following,the problem still
exists:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00,r01,r10,r11;
...
{
double c00,c01,c10,c11;
...
d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff;
}
...
}
}
I don't know what's wrong with the setense
"d = ((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff".
If I replace it with "d=((unsigned int)127.5*1.2) & 0xff",the software
pipeline can be generated.
Your help is greatly appreciated.
regards
wangfeng venu <bvg_1@bvg_...> д
hi,
in my opinion, u used too many registers inside the loop which
compiler cannot allocate or may not be able to produce tight
loop code. thus the message so.
plz. go through
"4.2 Loop Disqualification Messages" section of SPRU198g.pdf. in
particular, go through "4.2.3 Too Many Instructions".
Hope u can resolve the issue after going thro' section 4.2.
cheers,
venu
--- Bernhard 'Gustl' Bauer wrote:
> Hi Gregory,
>
> you may be right, but in this case the massege should read
> somthing like
> this: "Disqualified loop:loop contains call"
>
> Gustl
>
> Gregory Lee wrote:
>
> > Hi,
> >
> > I would say that the problem is the code uses floating point
> > operations which must be implemented on the c64x as function
> calls to
> > C library functions. The condition seems to be simple
> enough and the
> > problem goes away when all the arithmetic with the floating
> point
> > values is removed and the condition left in.
> >
> > The only solutions would be to use a floating point dsp
> (C67x) or
> > change all the code to fixed point representation to avoid
> the
> > function calls.
> >
> > Gregory Lee
> >
> > On 8/2/05, Bernhard 'Gustl' Bauer wrote:
> >
> >>Hi,
> >>
> >>the reason is the if-then-else in your loop. Unless there
> are no realy
> >>simple statements in the then or else part CCS is not able
> to optimise
> >>them. Try to avoid if-then-else in a loop.
> >>
> >>HTH
> >>
> >>Gustl
> >>
> >>wang feng wrote:
> >>
> >>>Hi, There is a function in my program,which contains some
> loop
> >>>codes.The feedback in the asm file reads "Disqualified
> loop:loop
> >>>contains control code".The code is shown in the
> following(C64X):
> >>>
> >>>int x1,y1; unsigned int d; ... for(x1=0;x1> >>>for(y1=0;y1>
>>>pDIBOriginal->m_bitCount) { double c00,c01,c10,c11; ... d =
> >>>((unsigned int)(c00*r00+c01*r01+c10*r10+c11*r11)) & 0xff; }
> else {
> >>>double R00,R01,R10,R11; double G00,G01,G10,G11; double
> >>>B00,B01,B10,B11; unsigned int r,g,b;
> >>>
> >>>... d = ((b<<16)+(g<<8)+r) & 0xff; } ... } } I'm sure the
> problem
> >>>lies in the "d = ((unsigned
> int)(c00*r00+c01*r01+c10*r10+c11*r11)) &
> >>>0xff" and "d = ((b<<16)+(g<<8)+r) & 0xff".Because when I
> remarked
> >>>these two sentences, software pipeline can be generated.
> What can I
> >>>do in order to generate software pipeline? Thanks in
> advance.
> >>>
> >>>Regards, wangfeng
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
__________________________________________________
---------------------------------
Reply by ●August 7, 20052005-08-07
Ramanan--
On 8/5/05, Ramanan <r...@solitontech.com> wrote:
Hi wangfeng,
According to a TI's document, "Software pipelining is a
technique used to schedule instructions from a loop so that multiple
iterations of the loop execute in parallel".
But in your case, there are 4 multiplications, a comparison, and
possibly a branch operation in every iterations. As there are only 2
multipliers in the DSP, multiple iterations of the loop cannot execute
in parallel C hence the loop will not qualify for pipelining.
Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
because, there is only one multiplication involved in each iteration.
The message "Disqualified loop: loop contains control code" is because,
the code may have failed to qualify for pipelining for more than one
reasons. And the first of the reasons might be the control code.
Suggestion to make the code qualify for the pipelining is to split the
loop such that the code inside every split loop is small.
Experts, correct me if I am wrong.
Hope this helps,
Ramanan
What do you mean? You apparently are the expert here and you are
right! I was struggling to get a hold on that expression and was getting
distracted by other issues, while you have hit the nail on the multiplier.
My suggestion -- before splitting the loop-- is to explore the possiblity
of using the 16 bit quad multiply capability(mpy_low, mpy_high instrinsics) and
see if it can generate the software pipeline code accordingly.This
is theoretically possible since you only need 4 multiplies, whether the data
bandwidth and cross-path constraints oblige is something I dont want analyze on
an idle sunday! Good luck to you though, it is an interesting problem.
--Bhooshan
Reply by ●August 8, 20052005-08-08
Hi,
Thanks for your help.After some test,I think the reason lies in the float caculation.Because when I revised the code as the following:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00;
...
{
double c00;
...
d = ((unsigned int)(c00*r00)) & 0xff;
}
...
}
}
the information of asm file reads "Disqualified loop:loop contains a call.
I met this problem before.When I tried to caculate "x / 3" on C64X,the same situcation occurs.
I don't know how to solve such problem.
Hope to get more help.
Thanks a lot.
Thanks for your help.After some test,I think the reason lies in the float caculation.Because when I revised the code as the following:
int x1,y1;
unsigned int d;
...
for(x1=0;x1<w;x1++)
{
for(y1=0;y1<h;y1++)
{
double r00;
...
{
double c00;
...
d = ((unsigned int)(c00*r00)) & 0xff;
}
...
}
}
the information of asm file reads "Disqualified loop:loop contains a call.
I met this problem before.When I tried to caculate "x / 3" on C64X,the same situcation occurs.
I don't know how to solve such problem.
Hope to get more help.
Thanks a lot.
Regards,
wangfeng
Bhooshan Iyer <b...@gmail.com> д
wangfeng
Bhooshan Iyer <b...@gmail.com> д
Ramanan--
On 8/5/05, Ramanan <r...@solitontech.com> wrote:Hi wangfeng,
According to a TI's document, "Software pipelining is a
technique used to schedule instructions from a loop so that multiple
iterations of the loop execute in parallel".
But in your case, there are 4 multiplications, a comparison, and
possibly a branch operation in every iterations. As there are only 2
multipliers in the DSP, multiple iterations of the loop cannot execute
in parallel C hence the loop will not qualify for pipelining.
Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
because, there is only one multiplication involved in each iteration.
The message "Disqualified loop: loop contains control code" is because,
the code may have failed to qualify for pipelining for more than one
reasons. And the first of the reasons might be the control code.
Suggestion to make the code qualify for the pipelining is to split the
loop such that the code inside every split loop is small.
Experts, correct me if I am wrong.
Hope this helps,
RamananWhat do you mean? You apparently are the expert here and you are right! I was struggling to get a hold on that expression and was getting distracted by other issues, while you have hit the nail on the multiplier.My suggestion -- before splitting the loop-- is to explore the possiblity of using the 16 bit quad multiply capability(mpy_low, mpy_high instrinsics) and see if it can generate the software pipeline code accordingly.This is theoretically possible since you only need 4 multiplies, whether the data bandwidth and cross-path constraints oblige is something I dont want analyze on an idle sunday! Good luck to you though, it is an interesting problem.--Bhooshan
YAHOO! GROUPS LINKS
Reply by ●August 8, 20052005-08-08
Wang Feng
> Thanks for your help.After some test,I think the reason lies in the
> float caculation.Because when I revised the code as the following:
If you change r00 and c00 to "int", you should eliminate the
disqualification message. Another way would be to change your target to
C6713 and change r00 and c00 to "float".
C64xx devices are fixed-point. Any floating-point operation will result
in a library/function call. C4xx cannot perform floating-point multiply
at chip (silicon) level. C67xx devices have floating-point capability.
-Jeff > int x1,y1;
> unsigned int d;
> ...
> for(x1=0;x1<w;x1++)
> {
> for(y1=0;y1<h;y1++)
> {
> double r00;
> ...
> {
> double c00;
> ...
> d = ((unsigned int)(c00*r00)) & 0xff;
> }
> ...
> }
> }
> the information of asm file reads "Disqualified loop:loop contains a call.
> I met this problem before.When I tried to caculate "x / 3" on C64X,the
> same situcation occurs.
>
> Bhooshan Iyer <bhooshaniyer@bhoo...> д
>
> Ramanan-- > On 8/5/05, Ramanan <ramanan@rama...> wrote: Hi wangfeng,
>
> According to a TI's document, "Software pipelining is a
> technique used to schedule instructions from a loop so that multiple
> iterations of the loop execute in parallel".
>
> But in your case, there are 4 multiplications, a comparison, and
> possibly a branch operation in every iterations. As there are only 2
> multipliers in the DSP, multiple iterations of the loop cannot execute
> in parallel C hence the loop will not qualify for pipelining.
>
> Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
> because, there is only one multiplication involved in each iteration.
>
> The message "Disqualified loop: loop contains control code" is because,
> the code may have failed to qualify for pipelining for more than one
> reasons. And the first of the reasons might be the control code.
>
> Suggestion to make the code qualify for the pipelining is to split the
> loop such that the code inside every split loop is small.
>
> Experts, correct me if I am wrong.
>
> Hope this helps,
> Ramanan
> What do you mean? You apparently are the expert here and you are right! I
> was struggling to get a hold on that expression and was getting distracted
> by other issues, while you have hit the nail on the multiplier.
>
> My suggestion -- before splitting the loop-- is to explore the possiblity
> of using the 16 bit quad multiply capability(mpy_low, mpy_high
> instrinsics) and see if it can generate the software pipeline code
> accordingly.This is theoretically possible since you only need 4
> multiplies, whether the data bandwidth and cross-path constraints oblige
> is something I dont want analyze on an idle sunday! Good luck to you
> though, it is an interesting problem.
>
> --Bhooshan >
>
> --------------------------------- >
>
> ---------------------------------
>
> Thanks for your help.After some test,I think the reason lies in the
> float caculation.Because when I revised the code as the following:
If you change r00 and c00 to "int", you should eliminate the
disqualification message. Another way would be to change your target to
C6713 and change r00 and c00 to "float".
C64xx devices are fixed-point. Any floating-point operation will result
in a library/function call. C4xx cannot perform floating-point multiply
at chip (silicon) level. C67xx devices have floating-point capability.
-Jeff > int x1,y1;
> unsigned int d;
> ...
> for(x1=0;x1<w;x1++)
> {
> for(y1=0;y1<h;y1++)
> {
> double r00;
> ...
> {
> double c00;
> ...
> d = ((unsigned int)(c00*r00)) & 0xff;
> }
> ...
> }
> }
> the information of asm file reads "Disqualified loop:loop contains a call.
> I met this problem before.When I tried to caculate "x / 3" on C64X,the
> same situcation occurs.
>
> Bhooshan Iyer <bhooshaniyer@bhoo...> д
>
> Ramanan-- > On 8/5/05, Ramanan <ramanan@rama...> wrote: Hi wangfeng,
>
> According to a TI's document, "Software pipelining is a
> technique used to schedule instructions from a loop so that multiple
> iterations of the loop execute in parallel".
>
> But in your case, there are 4 multiplications, a comparison, and
> possibly a branch operation in every iterations. As there are only 2
> multipliers in the DSP, multiple iterations of the loop cannot execute
> in parallel C hence the loop will not qualify for pipelining.
>
> Code "d=((unsigned int)127.5*1.2) & 0xff" may qualify for pipelining
> because, there is only one multiplication involved in each iteration.
>
> The message "Disqualified loop: loop contains control code" is because,
> the code may have failed to qualify for pipelining for more than one
> reasons. And the first of the reasons might be the control code.
>
> Suggestion to make the code qualify for the pipelining is to split the
> loop such that the code inside every split loop is small.
>
> Experts, correct me if I am wrong.
>
> Hope this helps,
> Ramanan
> What do you mean? You apparently are the expert here and you are right! I
> was struggling to get a hold on that expression and was getting distracted
> by other issues, while you have hit the nail on the multiplier.
>
> My suggestion -- before splitting the loop-- is to explore the possiblity
> of using the 16 bit quad multiply capability(mpy_low, mpy_high
> instrinsics) and see if it can generate the software pipeline code
> accordingly.This is theoretically possible since you only need 4
> multiplies, whether the data bandwidth and cross-path constraints oblige
> is something I dont want analyze on an idle sunday! Good luck to you
> though, it is an interesting problem.
>
> --Bhooshan >
>
> --------------------------------- >
>
> ---------------------------------
>






