This for printing .intel_syntax noprefix.
In clang there is two type of print asm by at&t and intel_syntax.
clang support the intel_syntax without the print directive .
Now clang print to asm file directive
Details
Diff Detail
Event Timeline
The directive is "intel_syntax", not "intel_syntax noprefix". noprefix is an optional argument.
The intel and AT&T formats aren't clang specific. Both of them are pretty common x86 conventions. Intel is the one that intel defined, and AT&T is the one that GNU uses. The former is the standard, the latter is needed for compatibility with GCC, and so clang needs both. I think that the commit message is somewhat misleading.
lib/MC/MCAsmStreamer.cpp | ||
---|---|---|
485 | Can you add a FIXME here indicating that we currently emit unprefix'ed registers, and that this should be controllable? The intel_syntax directive has 1 optional argument which may have a value of prefix or noprefix indicating whether registers have the % prefix or not. | |
lib/MC/MCStreamer.cpp | ||
469 | Missing space between ) and {. Perhaps you should clang-format the diff? | |
lib/Target/X86/X86AsmPrinter.cpp | ||
67 | Can't the EmitSyntaxDirective invocation be hoisted? Why emit the intel_syntax directive after each function header? | |
test/MC/X86/intel-syntax-print.ll | ||
1 | How about a negative test case? Something along the lines of: ; RUN: llc -x86-asm-syntax=gnu %s | FileCheck -check-prefix CHECK-GNU %s ; CHECK-GNU-NOT: .intel_syntax | |
2 | A newline before this line would be nice. | |
7 | I think you could further simplify the test case: define i32 @test() { entry: ret i32 0 } You are just interested in the syntax header being present. |
Merge the two tests into a single file. You can have multiple RUN commands in a single file. You can also pass -check-prefix parameters to check to ensure that the checks don't get mixed up. Looks good otherwise.
Can you add a FIXME here indicating that we currently emit unprefix'ed registers, and that this should be controllable? The intel_syntax directive has 1 optional argument which may have a value of prefix or noprefix indicating whether registers have the % prefix or not.