[llvm] r303901 - [AArch64]: add 'a' inline asm operand modifier.
Manoj Gupta via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 12:07:57 PDT 2017
Author: manojgupta
Date: Thu May 25 14:07:57 2017
New Revision: 303901
URL: http://llvm.org/viewvc/llvm-project?rev=303901&view=rev
Log:
[AArch64]: add 'a' inline asm operand modifier.
Summary:
This is used in the Linux kernel, and effectively just means "print an
address". This brings back r193593.
Reviewed by: Renato Golin
Reviewers: t.p.northover, rengolin, richard.barton.arm, kristof.beyls
Subscribers: aemerson, javed.absar, llvm-commits, eraman
Differential Revision: https://reviews.llvm.org/D33558
Modified:
llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/trunk/test/CodeGen/AArch64/arm64-inline-asm.ll
Modified: llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp?rev=303901&r1=303900&r2=303901&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64AsmPrinter.cpp Thu May 25 14:07:57 2017
@@ -320,6 +320,9 @@ bool AArch64AsmPrinter::PrintAsmOperand(
switch (ExtraCode[0]) {
default:
return true; // Unknown modifier.
+ case 'a': // Print 'a' modifier
+ PrintAsmMemoryOperand(MI, OpNum, AsmVariant, ExtraCode, O);
+ return false;
case 'w': // Print W register
case 'x': // Print X register
if (MO.isReg())
@@ -388,7 +391,7 @@ bool AArch64AsmPrinter::PrintAsmMemoryOp
unsigned AsmVariant,
const char *ExtraCode,
raw_ostream &O) {
- if (ExtraCode && ExtraCode[0])
+ if (ExtraCode && ExtraCode[0] && ExtraCode[0] != 'a')
return true; // Unknown modifier.
const MachineOperand &MO = MI->getOperand(OpNum);
Modified: llvm/trunk/test/CodeGen/AArch64/arm64-inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-inline-asm.ll?rev=303901&r1=303900&r2=303901&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/arm64-inline-asm.ll Thu May 25 14:07:57 2017
@@ -254,3 +254,10 @@ define void @test_constraint_w(i32 %a) {
tail call void asm sideeffect "sqxtn h0, ${0:s}\0A", "w"(i32 %a)
ret void
}
+
+define void @test_inline_modifier_a(i8* %ptr) nounwind {
+ ; CHECK-LABEL: test_inline_modifier_a:
+ tail call void asm sideeffect "prfm pldl1keep, ${0:a}\0A", "r"(i8* %ptr)
+ ; CHECK: prfm pldl1keep, [x0]
+ ret void
+}
More information about the llvm-commits
mailing list