Inline build error

I am using inline build for iphone, I am working in device debug mode.

The instruction is as follows:

__asm__("smlatb %0, %1, %2 ,%3 \n\t": "=r"(Temp): "r"(treg5) : "r"(fac5) : "r"(Temp) );

      

And I am getting errors:

error: expected ')' before tokedn '(' error: unknown register name 'r' in 'ASM'

I am using X-Code 3.0 and gcc 4.0. Any ideas?

0


source to share


5 answers


There should only be three colons, not four.

Arguments following the first colon indicate inputs, then outputs, followed by a clobber list.

If you have multiple parameters, you can use a comma to separate them, not a colon.



In your example. I am assuming temp is your output and treg5, fac5 are your inputs. You probably want something like this.

__asm__("smlatb %0, %1, %2, %0 \n\t"
        : "=r"(Temp) 
        : "0"(Temp), "r"(treg5), "r"(fac5)
        :);

      

Btw, there are some good examples of iphone ARM build in vfpmath .

+1


source


one asm instruction correction ("smlatb% 0,% 1,% 2,% 3 \ n \ t": "= r" (Temp): "r" (treg5): "r" (fac5): "r" ( Temp));



0


source


I believe you should be doing something like this:

__asm__("smlatb %0, %1, %2 ,%3 \n\t": "=r"(Temp): "r"(treg5) : "r"(fac5) : "r"(Temp));

      

See this Stack Overflow question for details .

0


source


I added an inline code style assembly. __asm ​​{
              smlatb Temp, treg5, fac5, Temp} and in the prject settings on the assembly tab in the selected GCC 4.0 language I selected the Allow CodeWarrior-Style Inline Assembly option is also selected to allow the 'asm' 'inline' 'typeof' options and the code finally worked

0


source


You have too many :

(colon). They are used as separators. So you must have one to separate the assembly code from the output variable and one to separate the output variable from the input variables. It's kind of like asm ("assembly" : <output> : <inputs> : [extra attributes])

. Take a look at the "inline assembly" for GCC and you will see some examples.

0


source







All Articles