工具/软件:TI C/C++编译器
你(们)好
我正在尝试编译下面列出的内嵌汇编代码。
此代码来自开放源代码,用于优化现有的C代码。
静态内嵌SPX_word32_t MULT16_32_Q14 (SPX_word16_t x,SPX_word32_t y){
内部资源;
int虚拟;
ASM (
"smull %0,%1,%2,%3 \n\t"
"MOV %0,%0,LSR #14 \n\t"
"添加%0,%0,%1,LSL #18 \n\t"
:"=&r"(res),"=&r"(dummy)
:"r"(y),"r"((int) x));
退货;
}
#UNDEF MULT16_32_Q15
静态内嵌SPX_word32_t MULT16_32_Q15 (SPX_word16_t x,SPX_word32_t y){
内部资源;
int虚拟;
ASM (
"smull %0,%1,%2,%3 \n\t"
"MOV %0,%0,LSR #15 \n\t"
"添加%0,%0,%1,LSL #17 \n\t"
:"=&r"(res),"=&r"(dummy)
:"r"(y),"r"((int) x));
退货;
}
#UNDEF DIV32_16.
静态内联短DIV32_16 (int a,int b)
{
int res=0;
Int dead1,dead2,dead3,dead4,dead5;
__ASM_____volate___(.
"\teor %5,%0,%1\n"
"\tmovs %4,%0\n"
"\trsbmi %0,%0,#0 \n"
"\tmovs %4,%1\n"
"\trsbmi %1,%1,#0 \n"
"\tmov %4,#1\n"
"\tsubs %3,%0,%1,ASL #14 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #14 \n"
"\tsubs %3,%0,%1,ASL #13 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #13 \n"
"\tsubs %3,%0,%1,ASL #12 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #12 \n"
"\tsubs %3,%0,%1,ASL #11 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #11 \n"
"\tsubs %3,%0,%1,ASL #10 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #10 \n"
"\tsubs %3,%0,%1,ASL #9 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #9 \n"
"\tsubs %3,%0,%1,ASL #8 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #8 \n"
"\tsubs %3,%0,%1,ASL #7 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #7 \n"
"\tsubs %3,%0,%1,ASL #6 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #6 \n"
"\tsubs %3,%0,%1,ASL #5 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #5 \n"
"\tsubs %3,%0,%1,ASL #4 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #4 \n"
"\tsubs %3,%0,%1,ASL #3 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #3 \n"
"\tsubs %3,%0,%1,ASL #2 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #2 \n"
"\tsubs %3,%0,%1,ASL #1 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4,ASL #1 \n"
"\tsubs %3,%0,%1 \n"
"\tmovpl %0,%3 \n"
"\torrpl %2,%2,%4 \n"
"\tmovs %5,%5,LSR #31 \n"
"\trsbne %2,%2,#0 \n"
:"=r"(dead1),"=r"(dead2),"=r"(res),
"=r"(dead3),"=r"(dead4),"=r"(dead5)
:"0"(a),"1"(b),"2"(分辨率)
:"cc"
);
返回分辨率;
}
我在每个ASM块的第一行收到以 ':'符号( 冒号)开头的错误。
错误为“#18 Expected a”), 必须强调括号的数量是平衡的。
编译器似乎对代码本身很好,但对代码下面的方向却不好。
有人能提供建议。
此致
Nitzan Tzifroni