You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/AArch64/sve2-bsl.ll
+46-9Lines changed: 46 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -42,17 +42,54 @@ define <vscale x 4 x i32> @no_bsl_fold(<vscale x 4 x i32> %a, <vscale x 4 x i32>
42
42
ret <vscale x 4 x i32> %c
43
43
}
44
44
45
-
define <vscale x 4 x i32> @nbsl(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
46
-
; CHECK-LABEL: nbsl:
45
+
define <vscale x 16 x i8> @nbsl_i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
46
+
; CHECK-LABEL: nbsl_i8:
47
+
; CHECK: // %bb.0:
48
+
; CHECK-NEXT: mov z2.b, #127 // =0x7f
49
+
; CHECK-NEXT: nbsl z0.d, z0.d, z1.d, z2.d
50
+
; CHECK-NEXT: ret
51
+
%1 = and <vscale x 16 x i8> %a, splat(i8127)
52
+
%2 = and <vscale x 16 x i8> %b, splat(i8 -128)
53
+
%3 = or <vscale x 16 x i8> %1, %2
54
+
%4 = xor <vscale x 16 x i8> %3, splat(i8 -1)
55
+
ret <vscale x 16 x i8> %4
56
+
}
57
+
58
+
define <vscale x 8 x i16> @nbsl_i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
59
+
; CHECK-LABEL: nbsl_i16:
60
+
; CHECK: // %bb.0:
61
+
; CHECK-NEXT: mov z2.h, #32767 // =0x7fff
62
+
; CHECK-NEXT: nbsl z0.d, z0.d, z1.d, z2.d
63
+
; CHECK-NEXT: ret
64
+
%1 = and <vscale x 8 x i16> %a, splat(i1632767)
65
+
%2 = and <vscale x 8 x i16> %b, splat(i16 -32768)
66
+
%3 = or <vscale x 8 x i16> %1, %2
67
+
%4 = xor <vscale x 8 x i16> %3, splat(i16 -1)
68
+
ret <vscale x 8 x i16> %4
69
+
}
70
+
71
+
define <vscale x 4 x i32> @nbsl_i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
72
+
; CHECK-LABEL: nbsl_i32:
47
73
; CHECK: // %bb.0:
48
74
; CHECK-NEXT: mov z2.s, #0x7fffffff
49
-
; CHECK-NEXT: nbsl z2.d, z2.d, z0.d, z1.d
50
-
; CHECK-NEXT: mov z0.d, z2.d
75
+
; CHECK-NEXT: nbsl z0.d, z0.d, z1.d, z2.d
51
76
; CHECK-NEXT: ret
52
-
%1 = and <vscale x 4 x i32> %a, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i322147483647, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
53
-
%2 = and <vscale x 4 x i32> %b, shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32-2147483648, i640), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
77
+
%1 = and <vscale x 4 x i32> %a, splat(i322147483647)
78
+
%2 = and <vscale x 4 x i32> %b, splat(i32-2147483648)
54
79
%3 = or <vscale x 4 x i32> %1, %2
55
-
%4 = icmpeq <vscale x 4 x i32> %3, zeroinitializer
56
-
%5 = zext <vscale x 4 x i1> %4to <vscale x 4 x i32>
57
-
ret <vscale x 4 x i32> %5
80
+
%4 = xor <vscale x 4 x i32> %3, splat(i32 -1)
81
+
ret <vscale x 4 x i32> %4
82
+
}
83
+
84
+
define <vscale x 2 x i64> @nbsl_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
85
+
; CHECK-LABEL: nbsl_i64:
86
+
; CHECK: // %bb.0:
87
+
; CHECK-NEXT: mov z2.d, #0x7fffffffffffffff
88
+
; CHECK-NEXT: nbsl z0.d, z0.d, z1.d, z2.d
89
+
; CHECK-NEXT: ret
90
+
%1 = and <vscale x 2 x i64> %a, splat(i649223372036854775807)
91
+
%2 = and <vscale x 2 x i64> %b, splat(i64 -9223372036854775808)
0 commit comments