[PATCH] D129625: [NFC][SVE] Add tests for zext(cmpeq(x, splat(0)))
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 14 02:33:07 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa2fe6aa9ebf3: [NFC][SVE] Add tests for zext(cmpeq(x, splat(0))) (authored by c-rhodes).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129625/new/
https://reviews.llvm.org/D129625
Files:
llvm/test/CodeGen/AArch64/sve-cmp-folds.ll
Index: llvm/test/CodeGen/AArch64/sve-cmp-folds.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-cmp-folds.ll
+++ llvm/test/CodeGen/AArch64/sve-cmp-folds.ll
@@ -53,6 +53,54 @@
ret <vscale x 4 x i1> %not
}
+define <vscale x 16 x i8> @icmp_cnot_nxv16i8(<vscale x 16 x i8> %a) {
+; CHECK-LABEL: icmp_cnot_nxv16i8:
+; CHECK: // %bb.0:
+; CHECK-NEXT: ptrue p0.b
+; CHECK-NEXT: cmpeq p0.b, p0/z, z0.b, #0
+; CHECK-NEXT: mov z0.b, p0/z, #1 // =0x1
+; CHECK-NEXT: ret
+ %mask = icmp eq <vscale x 16 x i8> %a, zeroinitializer
+ %zext = zext <vscale x 16 x i1> %mask to <vscale x 16 x i8>
+ ret <vscale x 16 x i8> %zext
+}
+
+define <vscale x 8 x i16> @icmp_cnot_nxv8i16(<vscale x 8 x i16> %a) {
+; CHECK-LABEL: icmp_cnot_nxv8i16:
+; CHECK: // %bb.0:
+; CHECK-NEXT: ptrue p0.h
+; CHECK-NEXT: cmpeq p0.h, p0/z, z0.h, #0
+; CHECK-NEXT: mov z0.h, p0/z, #1 // =0x1
+; CHECK-NEXT: ret
+ %mask = icmp eq <vscale x 8 x i16> %a, zeroinitializer
+ %zext = zext <vscale x 8 x i1> %mask to <vscale x 8 x i16>
+ ret <vscale x 8 x i16> %zext
+}
+
+define <vscale x 4 x i32> @icmp_cnot_nxv4i32(<vscale x 4 x i32> %a) {
+; CHECK-LABEL: icmp_cnot_nxv4i32:
+; CHECK: // %bb.0:
+; CHECK-NEXT: ptrue p0.s
+; CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, #0
+; CHECK-NEXT: mov z0.s, p0/z, #1 // =0x1
+; CHECK-NEXT: ret
+ %mask = icmp eq <vscale x 4 x i32> %a, zeroinitializer
+ %zext = zext <vscale x 4 x i1> %mask to <vscale x 4 x i32>
+ ret <vscale x 4 x i32> %zext
+}
+
+define <vscale x 2 x i64> @icmp_cnot_nxv2i64(<vscale x 2 x i64> %a) {
+; CHECK-LABEL: icmp_cnot_nxv2i64:
+; CHECK: // %bb.0:
+; CHECK-NEXT: ptrue p0.d
+; CHECK-NEXT: cmpeq p0.d, p0/z, z0.d, #0
+; CHECK-NEXT: mov z0.d, p0/z, #1 // =0x1
+; CHECK-NEXT: ret
+ %mask = icmp eq <vscale x 2 x i64> %a, zeroinitializer
+ %zext = zext <vscale x 2 x i1> %mask to <vscale x 2 x i64>
+ ret <vscale x 2 x i64> %zext
+}
+
define i1 @foo_first(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
; CHECK-LABEL: foo_first:
; CHECK: // %bb.0:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129625.444567.patch
Type: text/x-patch
Size: 2114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220714/e442b153/attachment.bin>
More information about the llvm-commits
mailing list