; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple aarch64-none-linux-gnu -mattr=+sve | FileCheck %s define @dupsext_v2i8_v2i16(i8 %src, %b) { ; CHECK-LABEL: dupsext_v2i8_v2i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxtb w8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v4i8_v4i16(i8 %src, %b) { ; CHECK-LABEL: dupsext_v4i8_v4i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxtb w8, w0 ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = sext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v8i8_v8i16(i8 %src, %b) { ; CHECK-LABEL: dupsext_v8i8_v8i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxtb w8, w0 ; CHECK-NEXT: mov z1.h, w8 ; CHECK-NEXT: ptrue p0.h ; CHECK-NEXT: mul z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret entry: %in = sext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v2i8_v2i32(i8 %src, %b) { ; CHECK-LABEL: dupsext_v2i8_v2i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxtb w8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i8 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v4i8_v4i32(i8 %src, %b) { ; CHECK-LABEL: dupsext_v4i8_v4i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxtb w8, w0 ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = sext i8 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v2i8_v2i64(i8 %src, %b) { ; CHECK-LABEL: dupsext_v2i8_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0 ; CHECK-NEXT: sxtb x8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i8 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v2i16_v2i32(i16 %src, %b) { ; CHECK-LABEL: dupsext_v2i16_v2i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxth w8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i16 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v4i16_v4i32(i16 %src, %b) { ; CHECK-LABEL: dupsext_v4i16_v4i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: sxth w8, w0 ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = sext i16 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v2i16_v2i64(i16 %src, %b) { ; CHECK-LABEL: dupsext_v2i16_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0 ; CHECK-NEXT: sxth x8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i16 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupsext_v2i32_v2i64(i32 %src, %b) { ; CHECK-LABEL: dupsext_v2i32_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0 ; CHECK-NEXT: sxtw x8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = sext i32 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nsw %broadcast.splat, %b ret %out } define @dupzext_v2i8_v2i16(i8 %src, %b) { ; CHECK-LABEL: dupzext_v2i8_v2i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xff ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v4i8_v4i16(i8 %src, %b) { ; CHECK-LABEL: dupzext_v4i8_v4i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xff ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = zext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v8i8_v8i16(i8 %src, %b) { ; CHECK-LABEL: dupzext_v8i8_v8i16: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xff ; CHECK-NEXT: mov z1.h, w8 ; CHECK-NEXT: ptrue p0.h ; CHECK-NEXT: mul z0.h, p0/m, z0.h, z1.h ; CHECK-NEXT: ret entry: %in = zext i8 %src to i16 %broadcast.splatinsert = insertelement undef, i16 %in, i16 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v2i8_v2i32(i8 %src, %b) { ; CHECK-LABEL: dupzext_v2i8_v2i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xff ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i8 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v4i8_v4i32(i8 %src, %b) { ; CHECK-LABEL: dupzext_v4i8_v4i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xff ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = zext i8 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v2i8_v2i64(i8 %src, %b) { ; CHECK-LABEL: dupzext_v2i8_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0 ; CHECK-NEXT: and x8, x0, #0xff ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i8 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v2i16_v2i32(i16 %src, %b) { ; CHECK-LABEL: dupzext_v2i16_v2i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xffff ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i16 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v4i16_v4i32(i16 %src, %b) { ; CHECK-LABEL: dupzext_v4i16_v4i32: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: and w8, w0, #0xffff ; CHECK-NEXT: mov z1.s, w8 ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s ; CHECK-NEXT: ret entry: %in = zext i16 %src to i32 %broadcast.splatinsert = insertelement undef, i32 %in, i32 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v2i16_v2i64(i16 %src, %b) { ; CHECK-LABEL: dupzext_v2i16_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0 ; CHECK-NEXT: and x8, x0, #0xffff ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i16 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out } define @dupzext_v2i32_v2i64(i32 %src, %b) { ; CHECK-LABEL: dupzext_v2i32_v2i64: ; CHECK: // %bb.0: // %entry ; CHECK-NEXT: mov w8, w0 ; CHECK-NEXT: mov z1.d, x8 ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d ; CHECK-NEXT: ret entry: %in = zext i32 %src to i64 %broadcast.splatinsert = insertelement undef, i64 %in, i64 0 %broadcast.splat = shufflevector %broadcast.splatinsert, undef, zeroinitializer %out = mul nuw %broadcast.splat, %b ret %out }