; 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 ; ; DUP ; define @dup_i8( %a, %pg, i8 %b) { ; CHECK-LABEL: dup_i8: ; CHECK: mov z0.b, p0/m, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv16i8( %a, %pg, i8 %b) ret %out } define @dup_i16( %a, %pg, i16 %b) { ; CHECK-LABEL: dup_i16: ; CHECK: mov z0.h, p0/m, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8i16( %a, %pg, i16 %b) ret %out } define @dup_i32( %a, %pg, i32 %b) { ; CHECK-LABEL: dup_i32: ; CHECK: mov z0.s, p0/m, w0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv4i32( %a, %pg, i32 %b) ret %out } define @dup_i64( %a, %pg, i64 %b) { ; CHECK-LABEL: dup_i64: ; CHECK: mov z0.d, p0/m, x0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv2i64( %a, %pg, i64 %b) ret %out } define @dup_f16( %a, %pg, half %b) { ; CHECK-LABEL: dup_f16: ; CHECK: mov z0.h, p0/m, h1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8f16( %a, %pg, half %b) ret %out } define @dup_bf16( %a, %pg, bfloat %b) #0 { ; CHECK-LABEL: dup_bf16: ; CHECK: mov z0.h, p0/m, h1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8bf16( %a, %pg, bfloat %b) ret %out } define @dup_f32( %a, %pg, float %b) { ; CHECK-LABEL: dup_f32: ; CHECK: mov z0.s, p0/m, s1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv4f32( %a, %pg, float %b) ret %out } define @dup_f64( %a, %pg, double %b) { ; CHECK-LABEL: dup_f64: ; CHECK: mov z0.d, p0/m, d1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv2f64( %a, %pg, double %b) ret %out } define @test_svdup_n_bf16_z( %pg, bfloat %op) #0 { ; CHECK-LABEL: test_svdup_n_bf16_z: ; CHECK: mov z1.h, #0 ; CHECK: mov z1.h, p0/m, h0 ; CHECK: mov z0.d, z1.d ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8bf16( zeroinitializer, %pg, bfloat %op) ret %out } define @test_svdup_n_bf16_m( %inactive, %pg, bfloat %op) #0 { ; CHECK-LABEL: test_svdup_n_bf16_m: ; CHECK: mov z0.h, p0/m, h1 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8bf16( %inactive, %pg, bfloat %op) ret %out } define @test_svdup_n_bf16_x( %pg, bfloat %op) #0 { ; CHECK-LABEL: test_svdup_n_bf16_x: ; CHECK: mov z0.h, p0/m, h0 ; CHECK-NEXT: ret %out = call @llvm.aarch64.sve.dup.nxv8bf16( undef, %pg, bfloat %op) ret %out } declare @llvm.aarch64.sve.dup.nxv16i8(, , i8) declare @llvm.aarch64.sve.dup.nxv8i16(, , i16) declare @llvm.aarch64.sve.dup.nxv4i32(, , i32) declare @llvm.aarch64.sve.dup.nxv2i64(, , i64) declare @llvm.aarch64.sve.dup.nxv8f16(, , half) declare @llvm.aarch64.sve.dup.nxv8bf16(, , bfloat) declare @llvm.aarch64.sve.dup.nxv4f32(, , float) declare @llvm.aarch64.sve.dup.nxv2f64(, , double) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }