[PATCH] D33558: [AArch64]: add 'a' inline asm operand modifier.
Manoj Gupta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 11:54:47 PDT 2017
manojgupta updated this revision to Diff 100278.
manojgupta added a subscriber: srhines.
Repository:
rL LLVM
https://reviews.llvm.org/D33558
Files:
lib/Target/AArch64/AArch64AsmPrinter.cpp
test/CodeGen/AArch64/arm64-inline-asm.ll
Index: test/CodeGen/AArch64/arm64-inline-asm.ll
===================================================================
--- test/CodeGen/AArch64/arm64-inline-asm.ll
+++ test/CodeGen/AArch64/arm64-inline-asm.ll
@@ -254,3 +254,10 @@
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
+}
Index: lib/Target/AArch64/AArch64AsmPrinter.cpp
===================================================================
--- lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -320,6 +320,9 @@
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 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33558.100278.patch
Type: text/x-patch
Size: 1487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170525/6b985448/attachment.bin>
More information about the llvm-commits
mailing list