summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-19 04:44:19 +0000
committerMatthias Braun <matze@braunis.de>2016-02-19 04:44:19 +0000
commit848e79c578014f5510fe1e5697431494f4047eca (patch)
tree49962098dec8c38c4740f9307aa9f5188db59bc7 /llvm/test/CodeGen/AArch64
parent1aff022c9b2e57488b97617e03743b0ab4084df5 (diff)
downloadbcm5719-llvm-848e79c578014f5510fe1e5697431494f4047eca.tar.gz
bcm5719-llvm-848e79c578014f5510fe1e5697431494f4047eca.zip
LegalizeDAG: Fix ExpandFCOPYSIGN assuming the same type on both inputs
llvm-svn: 261306
Diffstat (limited to 'llvm/test/CodeGen/AArch64')
-rw-r--r--llvm/test/CodeGen/AArch64/fcopysign.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/fcopysign.ll b/llvm/test/CodeGen/AArch64/fcopysign.ll
new file mode 100644
index 00000000000..6bda33cf76e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/fcopysign.ll
@@ -0,0 +1,23 @@
+; RUN: llc -o - %s | FileCheck %s
+; Check that selection dag legalization of fcopysign works in cases with
+; different modes for the arguments.
+target triple = "aarch64--"
+
+declare fp128 @llvm.copysign.f128(fp128, fp128)
+
+@val = global double zeroinitializer, align 8
+
+; CHECK-LABEL: copysign0
+; CHECK: ldr [[REG:x[0-9]+]], [x8, :lo12:val]
+; CHECK: and [[ANDREG:x[0-9]+]], [[REG]], #0x8000000000000000
+; CHECK: lsr x[[LSRREGNUM:[0-9]+]], [[ANDREG]], #56
+; CHECK: bfxil w[[LSRREGNUM]], w{{[0-9]+}}, #0, #7
+; CHECK: strb w[[LSRREGNUM]],
+; CHECK: ldr q{{[0-9]+}},
+define fp128 @copysign0() {
+entry:
+ %v = load double, double* @val, align 8
+ %conv = fpext double %v to fp128
+ %call = tail call fp128 @llvm.copysign.f128(fp128 0xL00000000000000007FFF000000000000, fp128 %conv) #2
+ ret fp128 %call
+}
OpenPOWER on IntegriCloud