ARM64: add extra NEG pattern.
authorTim Northover <tnorthover@apple.com>
Fri, 18 Apr 2014 14:54:35 +0000 (14:54 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 18 Apr 2014 14:54:35 +0000 (14:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206609 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM64/ARM64InstrInfo.td
test/CodeGen/AArch64/neon-shl-ashr-lshr.ll
test/CodeGen/ARM64/vshift.ll

index 53d1dbe2dfda3f2a13926d95f5ab9e81b803be9f..1d894eff14a66c28775260148dc1cbf2a477aeac 100644 (file)
@@ -2664,6 +2664,8 @@ defm UQXTN  : SIMDTwoScalarMixedBHS<1, 0b10100, "uqxtn", int_arm64_neon_scalar_u
 defm USQADD : SIMDTwoScalarBHSDTied< 1, 0b00011, "usqadd",
                                     int_arm64_neon_usqadd>;
 
+def : Pat<(ARM64neg (v1i64 V64:$Rn)), (NEGv1i64 V64:$Rn)>;
+
 def : Pat<(v1i64 (int_arm64_neon_fcvtas (v1f64 FPR64:$Rn))),
           (FCVTASv1i64 FPR64:$Rn)>;
 def : Pat<(v1i64 (int_arm64_neon_fcvtau (v1f64 FPR64:$Rn))),
index 0b520d7ac8430d764b7d84cc38bfb2594e65df72..628a6760c9ebcdd3bc0d4f909044ad4c606d1acc 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
+; arm64 has all tests not involving v1iN.
 
 define <8 x i8> @shl.v8i8(<8 x i8> %a, <8 x i8> %b) {
 ; CHECK-LABEL: shl.v8i8:
index ae5da38a227d8b64cff054b564d46b8c4183a427..486c6cc390b1f64267a4c141b2f159996ecd38c9 100644 (file)
@@ -1907,3 +1907,11 @@ declare <16 x i8> @llvm.arm64.neon.vsli.v16i8(<16 x i8>, <16 x i8>, i32) nounwin
 declare <8 x i16> @llvm.arm64.neon.vsli.v8i16(<8 x i16>, <8 x i16>, i32) nounwind readnone
 declare <4 x i32> @llvm.arm64.neon.vsli.v4i32(<4 x i32>, <4 x i32>, i32) nounwind readnone
 declare <2 x i64> @llvm.arm64.neon.vsli.v2i64(<2 x i64>, <2 x i64>, i32) nounwind readnone
+
+define <1 x i64> @ashr_v1i64(<1 x i64> %a, <1 x i64> %b) {
+; CHECK-LABEL: ashr_v1i64:
+; CHECK: neg d{{[0-9]+}}, d{{[0-9]+}}
+; CHECK: sshl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+  %c = ashr <1 x i64> %a, %b
+  ret <1 x i64> %c
+}