LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 20595 - [ARM] Integrated assembler does not support stmeqia instruction
Summary: [ARM] Integrated assembler does not support stmeqia instruction
Status: RESOLVED WONTFIX
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P normal
Assignee: Renato Golin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-08 11:38 PDT by İsmail Dönmez
Modified: 2014-08-12 11:37 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description İsmail Dönmez 2014-08-08 11:38:13 PDT
This instruction is used for libffi's ARM assembly files. Apparently everybody and their dog knows about this problem but instead of reporting a bug they used -no-integrated-as.

Reproducer:

> cat libffi-3.1/sysv.S
stmeqia r2, {r0, r1}

> arm-linux-gnueabihf-gcc -c sysv.S
> echo $?
0

> clang -v
clang version 3.6.0 (trunk 214951)
Target: armv7a-unknown-linux-gnueabihf
[...]

> arm-clang -c sysv.S
sysv.S:1:1: error: invalid instruction
stmeqia r2, {r0, r1}
^
Comment 1 İsmail Dönmez 2014-08-08 11:41:50 PDT
Just to prevent confusion arm-clang is just a wrapper setting --sysroot etc.
Comment 2 Renato Golin 2014-08-08 11:56:23 PDT
Hi Ismail,

This is pre-UAL syntax as an alias to STMEQ with a write back. It should be simple to add them all (STM/LDM), I'll have a look.
Comment 3 Renato Golin 2014-08-11 10:40:54 PDT
Hi Ismail,

It won't be trivial to add the aliases, since we have to parse them in two ways (stmeqia and stmiaeq) and keep the info until later in the process. How often is this used in Chromium?

If at all possible, it would be good to have them changed in the source (one source at a time), as the solution I'll come up with might not be acceptable. :(

cheers,
--renato
Comment 4 İsmail Dönmez 2014-08-12 00:04:29 PDT
> It won't be trivial to add the aliases, since we have to parse them in two
> ways (stmeqia and stmiaeq) and keep the info until later in the process. 

Uh :/

>How often is this used in Chromium?

I have no idea. I got this problem because I was trying to compile libffi for ARM using clang (to enable FFI support in llvm actually).
 
> If at all possible, it would be good to have them changed in the source (one
> source at a time), as the solution I'll come up with might not be
> acceptable. :(

Upstream might accept a patch. Could you tell me what is the replacement assembly for this?
Comment 5 Renato Golin 2014-08-12 03:31:44 PDT
It's really simple, actually. The unified assembly syntax has moved every conditional to the end of the instructions, so instead of:

  stmeqia r0, {r2, r3}

you use:

  stmiaeq r0, {r2, r3}

This is in line with every other instructions, and makes reading assembly a lot easier, for both humans and parsers alike.

If you want to go the extra mile, you can read the instructions' descriptions in the ARM ARM and see that most of those variants are now aliases to a small set of instructions, but you don't have to, as every assembler I know will know that and do that for you.

cheers,
--renato
Comment 6 İsmail Dönmez 2014-08-12 03:37:53 PDT
Already fixed upstream it seems: https://github.com/atgreen/libffi/blob/master/src/arm/sysv.S#L216

Closing as wontfix, thanks a lot!
Comment 7 Renato Golin 2014-08-12 03:40:22 PDT
Thanks!
Comment 8 Nico Weber 2014-08-12 11:37:09 PDT
(we don't use this in chromium, removing unrelated 'blocks' entry)