Skip to content

unsupported ARM asm argument -mimplicit-it #20713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Jul 17, 2014 · 8 comments
Closed

unsupported ARM asm argument -mimplicit-it #20713

llvmbot opened this issue Jul 17, 2014 · 8 comments
Labels
backend:ARM bugzilla Issues migrated from bugzilla wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Member

llvmbot commented Jul 17, 2014

Bugzilla Link 20339
Resolution WONTFIX
Resolved on Aug 16, 2015 12:32
Version trunk
OS Linux
Blocks #22065
Reporter LLVM Bugzilla Contributor
CC @aemerson,@compnerd,@nico,@rengolin

Extended Description

i build clang in a cross build system.
when i run follow cmd in arm cross build system:
clang main.c -Wa,-mimplicit-it=thumb
an error occur:
clang: error: unsupported argument '-mimplicit-it=thumb' to option 'Wa

the clang version is 3.5.
when i checkout clang src version from 3.5 to 3.4, and rebuild clang, same cmd build success.

@llvmbot
Copy link
Member Author

llvmbot commented Jul 22, 2014

before clang 3.5, clang use default gcc assembler,
and now in clang 3.5, it use integrated assembler.
but it seems clang integated assembler is not support arm special options, such as "implicit-it".

i found the modify in git commit log, the commit id is 64d271941379661f2c55be4ead57d4c5126a978f

but i can't understand why enable this experimental feature default?
any suggestion?

@rengolin
Copy link
Member

The integrated assembler is not experimental any more, but accepting all GAS options was not, and will not be a design goal. You can request a feature to add additional GNU extensions, GAS options, etc. but none of it will ever be a requirement for us calling it "production quality".

The IAS can, AFAWK, consume all assembler generated by Clang and GCC, as well as most of the inline assembly that we've come across on both x86 and ARM, and why it is turned on by default on those architectures.

Now, regarding the implicit IT option, I don't think it'd be a simple addition. I'm adding some folks that have more experience with the assembler and could give a better opinion.

Filling a bug (as you did) is the first step, but you should use -no-integrated-as for the time being. It's also possible that we might not be able to add some features for technical reasons. You can never assume that we'll do exactly as GNU tools will, otherwise we'd all be using GNU tools.

@rengolin
Copy link
Member

FYI:

-mimplicit-it=never
-mimplicit-it=always
-mimplicit-it=arm
-mimplicit-it=thumb

The -mimplicit-it option controls the behavior of the assembler when conditional instructions are not enclosed in IT blocks. There are four possible behaviors. If never is specified, such constructs cause a warning in ARM code and an error in Thumb-2 code. If always is specified, such constructs are accepted in both ARM and Thumb-2 code, where the IT instruction is added implicitly. If arm is specified, such constructs are accepted in ARM code and cause an error in Thumb-2 code. If thumb is specified, such constructs cause a warning in ARM code and are accepted in Thumb-2 code. If you omit this option, the behavior is equivalent to -mimplicit-it=arm.

https://sourceware.org/binutils/docs/as/ARM-Options.html

@compnerd
Copy link
Member

Yeah, I am aware of the fact that implicit IT blocks are not supported by clang. I am on the fence about this.

IT blocks were reduced in scope by updated hardware (c.f. -mrestrict-it). So, there are a handful of instructions that must be predicated by the IT instructions. Adding this inline is problematic as you may end up increasing the size if you emit a single IT instruction per emitted instruction (if necessary) rather than collapsing the series as possible (each IT block can cover at most 4 instructions).

I suspect that Jim and Tim would have opinions on this as well, since this would need to be done at the MI level (since we need to scan the selected instructions).

Also, note that when we generate code, we already generate the proper IT instructions, so this only effects assembly input.

@rengolin
Copy link
Member

*** Bug llvm/llvm-bugzilla-archive#20462 has been marked as a duplicate of this bug. ***

@compnerd
Copy link
Member

I think that using -fno-integrated-as is a reasonable workaround if you have hand written assembly and do not wish to update it for the explicit IT blocks. This extension would be pretty invasive. Given that modern CPUs support restricted IT mode, the number of instructions that need to be placed into explicit IT blocks is relatively small. This only effects assembly input, not generated assembly, as LLVM will already generate assembly with the IT blocks. We could silently ignore the argument, but that might be confusing as we we wouldn't actually insert the IT blocks.

@rengolin
Copy link
Member

mentioned in issue llvm/llvm-bugzilla-archive#20462

@llvmbot
Copy link
Member Author

llvmbot commented Nov 26, 2021

mentioned in issue #22065

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:ARM bugzilla Issues migrated from bugzilla wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

4 participants