[llvm] 9b8bcd2 - [RISCV][test] Add a test for vector hasAndNot

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 24 09:54:56 PDT 2025


Author: Piotr Fusik
Date: 2025-03-24T17:54:18+01:00
New Revision: 9b8bcd288ae8d6d31ac51b3b959e796842b2d5c7

URL: https://github.com/llvm/llvm-project/commit/9b8bcd288ae8d6d31ac51b3b959e796842b2d5c7
DIFF: https://github.com/llvm/llvm-project/commit/9b8bcd288ae8d6d31ac51b3b959e796842b2d5c7.diff

LOG: [RISCV][test] Add a test for vector hasAndNot

Added: 
    

Modified: 
    llvm/test/CodeGen/RISCV/rvv/vandn-sdnode.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/RISCV/rvv/vandn-sdnode.ll b/llvm/test/CodeGen/RISCV/rvv/vandn-sdnode.ll
index a4c64d6fa5ef5..5c24de2fd5601 100644
--- a/llvm/test/CodeGen/RISCV/rvv/vandn-sdnode.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/vandn-sdnode.ll
@@ -2567,3 +2567,24 @@ for.body:
   %exitcond.not = icmp eq i64 %indvars.iv.next, 256
   br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
 }
+
+define <vscale x 1 x i8> @not_signbit_mask_nxv1i8(<vscale x 1 x i8> %a, <vscale x 1 x i8> %b) {
+; CHECK-LABEL: not_signbit_mask_nxv1i8:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    vsetvli a0, zero, e8, mf8, ta, ma
+; CHECK-NEXT:    vmsgt.vi v0, v8, -1
+; CHECK-NEXT:    vmv.v.i v8, 0
+; CHECK-NEXT:    vmerge.vvm v8, v8, v9, v0
+; CHECK-NEXT:    ret
+;
+; CHECK-ZVKB-LABEL: not_signbit_mask_nxv1i8:
+; CHECK-ZVKB:       # %bb.0:
+; CHECK-ZVKB-NEXT:    vsetvli a0, zero, e8, mf8, ta, ma
+; CHECK-ZVKB-NEXT:    vmsgt.vi v0, v8, -1
+; CHECK-ZVKB-NEXT:    vmv.v.i v8, 0
+; CHECK-ZVKB-NEXT:    vmerge.vvm v8, v8, v9, v0
+; CHECK-ZVKB-NEXT:    ret
+  %cond = icmp sgt <vscale x 1 x i8> %a, splat (i8 -1)
+  %r = select <vscale x 1 x i1> %cond, <vscale x 1 x i8> %b, <vscale x 1 x i8> zeroinitializer
+  ret <vscale x 1 x i8> %r
+}


        


More information about the llvm-commits mailing list