AArch64: add 'a' inline asm operand modifier
authorTim Northover <tnorthover@apple.com>
Tue, 29 Oct 2013 08:22:33 +0000 (08:22 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 29 Oct 2013 08:22:33 +0000 (08:22 +0000)
This is used in the Linux kernel, and effectively just means "print an
address".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193593 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64AsmPrinter.cpp
test/CodeGen/AArch64/inline-asm-modifiers.ll

index 759809fbb724baf45d0d467389a0a1f06d4f0610..911218aeb614a45b9819f5fd3d53b27f6cd136aa 100644 (file)
@@ -230,6 +230,8 @@ bool AArch64AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
     // Output bits 23:12 of symbolic address with appropriate :hi12: relocation
     // modifier (currently only for TLS local exec).
     return printSymbolicAddress(MI->getOperand(OpNum), true, "hi12", O);
+  case 'a':
+    return PrintAsmMemoryOperand(MI, OpNum, AsmVariant, ExtraCode, O);
   }
 
 
index d0b158f1f2ec8a1e5425251997368bd79d81ffd1..124b719d77550cdd5665680cf1e4b08b63d46399 100644 (file)
@@ -107,3 +107,12 @@ define void @test_inline_modifier_c() nounwind {
 
   ret void
 }
+
+define void @test_inline_modifier_a() nounwind {
+; CHECK-LABEL: test_inline_modifier_a:
+  call void asm sideeffect "prfm pldl1keep, ${0:a}", "r"(i32* @var_simple)
+; CHECK: adrp [[VARHI:x[0-9]+]], var_simple
+; CHECK: add x[[VARADDR:[0-9]+]], [[VARHI]], #:lo12:var_simple
+; CHECK: prfm pldl1keep, [x[[VARADDR]]]
+  ret void
+}