; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s ; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning ; ; CLS ; define @cls_i8( %a, %pg, %b) { ; CHECK-LABEL: cls_i8: ; CHECK: cls z0.b, p0/m, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cls.nxv16i8( %a, %pg, %b) ret %out } define @cls_i16( %a, %pg, %b) { ; CHECK-LABEL: cls_i16: ; CHECK: cls z0.h, p0/m, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cls.nxv8i16( %a, %pg, %b) ret %out } define @cls_i32( %a, %pg, %b) { ; CHECK-LABEL: cls_i32: ; CHECK: cls z0.s, p0/m, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cls.nxv4i32( %a, %pg, %b) ret %out } define @cls_i64( %a, %pg, %b) { ; CHECK-LABEL: cls_i64: ; CHECK: cls z0.d, p0/m, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cls.nxv2i64( %a, %pg, %b) ret %out } ; ; CLZ ; define @clz_i8( %a, %pg, %b) { ; CHECK-LABEL: clz_i8: ; CHECK: clz z0.b, p0/m, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.clz.nxv16i8( %a, %pg, %b) ret %out } define @clz_i16( %a, %pg, %b) { ; CHECK-LABEL: clz_i16: ; CHECK: clz z0.h, p0/m, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.clz.nxv8i16( %a, %pg, %b) ret %out } define @clz_i32( %a, %pg, %b) { ; CHECK-LABEL: clz_i32: ; CHECK: clz z0.s, p0/m, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.clz.nxv4i32( %a, %pg, %b) ret %out } define @clz_i64( %a, %pg, %b) { ; CHECK-LABEL: clz_i64: ; CHECK: clz z0.d, p0/m, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.clz.nxv2i64( %a, %pg, %b) ret %out } ; ; CNT ; define @cnt_i8( %a, %pg, %b) { ; CHECK-LABEL: cnt_i8: ; CHECK: cnt z0.b, p0/m, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv16i8( %a, %pg, %b) ret %out } define @cnt_i16( %a, %pg, %b) { ; CHECK-LABEL: cnt_i16: ; CHECK: cnt z0.h, p0/m, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv8i16( %a, %pg, %b) ret %out } define @cnt_i32( %a, %pg, %b) { ; CHECK-LABEL: cnt_i32: ; CHECK: cnt z0.s, p0/m, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv4i32( %a, %pg, %b) ret %out } define @cnt_i64( %a, %pg, %b) { ; CHECK-LABEL: cnt_i64: ; CHECK: cnt z0.d, p0/m, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv2i64( %a, %pg, %b) ret %out } define @cnt_f16( %a, %pg, %b) { ; CHECK-LABEL: cnt_f16: ; CHECK: cnt z0.h, p0/m, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv8f16( %a, %pg, %b) ret %out } define @cnt_bf16( %a, %pg, %b) #0 { ; CHECK-LABEL: cnt_bf16: ; CHECK: cnt z0.h, p0/m, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv8bf16( %a, %pg, %b) ret %out } define @cnt_f32( %a, %pg, %b) { ; CHECK-LABEL: cnt_f32: ; CHECK: cnt z0.s, p0/m, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv4f32( %a, %pg, %b) ret %out } define @cnt_f64( %a, %pg, %b) { ; CHECK-LABEL: cnt_f64: ; CHECK: cnt z0.d, p0/m, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.cnt.nxv2f64( %a, %pg, %b) ret %out } declare @llvm.aarch64.sve.cls.nxv16i8(, , ) declare @llvm.aarch64.sve.cls.nxv8i16(, , ) declare @llvm.aarch64.sve.cls.nxv4i32(, , ) declare @llvm.aarch64.sve.cls.nxv2i64(, , ) declare @llvm.aarch64.sve.clz.nxv16i8(, , ) declare @llvm.aarch64.sve.clz.nxv8i16(, , ) declare @llvm.aarch64.sve.clz.nxv4i32(, , ) declare @llvm.aarch64.sve.clz.nxv2i64(, , ) declare @llvm.aarch64.sve.cnt.nxv16i8(, , ) declare @llvm.aarch64.sve.cnt.nxv8i16(, , ) declare @llvm.aarch64.sve.cnt.nxv4i32(, , ) declare @llvm.aarch64.sve.cnt.nxv2i64(, , ) declare @llvm.aarch64.sve.cnt.nxv8f16(, , ) declare @llvm.aarch64.sve.cnt.nxv8bf16(, , ) declare @llvm.aarch64.sve.cnt.nxv4f32(, , ) declare @llvm.aarch64.sve.cnt.nxv2f64(, , ) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }