-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Comments
before clang 3.5, clang use default gcc assembler, i found the modify in git commit log, the commit id is 64d271941379661f2c55be4ead57d4c5126a978f but i can't understand why enable this experimental feature default? |
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. |
FYI: -mimplicit-it=never 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. |
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. |
*** Bug llvm/llvm-bugzilla-archive#20462 has been marked as a duplicate of this bug. *** |
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. |
mentioned in issue llvm/llvm-bugzilla-archive#20462 |
mentioned in issue #22065 |
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.
The text was updated successfully, but these errors were encountered: