Details:
I had downloaded and compiled successfully blackfin-toolchain-06r2-5.src.tar.gz on Debian system.
but, when I use asm ( ) inline assemblely in C code file. there is a problem.
When I compile my .c file which including asm(); inline assembley without -O2 optimization option. The gcc report that:
main.c: In function `main':
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
but when with no -O2, everything is ok.
the .c file is just a test code to convert ycbcr to rgb. I attach it here:
/*----------------------main.c--------------------------*/
#include <stdio.h>
int main(int argc, char * argv[]){
unsigned int y,u,v;
unsigned int yy, uv;
unsigned char rgb[3];
unsigned int param[3]={0x00800080,0x3395628f, 0x5b642c08};
y=97; u=90; v=195;
uv=(v<<16)|u;
yy=(y<<16)|y;
asm volatile (
"R3=[%2++]; "
"%0=%0-|-R3; "
"R0=%0+|+%1 ||R3=[%2++];"
"R1.H=R3.H*%0.H, R1.L=R3.L*%0.L;"
"R0=R0+|+R1 || R3=[%2];"
"R4=R0>>16;"
"R2.H=R3.H*%0.H,R2.L=R3.L*%0.L ||b[%3++]=R0;"
"%1.L=%1.L-R2.L(s)||b[%3++]=R0;"
"%1.L=%1.L-R2.H(s)||b[%3--]=R4;"
"b[%3]=%1;"
: // out put
:"d"(uv),"d"(yy),"p"(param),"p"(rgb) // input
:"R0","R1","R2","R3","R4","A0","A1"
);
return 0;
}
/*----------------end of source code-----------------------*/
is it a bug of blackfin' gcc?
|
Details:
I had downloaded and compiled successfully blackfin-toolchain-06r2-5.src.tar.gz on Debian system.
but, when I use asm ( ) inline assemblely in C code file. there is a problem.
When I compile my .c file which including asm(); inline assembley without -O2 optimization option. The gcc report that:
main.c: In function `main':
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
main.c:15: error: invalid `asm': invalid expression as operand
but when with no -O2, everything is ok.
the .c file is just a test code to convert ycbcr to rgb. I attach it here:
/*----------------------main.c--------------------------*/
#include <stdio.h>
int main(int argc, char * argv[]){
unsigned int y,u,v;
unsigned int yy, uv;
unsigned char rgb[3];
unsigned int param[3]={0x00800080,0x3395628f, 0x5b642c08};
y=97; u=90; v=195;
uv=(v<<16)|u;
yy=(y<<16)|y;
asm volatile (
"R3=[%2++]; "
"%0=%0-|-R3; "
"R0=%0+|+%1 ||R3=[%2++];"
"R1.H=R3.H*%0.H, R1.L=R3.L*%0.L;"
"R0=R0+|+R1 || R3=[%2];"
"R4=R0>>16;"
"R2.H=R3.H*%0.H,R2.L=R3.L*%0.L ||b[%3++]=R0;"
"%1.L=%1.L-R2.L(s)||b[%3++]=R0;"
"%1.L=%1.L-R2.H(s)||b[%3--]=R4;"
"b[%3]=%1;"
: // out put
:"d"(uv),"d"(yy),"p"(param),"p"(rgb) // input
:"R0","R1","R2","R3","R4","A0","A1"
);
return 0;
}
/*----------------end of source code-----------------------*/
is it a bug of blackfin' gcc?
|