3

On Xcode 4.4, I have some problems compilling inline assembly on the last LLVM compiler (4.0).

In my inline assembly code, each call to "fldmias" like :

asm volatile(    
"fldmias  %2, {s4-s19}    \n\t"
...
)

give me this error :

Inline assembly issue : Instruction 'fldmia' can not set flags, but 's' suffix specified

The same code works well with LLVM GCC 4.2. Maybe there is some difference between configuration for each compiler but I don't find anything.

Thanks.

Gerwoolf
  • 33
  • 1
  • 3
  • Try `fldmsia` maybe? It's possible the mnemonic doesn't match. My manual here puts the addressing mode in the middle like you have it, but I can see why an implementer would choose to only accept them at the end. – Carl Norum Aug 02 '12 at 18:43
  • Actually I think read something about clang using UAL - did you try the UAL equivalent? The book I have here says that would be `VLDMIA.32`, I think. – Carl Norum Aug 02 '12 at 18:51
  • Invalid instruction with the s on the middle, the s is here for setting the precision (here single precision), and maybe the compiler identify this letter as the conditional suffix... – Gerwoolf Aug 02 '12 at 18:52
  • it's definitely identifying the `s` as the "set flags" suffix, like in `adds` or `subs`, for example. I can see how that would confuse it, since the addressing mode goes in the middle of the instruction. Did the UAL one also not work? I'll try to make a test file here and see what I come up with. – Carl Norum Aug 02 '12 at 18:54
  • Yes it works with the UAL equivalent, so VLDMIA.32 in place of FLDMIAS. Thank you for your help, Carl. – Gerwoolf Aug 02 '12 at 19:00

1 Answers1

7

As discovered in the comments above, the answer here is to use the UAL equivalent instruction, which in this case is:

VLDMIA.32 %2, {s4-s19}
Carl Norum
  • 219,201
  • 40
  • 422
  • 469