summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll
diff options
context:
space:
mode:
authorSilviu Baranga <silviu.baranga@arm.com>2016-05-09 11:10:44 +0000
committerSilviu Baranga <silviu.baranga@arm.com>2016-05-09 11:10:44 +0000
commitf60be28ed83473983bae52ca95b34b05a6b992ed (patch)
tree076157a42fc863a4cfd5cc35d62160f70aab0d35 /llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll
parentb8d8c62b341ab7a294231e6395dede2190bb93a8 (diff)
downloadbcm5719-llvm-f60be28ed83473983bae52ca95b34b05a6b992ed.tar.gz
bcm5719-llvm-f60be28ed83473983bae52ca95b34b05a6b992ed.zip
[AArch64] Implement lowering of the X constraint on AArch64
Summary: This implements the lowering of the X constraint on AArch64. The default behaviour of the X constraint lowering is to restrict it to "f". This is a problem because the "f" constraint is not implemented on AArch64 and would be too restrictive anyway. Therefore, the AArch64 hook will lower this to "w" (if the operand is a floating point or vector) or "r" otherwise. The implementation is similar with the one added for ARM (r267411). This is the AArch64 side of the fix for http://llvm.org/PR26493 Reviewers: rengolin Subscribers: aemerson, rengolin, llvm-commits, t.p.northover Differential Revision: http://reviews.llvm.org/D19967 llvm-svn: 268907
Diffstat (limited to 'llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll b/llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll
new file mode 100644
index 00000000000..1d7a24e3e6e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/inlineasm-X-allocation.ll
@@ -0,0 +1,17 @@
+; RUN: llc -mtriple=aarch64-none-eabi -mattr=-fp-armv8 %s -o - | FileCheck %s -check-prefix=nofp
+
+; In the novfp case, the compiler is forced to assign a core register,
+; even if the input is a float.
+
+; nofp-LABEL: f1
+; nofp-CHECK: ldr x0, [sp]
+
+; This can be generated by a function such as:
+; void f1(float f) {asm volatile ("ldr $0, [sp]" : : "X" (f));}
+
+define void @f1(float %f) {
+entry:
+ call void asm sideeffect "ldr $0, [sp]", "X" (float %f) nounwind
+
+ ret void
+}
OpenPOWER on IntegriCloud