Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a8aa6c3

Browse files
author
Ana Pazos
committed
[AArch64] Added vselect patterns with float and double types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199925 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c3b4897 commit a8aa6c3

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/Target/AArch64/AArch64InstrNEON.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ multiclass Neon_bitwise3V_patterns<SDPatternOperator opnode,
473473
(INST16B VPR128:$src, VPR128:$Rn, VPR128:$Rm)>;
474474
def : Pat<(v2i64 (opnode (v2i64 VPR128:$src), VPR128:$Rn, VPR128:$Rm)),
475475
(INST16B VPR128:$src, VPR128:$Rn, VPR128:$Rm)>;
476+
def : Pat<(v2f64 (opnode (v2i64 VPR128:$src), VPR128:$Rn, VPR128:$Rm)),
477+
(INST16B VPR128:$src, VPR128:$Rn, VPR128:$Rm)>;
478+
def : Pat<(v4f32 (opnode (v4i32 VPR128:$src), VPR128:$Rn, VPR128:$Rm)),
479+
(INST16B VPR128:$src, VPR128:$Rn, VPR128:$Rm)>;
476480

477481
// Allow to match BSL instruction pattern with non-constant operand
478482
def : Pat<(v8i8 (or (and VPR64:$Rn, VPR64:$Rd),

test/CodeGen/AArch64/neon-bsl.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,16 @@ entry:
220220
ret <2 x double> %vbsl3.i
221221
}
222222

223+
define <2 x double> @test_bsl_v2f64(<2 x i1> %v1, <2 x double> %v2, <2 x double> %v3) {
224+
; CHECK-LABEL: test_bsl_v2f64:
225+
; CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
226+
%1 = select <2 x i1> %v1, <2 x double> %v2, <2 x double> %v3
227+
ret <2 x double> %1
228+
}
229+
230+
define <4 x float> @test_bsl_v4f32(<4 x i1> %v1, <4 x float> %v2, <4 x float> %v3) {
231+
; CHECK-LABEL: test_bsl_v4f32:
232+
; CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
233+
%1 = select <4 x i1> %v1, <4 x float> %v2, <4 x float> %v3
234+
ret <4 x float> %1
235+
}

0 commit comments

Comments
 (0)