CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
501 lines
17 KiB
LLVM
501 lines
17 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
|
|
; RUN: llc -enable-subreg-liveness -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s --check-prefixes=CHECK,NONSTREAMING
|
|
; RUN: llc -enable-subreg-liveness -mtriple=aarch64-linux-gnu -mattr=+sme -force-streaming < %s | FileCheck %s --check-prefixes=CHECK,STREAMING
|
|
|
|
; WITH VSCALE RANGE
|
|
|
|
define i32 @ctz_nxv32i1(<vscale x 32 x i1> %a) #0 {
|
|
; NONSTREAMING-LABEL: ctz_nxv32i1:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: ptrue p2.b
|
|
; NONSTREAMING-NEXT: rdvl x8, #1
|
|
; NONSTREAMING-NEXT: mov w10, w8
|
|
; NONSTREAMING-NEXT: brkb p0.b, p2/z, p0.b
|
|
; NONSTREAMING-NEXT: brkb p1.b, p2/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x9, p0, p0.b
|
|
; NONSTREAMING-NEXT: incp x8, p1.b
|
|
; NONSTREAMING-NEXT: cmp w9, w10
|
|
; NONSTREAMING-NEXT: csel w0, w9, w8, ne
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_nxv32i1:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: ptrue p2.b
|
|
; STREAMING-NEXT: rdvl x10, #1
|
|
; STREAMING-NEXT: brkb p1.b, p2/z, p1.b
|
|
; STREAMING-NEXT: brkb p0.b, p2/z, p0.b
|
|
; STREAMING-NEXT: cntp x8, p1, p1.b
|
|
; STREAMING-NEXT: cntp x9, p0, p0.b
|
|
; STREAMING-NEXT: incb x8
|
|
; STREAMING-NEXT: cmp w9, w10
|
|
; STREAMING-NEXT: csel w0, w9, w8, ne
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv32i1(<vscale x 32 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_nxv4i32(<vscale x 4 x i32> %a) #0 {
|
|
; CHECK-LABEL: ctz_nxv4i32:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p0.s
|
|
; CHECK-NEXT: cmpne p1.s, p0/z, z0.s, #0
|
|
; CHECK-NEXT: brkb p1.b, p0/z, p1.b
|
|
; CHECK-NEXT: cntp x0, p1, p1.s
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv4i32(<vscale x 4 x i32> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
; VSCALE RANGE, ZERO IS POISON
|
|
|
|
define i64 @vscale_4096(<vscale x 16 x i8> %a) #1 {
|
|
; CHECK-LABEL: vscale_4096:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p0.b
|
|
; CHECK-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; CHECK-NEXT: brkb p1.b, p0/z, p1.b
|
|
; CHECK-NEXT: cntp x0, p1, p1.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv16i8(<vscale x 16 x i8> %a, i1 0)
|
|
ret i64 %res
|
|
}
|
|
|
|
define i64 @vscale_4096_poison(<vscale x 16 x i8> %a) #1 {
|
|
; CHECK-LABEL: vscale_4096_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p0.b
|
|
; CHECK-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; CHECK-NEXT: brkb p1.b, p0/z, p1.b
|
|
; CHECK-NEXT: cntp x0, p1, p1.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv16i8(<vscale x 16 x i8> %a, i1 1)
|
|
ret i64 %res
|
|
}
|
|
|
|
; EFFICIENT LOWERING USING BRKB
|
|
|
|
define i32 @ctz_nxv2i1(<vscale x 2 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv2i1:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.d
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.d
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv2i1(<vscale x 2 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_nxv2i1_poison(<vscale x 2 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv2i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.d
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.d
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv2i1(<vscale x 2 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i64 @add_i64_ctz_nxv2i1_poison(<vscale x 2 x i1> %a, i64 %b) {
|
|
; CHECK-LABEL: add_i64_ctz_nxv2i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.d
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.d
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv2i1(<vscale x 2 x i1> %a, i1 1)
|
|
%add = add i64 %res, %b
|
|
ret i64 %add
|
|
}
|
|
|
|
define i32 @add_i32_ctz_nxv2i1_poison(<vscale x 2 x i1> %a, i32 %b) {
|
|
; CHECK-LABEL: add_i32_ctz_nxv2i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.d
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.d
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv2i1(<vscale x 2 x i1> %a, i1 1)
|
|
%trunc = trunc i64 %res to i32
|
|
%add = add i32 %trunc, %b
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @ctz_nxv4i1(<vscale x 4 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv4i1:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.s
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.s
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv4i1(<vscale x 4 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_nxv4i1_poison(<vscale x 4 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv4i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.s
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.s
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv4i1(<vscale x 4 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i64 @add_i64_ctz_nxv4i1_poison(<vscale x 4 x i1> %a, i64 %b) {
|
|
; CHECK-LABEL: add_i64_ctz_nxv4i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.s
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.s
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv4i1(<vscale x 4 x i1> %a, i1 1)
|
|
%add = add i64 %res, %b
|
|
ret i64 %add
|
|
}
|
|
|
|
define i32 @add_i32_ctz_nxv4i1_poison(<vscale x 4 x i1> %a, i32 %b) {
|
|
; CHECK-LABEL: add_i32_ctz_nxv4i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.s
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.s
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv4i1(<vscale x 4 x i1> %a, i1 1)
|
|
%trunc = trunc i64 %res to i32
|
|
%add = add i32 %trunc, %b
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @ctz_nxv8i1(<vscale x 8 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv8i1:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.h
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.h
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv8i1(<vscale x 8 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_nxv8i1_poison(<vscale x 8 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv8i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.h
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.h
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv8i1(<vscale x 8 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i64 @add_i64_ctz_nxv8i1_poison(<vscale x 8 x i1> %a, i64 %b) {
|
|
; CHECK-LABEL: add_i64_ctz_nxv8i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.h
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.h
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv8i1(<vscale x 8 x i1> %a, i1 1)
|
|
%add = add i64 %res, %b
|
|
ret i64 %add
|
|
}
|
|
|
|
define i32 @add_i32_ctz_nxv8i1_poison(<vscale x 8 x i1> %a, i32 %b) {
|
|
; CHECK-LABEL: add_i32_ctz_nxv8i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.h
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.h
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv8i1(<vscale x 8 x i1> %a, i1 1)
|
|
%trunc = trunc i64 %res to i32
|
|
%add = add i32 %trunc, %b
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @ctz_nxv16i1(<vscale x 16 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv16i1:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.b
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv16i1(<vscale x 16 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_nxv16i1_poison(<vscale x 16 x i1> %a) {
|
|
; CHECK-LABEL: ctz_nxv16i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.b
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: cntp x0, p0, p0.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv16i1(<vscale x 16 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_and_nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
|
|
; CHECK-LABEL: ctz_and_nxv16i1:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: cmpne p1.b, p0/z, z0.b, z1.b
|
|
; CHECK-NEXT: ptrue p0.b
|
|
; CHECK-NEXT: brkb p1.b, p0/z, p1.b
|
|
; CHECK-NEXT: cntp x0, p1, p1.b
|
|
; CHECK-NEXT: ret
|
|
%cmp = icmp ne <vscale x 16 x i8> %a, %b
|
|
%select = select <vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp, <vscale x 16 x i1> zeroinitializer
|
|
%and = and <vscale x 16 x i1> %pg, %select
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.nxv16i1(<vscale x 16 x i1> %and, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i64 @add_i64_ctz_nxv16i1_poison(<vscale x 16 x i1> %a, i64 %b) {
|
|
; CHECK-LABEL: add_i64_ctz_nxv16i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.b
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv16i1(<vscale x 16 x i1> %a, i1 1)
|
|
%add = add i64 %res, %b
|
|
ret i64 %add
|
|
}
|
|
|
|
define i32 @add_i32_ctz_nxv16i1_poison(<vscale x 16 x i1> %a, i32 %b) {
|
|
; CHECK-LABEL: add_i32_ctz_nxv16i1_poison:
|
|
; CHECK: // %bb.0:
|
|
; CHECK-NEXT: ptrue p1.b
|
|
; CHECK-NEXT: brkb p0.b, p1/z, p0.b
|
|
; CHECK-NEXT: incp x0, p0.b
|
|
; CHECK-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.nxv16i1(<vscale x 16 x i1> %a, i1 1)
|
|
%trunc = trunc i64 %res to i32
|
|
%add = add i32 %trunc, %b
|
|
ret i32 %add
|
|
}
|
|
|
|
; FIXED-WIDTH VECTOR TYPES
|
|
|
|
define i32 @ctz_v16i1(<16 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v16i1:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.16b, v0.16b, #7
|
|
; NONSTREAMING-NEXT: ptrue p0.b, vl16
|
|
; NONSTREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.b
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v16i1:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.b, z0.b, #7
|
|
; STREAMING-NEXT: ptrue p0.b, vl16
|
|
; STREAMING-NEXT: asr z0.b, z0.b, #7
|
|
; STREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.b
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v16i1(<16 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v16i1_poison(<16 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v16i1_poison:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.16b, v0.16b, #7
|
|
; NONSTREAMING-NEXT: ptrue p0.b, vl16
|
|
; NONSTREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.b
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v16i1_poison:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.b, z0.b, #7
|
|
; STREAMING-NEXT: ptrue p0.b, vl16
|
|
; STREAMING-NEXT: asr z0.b, z0.b, #7
|
|
; STREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.b
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v16i1(<16 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i64 @add_i64_ctz_v16i1_poison(<16 x i1> %a, i64 %b) {
|
|
; NONSTREAMING-LABEL: add_i64_ctz_v16i1_poison:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.16b, v0.16b, #7
|
|
; NONSTREAMING-NEXT: ptrue p0.b, vl16
|
|
; NONSTREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: incp x0, p1.b
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: add_i64_ctz_v16i1_poison:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.b, z0.b, #7
|
|
; STREAMING-NEXT: ptrue p0.b, vl16
|
|
; STREAMING-NEXT: asr z0.b, z0.b, #7
|
|
; STREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: incp x0, p1.b
|
|
; STREAMING-NEXT: ret
|
|
%res = call i64 @llvm.experimental.cttz.elts.i64.v16i1(<16 x i1> %a, i1 1)
|
|
%add = add i64 %res, %b
|
|
ret i64 %add
|
|
}
|
|
|
|
define i32 @ctz_v8i1(<8 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v8i1:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.8b, v0.8b, #7
|
|
; NONSTREAMING-NEXT: ptrue p0.b, vl8
|
|
; NONSTREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.b
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v8i1:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.b, z0.b, #7
|
|
; STREAMING-NEXT: ptrue p0.b, vl8
|
|
; STREAMING-NEXT: asr z0.b, z0.b, #7
|
|
; STREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.b
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v8i1(<8 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v8i1_poison(<8 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v8i1_poison:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.8b, v0.8b, #7
|
|
; NONSTREAMING-NEXT: ptrue p0.b, vl8
|
|
; NONSTREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.b
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v8i1_poison:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.b, z0.b, #7
|
|
; STREAMING-NEXT: ptrue p0.b, vl8
|
|
; STREAMING-NEXT: asr z0.b, z0.b, #7
|
|
; STREAMING-NEXT: cmpne p1.b, p0/z, z0.b, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.b
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v8i1(<8 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v4i1(<4 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v4i1:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.4h, v0.4h, #15
|
|
; NONSTREAMING-NEXT: ptrue p0.h, vl4
|
|
; NONSTREAMING-NEXT: cmpne p1.h, p0/z, z0.h, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.h
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v4i1:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.h, z0.h, #15
|
|
; STREAMING-NEXT: ptrue p0.h, vl4
|
|
; STREAMING-NEXT: asr z0.h, z0.h, #15
|
|
; STREAMING-NEXT: cmpne p1.h, p0/z, z0.h, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.h
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v4i1(<4 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v4i1_poison(<4 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v4i1_poison:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.4h, v0.4h, #15
|
|
; NONSTREAMING-NEXT: ptrue p0.h, vl4
|
|
; NONSTREAMING-NEXT: cmpne p1.h, p0/z, z0.h, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.h
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v4i1_poison:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.h, z0.h, #15
|
|
; STREAMING-NEXT: ptrue p0.h, vl4
|
|
; STREAMING-NEXT: asr z0.h, z0.h, #15
|
|
; STREAMING-NEXT: cmpne p1.h, p0/z, z0.h, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.h
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v4i1(<4 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v2i1(<2 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v2i1:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.2s, v0.2s, #31
|
|
; NONSTREAMING-NEXT: ptrue p0.s, vl2
|
|
; NONSTREAMING-NEXT: cmpne p1.s, p0/z, z0.s, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.s
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v2i1:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.s, z0.s, #31
|
|
; STREAMING-NEXT: ptrue p0.s, vl2
|
|
; STREAMING-NEXT: asr z0.s, z0.s, #31
|
|
; STREAMING-NEXT: cmpne p1.s, p0/z, z0.s, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.s
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v2i1(<2 x i1> %a, i1 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @ctz_v2i1_poison(<2 x i1> %a) {
|
|
; NONSTREAMING-LABEL: ctz_v2i1_poison:
|
|
; NONSTREAMING: // %bb.0:
|
|
; NONSTREAMING-NEXT: shl v0.2s, v0.2s, #31
|
|
; NONSTREAMING-NEXT: ptrue p0.s, vl2
|
|
; NONSTREAMING-NEXT: cmpne p1.s, p0/z, z0.s, #0
|
|
; NONSTREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; NONSTREAMING-NEXT: cntp x0, p1, p1.s
|
|
; NONSTREAMING-NEXT: ret
|
|
;
|
|
; STREAMING-LABEL: ctz_v2i1_poison:
|
|
; STREAMING: // %bb.0:
|
|
; STREAMING-NEXT: lsl z0.s, z0.s, #31
|
|
; STREAMING-NEXT: ptrue p0.s, vl2
|
|
; STREAMING-NEXT: asr z0.s, z0.s, #31
|
|
; STREAMING-NEXT: cmpne p1.s, p0/z, z0.s, #0
|
|
; STREAMING-NEXT: brkb p1.b, p0/z, p1.b
|
|
; STREAMING-NEXT: cntp x0, p1, p1.s
|
|
; STREAMING-NEXT: ret
|
|
%res = call i32 @llvm.experimental.cttz.elts.i32.v2i1(<2 x i1> %a, i1 1)
|
|
ret i32 %res
|
|
}
|
|
|
|
declare i32 @llvm.experimental.cttz.elts.i32.nxv8i1(<vscale x 8 x i1>, i1)
|
|
declare i64 @llvm.experimental.cttz.elts.i64.nxv8i1(<vscale x 8 x i1>, i1)
|
|
declare i64 @llvm.experimental.cttz.elts.i64.nxv16i1(<vscale x 16 x i1>, i1)
|
|
declare i32 @llvm.experimental.cttz.elts.i32.nxv16i1(<vscale x 16 x i1>, i1)
|
|
declare i32 @llvm.experimental.cttz.elts.i32.nxv32i1(<vscale x 32 x i1>, i1)
|
|
declare i32 @llvm.experimental.cttz.elts.i32.nxv4i32(<vscale x 4 x i32>, i1)
|
|
|
|
declare i64 @llvm.experimental.cttz.elts.i64.nxv16i8(<vscale x 16 x i8>, i1)
|
|
|
|
attributes #0 = { vscale_range(1,16) }
|
|
attributes #1 = { vscale_range(1,4096) }
|