; 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 ; ; ASR ; define @asr_i8( %pg, %a, %b) { ; CHECK-LABEL: asr_i8: ; CHECK: asr z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.nxv16i8( %pg, %a, %b) ret %out } define @asr_i16( %pg, %a, %b) { ; CHECK-LABEL: asr_i16: ; CHECK: asr z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.nxv8i16( %pg, %a, %b) ret %out } define @asr_i32( %pg, %a, %b) { ; CHECK-LABEL: asr_i32: ; CHECK: asr z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.nxv4i32( %pg, %a, %b) ret %out } define @asr_i64( %pg, %a, %b) { ; CHECK-LABEL: asr_i64: ; CHECK: asr z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.nxv2i64( %pg, %a, %b) ret %out } define @asr_wide_i8( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i8: ; CHECK: asr z0.b, p0/m, z0.b, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.wide.nxv16i8( %pg, %a, %b) ret %out } define @asr_wide_i16( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i16: ; CHECK: asr z0.h, p0/m, z0.h, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.wide.nxv8i16( %pg, %a, %b) ret %out } define @asr_wide_i32( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i32: ; CHECK: asr z0.s, p0/m, z0.s, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asr.wide.nxv4i32( %pg, %a, %b) ret %out } ; ; ASRD ; define @asrd_i8( %pg, %a) { ; CHECK-LABEL: asrd_i8: ; CHECK: asrd z0.b, p0/m, z0.b, #1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asrd.nxv16i8( %pg, %a, i32 1) ret %out } define @asrd_i16( %pg, %a) { ; CHECK-LABEL: asrd_i16: ; CHECK: asrd z0.h, p0/m, z0.h, #2 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asrd.nxv8i16( %pg, %a, i32 2) ret %out } define @asrd_i32( %pg, %a) { ; CHECK-LABEL: asrd_i32: ; CHECK: asrd z0.s, p0/m, z0.s, #31 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asrd.nxv4i32( %pg, %a, i32 31) ret %out } define @asrd_i64( %pg, %a) { ; CHECK-LABEL: asrd_i64: ; CHECK: asrd z0.d, p0/m, z0.d, #64 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.asrd.nxv2i64( %pg, %a, i32 64) ret %out } ; ; INSR ; define @insr_i8( %a, i8 %b) { ; CHECK-LABEL: insr_i8: ; CHECK: insr z0.b, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv16i8( %a, i8 %b) ret %out } define @insr_i16( %a, i16 %b) { ; CHECK-LABEL: insr_i16: ; CHECK: insr z0.h, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv8i16( %a, i16 %b) ret %out } define @insr_i32( %a, i32 %b) { ; CHECK-LABEL: insr_i32: ; CHECK: insr z0.s, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv4i32( %a, i32 %b) ret %out } define @insr_i64( %a, i64 %b) { ; CHECK-LABEL: insr_i64: ; CHECK: insr z0.d, x0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv2i64( %a, i64 %b) ret %out } define @insr_f16( %a, half %b) { ; CHECK-LABEL: insr_f16: ; CHECK: insr z0.h, h1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv8f16( %a, half %b) ret %out } define @insr_bf16( %a, bfloat %b) #0 { ; CHECK-LABEL: insr_bf16: ; CHECK: insr z0.h, h1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv8bf16( %a, bfloat %b) ret %out } define @insr_f32( %a, float %b) { ; CHECK-LABEL: insr_f32: ; CHECK: insr z0.s, s1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv4f32( %a, float %b) ret %out } define @insr_f64( %a, double %b) { ; CHECK-LABEL: insr_f64: ; CHECK: insr z0.d, d1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.insr.nxv2f64( %a, double %b) ret %out } ; ; LSL ; define @lsl_i8( %pg, %a, %b) { ; CHECK-LABEL: lsl_i8: ; CHECK: lsl z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.nxv16i8( %pg, %a, %b) ret %out } define @lsl_i16( %pg, %a, %b) { ; CHECK-LABEL: lsl_i16: ; CHECK: lsl z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.nxv8i16( %pg, %a, %b) ret %out } define @lsl_i32( %pg, %a, %b) { ; CHECK-LABEL: lsl_i32: ; CHECK: lsl z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.nxv4i32( %pg, %a, %b) ret %out } define @lsl_i64( %pg, %a, %b) { ; CHECK-LABEL: lsl_i64: ; CHECK: lsl z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.nxv2i64( %pg, %a, %b) ret %out } define @lsl_wide_i8( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i8: ; CHECK: lsl z0.b, p0/m, z0.b, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.wide.nxv16i8( %pg, %a, %b) ret %out } define @lsl_wide_i16( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i16: ; CHECK: lsl z0.h, p0/m, z0.h, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.wide.nxv8i16( %pg, %a, %b) ret %out } define @lsl_wide_i32( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i32: ; CHECK: lsl z0.s, p0/m, z0.s, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsl.wide.nxv4i32( %pg, %a, %b) ret %out } ; ; LSR ; define @lsr_i8( %pg, %a, %b) { ; CHECK-LABEL: lsr_i8: ; CHECK: lsr z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.nxv16i8( %pg, %a, %b) ret %out } define @lsr_i16( %pg, %a, %b) { ; CHECK-LABEL: lsr_i16: ; CHECK: lsr z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.nxv8i16( %pg, %a, %b) ret %out } define @lsr_i32( %pg, %a, %b) { ; CHECK-LABEL: lsr_i32: ; CHECK: lsr z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.nxv4i32( %pg, %a, %b) ret %out } define @lsr_i64( %pg, %a, %b) { ; CHECK-LABEL: lsr_i64: ; CHECK: lsr z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.nxv2i64( %pg, %a, %b) ret %out } define @lsr_wide_i8( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i8: ; CHECK: lsr z0.b, p0/m, z0.b, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.wide.nxv16i8( %pg, %a, %b) ret %out } define @lsr_wide_i16( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i16: ; CHECK: lsr z0.h, p0/m, z0.h, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.wide.nxv8i16( %pg, %a, %b) ret %out } define @lsr_wide_i32( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i32: ; CHECK: lsr z0.s, p0/m, z0.s, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.lsr.wide.nxv4i32( %pg, %a, %b) ret %out } declare @llvm.aarch64.sve.asr.nxv16i8(, , ) declare @llvm.aarch64.sve.asr.nxv8i16(, , ) declare @llvm.aarch64.sve.asr.nxv4i32(, , ) declare @llvm.aarch64.sve.asr.nxv2i64(, , ) declare @llvm.aarch64.sve.asr.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.asr.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.asr.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.asrd.nxv16i8(, , i32) declare @llvm.aarch64.sve.asrd.nxv8i16(, , i32) declare @llvm.aarch64.sve.asrd.nxv4i32(, , i32) declare @llvm.aarch64.sve.asrd.nxv2i64(, , i32) declare @llvm.aarch64.sve.insr.nxv16i8(, i8) declare @llvm.aarch64.sve.insr.nxv8i16(, i16) declare @llvm.aarch64.sve.insr.nxv4i32(, i32) declare @llvm.aarch64.sve.insr.nxv2i64(, i64) declare @llvm.aarch64.sve.insr.nxv8f16(, half) declare @llvm.aarch64.sve.insr.nxv8bf16(, bfloat) declare @llvm.aarch64.sve.insr.nxv4f32(, float) declare @llvm.aarch64.sve.insr.nxv2f64(, double) declare @llvm.aarch64.sve.lsl.nxv16i8(, , ) declare @llvm.aarch64.sve.lsl.nxv8i16(, , ) declare @llvm.aarch64.sve.lsl.nxv4i32(, , ) declare @llvm.aarch64.sve.lsl.nxv2i64(, , ) declare @llvm.aarch64.sve.lsl.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.lsl.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.lsl.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.lsr.nxv16i8(, , ) declare @llvm.aarch64.sve.lsr.nxv8i16(, , ) declare @llvm.aarch64.sve.lsr.nxv4i32(, , ) declare @llvm.aarch64.sve.lsr.nxv2i64(, , ) declare @llvm.aarch64.sve.lsr.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.lsr.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.lsr.wide.nxv4i32(, , ) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }