1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
4 ; BIF Bitwise Insert if False
8 define <1 x i8> @test_bitf_v1i8(<1 x i8> %A, <1 x i8> %B, <1 x i8> %C) {
9 ; CHECK-LABEL: test_bitf_v1i8:
11 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
13 %neg = xor <1 x i8> %C, <i8 -1>
14 %and = and <1 x i8> %neg, %B
15 %and1 = and <1 x i8> %C, %A
16 %or = or <1 x i8> %and, %and1
20 ; 16-bit vectors tests
22 define <1 x i16> @test_bitf_v1i16(<1 x i16> %A, <1 x i16> %B, <1 x i16> %C) {
23 ; CHECK-LABEL: test_bitf_v1i16:
25 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
27 %neg = xor <1 x i16> %C, <i16 -1>
28 %and = and <1 x i16> %neg, %B
29 %and1 = and <1 x i16> %C, %A
30 %or = or <1 x i16> %and, %and1
34 ; 32-bit vectors tests
36 define <1 x i32> @test_bitf_v1i32(<1 x i32> %A, <1 x i32> %B, <1 x i32> %C) {
37 ; CHECK-LABEL: test_bitf_v1i32:
39 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
41 %neg = xor <1 x i32> %C, <i32 -1>
42 %and = and <1 x i32> %neg, %B
43 %and1 = and <1 x i32> %C, %A
44 %or = or <1 x i32> %and, %and1
48 ; 64-bit vectors tests
50 define <1 x i64> @test_bitf_v1i64(<1 x i64> %A, <1 x i64> %B, <1 x i64> %C) {
51 ; CHECK-LABEL: test_bitf_v1i64:
53 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
55 %neg = xor <1 x i64> %C, <i64 -1>
56 %and = and <1 x i64> %neg, %B
57 %and1 = and <1 x i64> %C, %A
58 %or = or <1 x i64> %and, %and1
62 define <2 x i32> @test_bitf_v2i32(<2 x i32> %A, <2 x i32> %B, <2 x i32> %C) {
63 ; CHECK-LABEL: test_bitf_v2i32:
65 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
67 %neg = xor <2 x i32> %C, <i32 -1, i32 -1>
68 %and = and <2 x i32> %neg, %B
69 %and1 = and <2 x i32> %C, %A
70 %or = or <2 x i32> %and, %and1
74 define <4 x i16> @test_bitf_v4i16(<4 x i16> %A, <4 x i16> %B, <4 x i16> %C) {
75 ; CHECK-LABEL: test_bitf_v4i16:
77 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
79 %neg = xor <4 x i16> %C, <i16 -1, i16 -1, i16 -1, i16 -1>
80 %and = and <4 x i16> %neg, %B
81 %and1 = and <4 x i16> %C, %A
82 %or = or <4 x i16> %and, %and1
86 define <8 x i8> @test_bitf_v8i8(<8 x i8> %A, <8 x i8> %B, <8 x i8> %C) {
87 ; CHECK-LABEL: test_bitf_v8i8:
89 ; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
91 %neg = xor <8 x i8> %C, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
92 %and = and <8 x i8> %neg, %B
93 %and1 = and <8 x i8> %C, %A
94 %or = or <8 x i8> %and, %and1
98 ; 128-bit vectors tests
100 define <2 x i64> @test_bitf_v2i64(<2 x i64> %A, <2 x i64> %B, <2 x i64> %C) {
101 ; CHECK-LABEL: test_bitf_v2i64:
103 ; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
105 %neg = xor <2 x i64> %C, <i64 -1, i64 -1>
106 %and = and <2 x i64> %neg, %B
107 %and1 = and <2 x i64> %C, %A
108 %or = or <2 x i64> %and, %and1
112 define <4 x i32> @test_bitf_v4i32(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C) {
113 ; CHECK-LABEL: test_bitf_v4i32:
115 ; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
117 %neg = xor <4 x i32> %C, <i32 -1, i32 -1, i32 -1, i32 -1>
118 %and = and <4 x i32> %neg, %B
119 %and1 = and <4 x i32> %C, %A
120 %or = or <4 x i32> %and, %and1
124 define <8 x i16> @test_bitf_v8i16(<8 x i16> %A, <8 x i16> %B, <8 x i16> %C) {
125 ; CHECK-LABEL: test_bitf_v8i16:
127 ; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
129 %neg = xor <8 x i16> %C, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
130 %and = and <8 x i16> %neg, %B
131 %and1 = and <8 x i16> %C, %A
132 %or = or <8 x i16> %and, %and1
136 define <16 x i8> @test_bitf_v16i8(<16 x i8> %A, <16 x i8> %B, <16 x i8> %C) {
137 ; CHECK-LABEL: test_bitf_v16i8:
139 ; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
141 %neg = xor <16 x i8> %C, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
142 %and = and <16 x i8> %neg, %B
143 %and1 = and <16 x i8> %C, %A
144 %or = or <16 x i8> %and, %and1