; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -mattr=+use-experimental-zeroing-pseudos < %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_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_i8_zero: ; CHECK: movprfx z0.b, p0/z, z0.b ; CHECK-NEXT: asr z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.nxv16i8( %pg, %a_z, %b) ret %out } define @asr_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_i16_zero: ; CHECK: movprfx z0.h, p0/z, z0.h ; CHECK-NEXT: asr z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.nxv8i16( %pg, %a_z, %b) ret %out } define @asr_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_i32_zero: ; CHECK: movprfx z0.s, p0/z, z0.s ; CHECK-NEXT: asr z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.nxv4i32( %pg, %a_z, %b) ret %out } define @asr_i64_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_i64_zero: ; CHECK: movprfx z0.d, p0/z, z0.d ; CHECK-NEXT: asr z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.nxv2i64( %pg, %a_z, %b) ret %out } define @asr_wide_i8_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i8_zero: ; CHECK-NOT: movprfx ; CHECK: asr z0.b, p0/m, z0.b, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.wide.nxv16i8( %pg, %a_z, %b) ret %out } define @asr_wide_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i16_zero: ; CHECK-NOT: movprfx ; CHECK: asr z0.h, p0/m, z0.h, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.wide.nxv8i16( %pg, %a_z, %b) ret %out } define @asr_wide_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: asr_wide_i32_zero: ; CHECK-NOT: movprfx ; CHECK: asr z0.s, p0/m, z0.s, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asr.wide.nxv4i32( %pg, %a_z, %b) ret %out } ; ; ASRD ; define @asrd_i8_zero( %pg, %a) { ; CHECK-LABEL: asrd_i8_zero: ; CHECK: movprfx z0.b, p0/z, z0.b ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #1 ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asrd.nxv16i8( %pg, %a_z, i32 1) ret %out } define @asrd_i16_zero( %pg, %a) { ; CHECK-LABEL: asrd_i16_zero: ; CHECK: movprfx z0.h, p0/z, z0.h ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #2 ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asrd.nxv8i16( %pg, %a_z, i32 2) ret %out } define @asrd_i32_zero( %pg, %a) { ; CHECK-LABEL: asrd_i32_zero: ; CHECK: movprfx z0.s, p0/z, z0.s ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #31 ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asrd.nxv4i32( %pg, %a_z, i32 31) ret %out } define @asrd_i64_zero( %pg, %a) { ; CHECK-LABEL: asrd_i64_zero: ; CHECK: movprfx z0.d, p0/z, z0.d ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #64 ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.asrd.nxv2i64( %pg, %a_z, i32 64) ret %out } ; ; LSL ; define @lsl_i8_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_i8_zero: ; CHECK: movprfx z0.b, p0/z, z0.b ; CHECK-NEXT: lsl z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.nxv16i8( %pg, %a_z, %b) ret %out } define @lsl_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_i16_zero: ; CHECK: movprfx z0.h, p0/z, z0.h ; CHECK-NEXT: lsl z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.nxv8i16( %pg, %a_z, %b) ret %out } define @lsl_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_i32_zero: ; CHECK: movprfx z0.s, p0/z, z0.s ; CHECK-NEXT: lsl z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.nxv4i32( %pg, %a_z, %b) ret %out } define @lsl_i64_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_i64_zero: ; CHECK: movprfx z0.d, p0/z, z0.d ; CHECK-NEXT: lsl z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.nxv2i64( %pg, %a_z, %b) ret %out } define @lsl_wide_i8_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i8_zero: ; CHECK-NOT: movprfx ; CHECK: lsl z0.b, p0/m, z0.b, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.wide.nxv16i8( %pg, %a_z, %b) ret %out } define @lsl_wide_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i16_zero: ; CHECK-NOT: movprfx ; CHECK: lsl z0.h, p0/m, z0.h, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.wide.nxv8i16( %pg, %a_z, %b) ret %out } define @lsl_wide_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: lsl_wide_i32_zero: ; CHECK-NOT: movprfx ; CHECK: lsl z0.s, p0/m, z0.s, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsl.wide.nxv4i32( %pg, %a_z, %b) ret %out } ; ; LSR ; define @lsr_i8_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_i8_zero: ; CHECK: movprfx z0.b, p0/z, z0.b ; CHECK-NEXT: lsr z0.b, p0/m, z0.b, z1.b ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.nxv16i8( %pg, %a_z, %b) ret %out } define @lsr_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_i16_zero: ; CHECK: movprfx z0.h, p0/z, z0.h ; CHECK-NEXT: lsr z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.nxv8i16( %pg, %a_z, %b) ret %out } define @lsr_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_i32_zero: ; CHECK: movprfx z0.s, p0/z, z0.s ; CHECK-NEXT: lsr z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.nxv4i32( %pg, %a_z, %b) ret %out } define @lsr_i64_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_i64_zero: ; CHECK: movprfx z0.d, p0/z, z0.d ; CHECK-NEXT: lsr z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.nxv2i64( %pg, %a_z, %b) ret %out } define @lsr_wide_i8_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i8_zero: ; CHECK-NOT: movprfx ; CHECK: lsr z0.b, p0/m, z0.b, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.wide.nxv16i8( %pg, %a_z, %b) ret %out } define @lsr_wide_i16_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i16_zero: ; CHECK-NOT: movprfx ; CHECK: lsr z0.h, p0/m, z0.h, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.wide.nxv8i16( %pg, %a_z, %b) ret %out } define @lsr_wide_i32_zero( %pg, %a, %b) { ; CHECK-LABEL: lsr_wide_i32_zero: ; CHECK-NOT: movprfx ; CHECK: lsr z0.s, p0/m, z0.s, z1.d %a_z = select %pg, %a, zeroinitializer %out = call @llvm.aarch64.sve.lsr.wide.nxv4i32( %pg, %a_z, %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.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(, , )