Skip to content

Conversation

heiher
Copy link
Member

@heiher heiher commented Jul 22, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jul 22, 2025

@llvm/pr-subscribers-backend-loongarch

Author: hev (heiher)

Changes

Patch is 50.29 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/149952.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll (+1337)
diff --git a/llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll b/llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll
index ad57bbf9ee5c0..397896c543898 100644
--- a/llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll
+++ b/llvm/test/CodeGen/LoongArch/lsx/vmskcond.ll
@@ -603,3 +603,1340 @@ define i4 @vmsk_eq_allzeros_v4i8(<4 x i8> %a) {
   %2 = bitcast <4 x i1> %1 to i4
   ret i4 %2
 }
+
+define i32 @vmsk2_eq_allzeros_i8(<32 x i8> %a) {
+; CHECK-LABEL: vmsk2_eq_allzeros_i8:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addi.d $sp, $sp, -16
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:    vseqi.b $vr0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 1
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    bstrins.d $a0, $a1, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a0, $a1, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a0, $a1, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a0, $a1, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a0, $a1, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 6
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 6
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 7
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 7
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 8
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 8
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 9
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 9
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 10
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 10
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 11
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 11
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 12
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 12
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 13
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 13
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 14
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 14
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 15
+; CHECK-NEXT:    slli.d $a1, $a1, 15
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    bstrpick.d $a0, $a0, 15, 0
+; CHECK-NEXT:    vseqi.b $vr0, $vr1, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 1
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    bstrins.d $a1, $a2, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a1, $a2, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a1, $a2, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a1, $a2, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a1, $a2, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 6
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 6
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 7
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 7
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 8
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 8
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 9
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 9
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 10
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 10
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 11
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 11
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 12
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 12
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 13
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 13
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 14
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 14
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 15
+; CHECK-NEXT:    slli.d $a2, $a2, 15
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    bstrpick.d $a1, $a1, 15, 0
+; CHECK-NEXT:    slli.d $a1, $a1, 16
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    addi.d $sp, $sp, 16
+; CHECK-NEXT:    ret
+entry:
+  %1 = icmp eq <32 x i8> %a, splat (i8 0)
+  %2 = bitcast <32 x i1> %1 to i32
+  ret i32 %2
+}
+
+define i32 @vmsk2_sgt_allzeros_i8(<32 x i8> %a) {
+; CHECK-LABEL: vmsk2_sgt_allzeros_i8:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addi.d $sp, $sp, -16
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:    vrepli.b $vr2, 0
+; CHECK-NEXT:    vslt.b $vr0, $vr2, $vr0
+; CHECK-NEXT:    vpickve2gr.b $a0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 1
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    bstrins.d $a0, $a1, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a0, $a1, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a0, $a1, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a0, $a1, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a0, $a1, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 6
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 6
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 7
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 7
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 8
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 8
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 9
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 9
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 10
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 10
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 11
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 11
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 12
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 12
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 13
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 13
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 14
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 14
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 15
+; CHECK-NEXT:    slli.d $a1, $a1, 15
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    bstrpick.d $a0, $a0, 15, 0
+; CHECK-NEXT:    vslt.b $vr0, $vr2, $vr1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 1
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    bstrins.d $a1, $a2, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a1, $a2, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a1, $a2, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a1, $a2, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a1, $a2, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 6
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 6
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 7
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 7
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 8
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 8
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 9
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 9
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 10
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 10
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 11
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 11
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 12
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 12
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 13
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 13
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 14
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 14
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 15
+; CHECK-NEXT:    slli.d $a2, $a2, 15
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    bstrpick.d $a1, $a1, 15, 0
+; CHECK-NEXT:    slli.d $a1, $a1, 16
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    addi.d $sp, $sp, 16
+; CHECK-NEXT:    ret
+entry:
+  %1 = icmp sgt <32 x i8> %a, splat (i8 0)
+  %2 = bitcast <32 x i1> %1 to i32
+  ret i32 %2
+}
+
+define i32 @vmsk2_sgt_allones_i8(<32 x i8> %a) {
+; CHECK-LABEL: vmsk2_sgt_allones_i8:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addi.d $sp, $sp, -16
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:    vrepli.b $vr2, -1
+; CHECK-NEXT:    vslt.b $vr0, $vr2, $vr0
+; CHECK-NEXT:    vpickve2gr.b $a0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 1
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    bstrins.d $a0, $a1, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a0, $a1, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a0, $a1, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a0, $a1, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a0, $a1, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 6
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 6
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 7
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 7
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 8
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 8
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 9
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 9
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 10
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 10
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 11
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 11
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 12
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 12
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 13
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 13
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 14
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 14
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 15
+; CHECK-NEXT:    slli.d $a1, $a1, 15
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    bstrpick.d $a0, $a0, 15, 0
+; CHECK-NEXT:    vslt.b $vr0, $vr2, $vr1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 1
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    bstrins.d $a1, $a2, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a1, $a2, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a1, $a2, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a1, $a2, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a1, $a2, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 6
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 6
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 7
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 7
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 8
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 8
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 9
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 9
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 10
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 10
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 11
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 11
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 12
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 12
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 13
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 13
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 14
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 14
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 15
+; CHECK-NEXT:    slli.d $a2, $a2, 15
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    bstrpick.d $a1, $a1, 15, 0
+; CHECK-NEXT:    slli.d $a1, $a1, 16
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    addi.d $sp, $sp, 16
+; CHECK-NEXT:    ret
+entry:
+  %1 = icmp sgt <32 x i8> %a, splat (i8 -1)
+  %2 = bitcast <32 x i1> %1 to i32
+  ret i32 %2
+}
+
+define i32 @vmsk2_sge_allzeros_i8(<32 x i8> %a) {
+; CHECK-LABEL: vmsk2_sge_allzeros_i8:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addi.d $sp, $sp, -16
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:    vrepli.b $vr2, 0
+; CHECK-NEXT:    vsle.b $vr0, $vr2, $vr0
+; CHECK-NEXT:    vpickve2gr.b $a0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 1
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    bstrins.d $a0, $a1, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a0, $a1, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a0, $a1, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a0, $a1, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a0, $a1, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 6
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 6
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 7
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 7
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 8
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 8
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 9
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 9
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 10
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 10
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 11
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 11
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 12
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 12
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 13
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 13
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 14
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 14
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 15
+; CHECK-NEXT:    slli.d $a1, $a1, 15
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    bstrpick.d $a0, $a0, 15, 0
+; CHECK-NEXT:    vsle.b $vr0, $vr2, $vr1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 1
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    bstrins.d $a1, $a2, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a1, $a2, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a1, $a2, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a1, $a2, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a1, $a2, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 6
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 6
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 7
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 7
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 8
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 8
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 9
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 9
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 10
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 10
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 11
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 11
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 12
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 12
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 13
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 13
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 14
+; CHECK-NEXT:    andi $a2, $a2, 1
+; CHECK-NEXT:    slli.d $a2, $a2, 14
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    vpickve2gr.b $a2, $vr0, 15
+; CHECK-NEXT:    slli.d $a2, $a2, 15
+; CHECK-NEXT:    or $a1, $a1, $a2
+; CHECK-NEXT:    bstrpick.d $a1, $a1, 15, 0
+; CHECK-NEXT:    slli.d $a1, $a1, 16
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    addi.d $sp, $sp, 16
+; CHECK-NEXT:    ret
+entry:
+  %1 = icmp sge <32 x i8> %a, splat (i8 0)
+  %2 = bitcast <32 x i1> %1 to i32
+  ret i32 %2
+}
+
+define i32 @vmsk2_slt_allzeros_i8(<32 x i8> %a) {
+; CHECK-LABEL: vmsk2_slt_allzeros_i8:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addi.d $sp, $sp, -16
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:    vslti.b $vr0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a0, $vr0, 0
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 1
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    bstrins.d $a0, $a1, 63, 1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 2
+; CHECK-NEXT:    bstrins.d $a0, $a1, 2, 2
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 3
+; CHECK-NEXT:    bstrins.d $a0, $a1, 3, 3
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 4
+; CHECK-NEXT:    bstrins.d $a0, $a1, 4, 4
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 5
+; CHECK-NEXT:    bstrins.d $a0, $a1, 5, 5
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 6
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 6
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 7
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 7
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 8
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 8
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 9
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 9
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-NEXT:    vpickve2gr.b $a1, $vr0, 10
+; CHECK-NEXT:    andi $a1, $a1, 1
+; CHECK-NEXT:    slli.d $a1, $a1, 10
+; CHECK-NEXT:    or $a0, $a0, $a1
+; CHECK-N...
[truncated]

@heiher heiher requested a review from tangaac July 23, 2025 03:17
@heiher heiher merged commit 608b51e into llvm:main Aug 28, 2025
9 checks passed
@heiher heiher deleted the opt-vmsk-tests branch August 28, 2025 09:58
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 28, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-4 while building llvm at step 4 "cmake-configure".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/26309

Here is the relevant piece of the build log for the reference
Step 4 (cmake-configure) failure: cmake (failure)
Upon execvpe b'cmake' [b'cmake', b'-DCMAKE_C_COMPILER=clang', b'-DCMAKE_CXX_COMPILER=clang++', b'-DCMAKE_BUILD_TYPE=Release', b'-DLLVM_BUILD_TESTS=ON', b'-DLLVM_CCACHE_BUILD=ON', b'-DLLVM_ENABLE_ASSERTIONS=ON', b'-DLLVM_INCLUDE_EXAMPLES=OFF', b'-DLLVM_LIT_ARGS=--verbose --timeout=900', b'-DLLVM_TARGETS_TO_BUILD=AArch64', b'-DLLVM_ENABLE_PROJECTS=llvm;cross-project-tests;lld;clang-tools-extra;clang', b'-GNinja', b'../llvm-project/llvm'] in environment id 4365064192
:Traceback (most recent call last):
  File "/Library/Python/3.9/site-packages/twisted/internet/process.py", line 433, in _fork
    self._execChild(path, uid, gid, executable, args, environment)
  File "/Library/Python/3.9/site-packages/twisted/internet/process.py", line 504, in _execChild
    os.execvpe(executable, args, environment)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 583, in execvpe
    _execvpe(file, args, env)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 616, in _execvpe
    raise last_exc
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 607, in _execvpe
    exec_func(fullname, *argrest)
FileNotFoundError: [Errno 2] No such file or directory: b'/opt/homebrew/bin/cmake'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants