From 576c3f709fd0ffe5e8b942c308c00762ffee8204 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Mon, 31 Mar 2014 15:46:26 +0000 Subject: [PATCH] ARM64: add more scalar patterns for usqadd & suqadd. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205204 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM64/ARM64InstrFormats.td | 18 +++++++++++------- test/CodeGen/ARM64/vqadd.ll | 36 +++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/lib/Target/ARM64/ARM64InstrFormats.td b/lib/Target/ARM64/ARM64InstrFormats.td index d31b2bb1012..6de83882dc0 100644 --- a/lib/Target/ARM64/ARM64InstrFormats.td +++ b/lib/Target/ARM64/ARM64InstrFormats.td @@ -5135,15 +5135,19 @@ multiclass SIMDTwoScalarBHSD opc, string asm, (!cast(NAME # v1i64) FPR64:$Rn)>; } -let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in multiclass SIMDTwoScalarBHSDTied opc, string asm, Intrinsic OpNode> { - def v1i64 : BaseSIMDTwoScalarTied; - def v1i32 : BaseSIMDTwoScalar; - def v1i16 : BaseSIMDTwoScalar; - def v1i8 : BaseSIMDTwoScalar; + let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in { + def v1i64 : BaseSIMDTwoScalarTied; + def v1i32 : BaseSIMDTwoScalarTied; + def v1i16 : BaseSIMDTwoScalarTied; + def v1i8 : BaseSIMDTwoScalarTied; + } + + def : Pat<(v1i64 (OpNode (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn))), + (!cast(NAME # v1i64) FPR64:$Rd, FPR64:$Rn)>; } diff --git a/test/CodeGen/ARM64/vqadd.ll b/test/CodeGen/ARM64/vqadd.ll index d6092be8ed1..0b7f7e53105 100644 --- a/test/CodeGen/ARM64/vqadd.ll +++ b/test/CodeGen/ARM64/vqadd.ll @@ -209,10 +209,26 @@ define <2 x i64> @usqadd2d(<2 x i64>* %A, <2 x i64>* %B) nounwind { ret <2 x i64> %tmp3 } +define i64 @usqadd_d(i64 %l, i64 %r) nounwind { +; CHECK-LABEL: usqadd_d: +; CHECK: usqadd {{d[0-9]+}}, {{d[0-9]+}} + %sum = call i64 @llvm.arm64.neon.usqadd.i64(i64 %l, i64 %r) + ret i64 %sum +} + +define i32 @usqadd_s(i32 %l, i32 %r) nounwind { +; CHECK-LABEL: usqadd_s: +; CHECK: usqadd {{s[0-9]+}}, {{s[0-9]+}} + %sum = call i32 @llvm.arm64.neon.usqadd.i32(i32 %l, i32 %r) + ret i32 %sum +} + declare <8 x i8> @llvm.arm64.neon.usqadd.v8i8(<8 x i8>, <8 x i8>) nounwind readnone declare <4 x i16> @llvm.arm64.neon.usqadd.v4i16(<4 x i16>, <4 x i16>) nounwind readnone declare <2 x i32> @llvm.arm64.neon.usqadd.v2i32(<2 x i32>, <2 x i32>) nounwind readnone declare <1 x i64> @llvm.arm64.neon.usqadd.v1i64(<1 x i64>, <1 x i64>) nounwind readnone +declare i64 @llvm.arm64.neon.usqadd.i64(i64, i64) nounwind readnone +declare i32 @llvm.arm64.neon.usqadd.i32(i32, i32) nounwind readnone declare <16 x i8> @llvm.arm64.neon.usqadd.v16i8(<16 x i8>, <16 x i8>) nounwind readnone declare <8 x i16> @llvm.arm64.neon.usqadd.v8i16(<8 x i16>, <8 x i16>) nounwind readnone @@ -282,17 +298,33 @@ define <2 x i64> @suqadd2d(<2 x i64>* %A, <2 x i64>* %B) nounwind { ret <2 x i64> %tmp3 } -define <1 x i64> @suqadd_d(<1 x i64> %l, <1 x i64> %r) nounwind { -; CHECK-LABEL: suqadd_d: +define <1 x i64> @suqadd_1d(<1 x i64> %l, <1 x i64> %r) nounwind { +; CHECK-LABEL: suqadd_1d: ; CHECK: suqadd {{d[0-9]+}}, {{d[0-9]+}} %sum = call <1 x i64> @llvm.arm64.neon.suqadd.v1i64(<1 x i64> %l, <1 x i64> %r) ret <1 x i64> %sum } +define i64 @suqadd_d(i64 %l, i64 %r) nounwind { +; CHECK-LABEL: suqadd_d: +; CHECK: suqadd {{d[0-9]+}}, {{d[0-9]+}} + %sum = call i64 @llvm.arm64.neon.suqadd.i64(i64 %l, i64 %r) + ret i64 %sum +} + +define i32 @suqadd_s(i32 %l, i32 %r) nounwind { +; CHECK-LABEL: suqadd_s: +; CHECK: suqadd {{s[0-9]+}}, {{s[0-9]+}} + %sum = call i32 @llvm.arm64.neon.suqadd.i32(i32 %l, i32 %r) + ret i32 %sum +} + declare <8 x i8> @llvm.arm64.neon.suqadd.v8i8(<8 x i8>, <8 x i8>) nounwind readnone declare <4 x i16> @llvm.arm64.neon.suqadd.v4i16(<4 x i16>, <4 x i16>) nounwind readnone declare <2 x i32> @llvm.arm64.neon.suqadd.v2i32(<2 x i32>, <2 x i32>) nounwind readnone declare <1 x i64> @llvm.arm64.neon.suqadd.v1i64(<1 x i64>, <1 x i64>) nounwind readnone +declare i64 @llvm.arm64.neon.suqadd.i64(i64, i64) nounwind readnone +declare i32 @llvm.arm64.neon.suqadd.i32(i32, i32) nounwind readnone declare <16 x i8> @llvm.arm64.neon.suqadd.v16i8(<16 x i8>, <16 x i8>) nounwind readnone declare <8 x i16> @llvm.arm64.neon.suqadd.v8i16(<8 x i16>, <8 x i16>) nounwind readnone -- 2.11.0