1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
7 define <vscale x 16 x i8> @dup_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, i8 %b) {
9 ; CHECK: mov z0.b, p0/m, w0
11 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.nxv16i8(<vscale x 16 x i8> %a,
12 <vscale x 16 x i1> %pg,
14 ret <vscale x 16 x i8> %out
17 define <vscale x 8 x i16> @dup_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, i16 %b) {
18 ; CHECK-LABEL: dup_i16:
19 ; CHECK: mov z0.h, p0/m, w0
21 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.nxv8i16(<vscale x 8 x i16> %a,
22 <vscale x 8 x i1> %pg,
24 ret <vscale x 8 x i16> %out
27 define <vscale x 4 x i32> @dup_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, i32 %b) {
28 ; CHECK-LABEL: dup_i32:
29 ; CHECK: mov z0.s, p0/m, w0
31 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.nxv4i32(<vscale x 4 x i32> %a,
32 <vscale x 4 x i1> %pg,
34 ret <vscale x 4 x i32> %out
37 define <vscale x 2 x i64> @dup_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, i64 %b) {
38 ; CHECK-LABEL: dup_i64:
39 ; CHECK: mov z0.d, p0/m, x0
41 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.nxv2i64(<vscale x 2 x i64> %a,
42 <vscale x 2 x i1> %pg,
44 ret <vscale x 2 x i64> %out
47 define <vscale x 8 x half> @dup_f16(<vscale x 8 x half> %a, <vscale x 8 x i1> %pg, half %b) {
48 ; CHECK-LABEL: dup_f16:
49 ; CHECK: mov z0.h, p0/m, h1
51 %out = call <vscale x 8 x half> @llvm.aarch64.sve.dup.nxv8f16(<vscale x 8 x half> %a,
52 <vscale x 8 x i1> %pg,
54 ret <vscale x 8 x half> %out
57 define <vscale x 8 x bfloat> @dup_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x i1> %pg, bfloat %b) #0 {
58 ; CHECK-LABEL: dup_bf16:
59 ; CHECK: mov z0.h, p0/m, h1
61 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat> %a,
62 <vscale x 8 x i1> %pg,
64 ret <vscale x 8 x bfloat> %out
67 define <vscale x 4 x float> @dup_f32(<vscale x 4 x float> %a, <vscale x 4 x i1> %pg, float %b) {
68 ; CHECK-LABEL: dup_f32:
69 ; CHECK: mov z0.s, p0/m, s1
71 %out = call <vscale x 4 x float> @llvm.aarch64.sve.dup.nxv4f32(<vscale x 4 x float> %a,
72 <vscale x 4 x i1> %pg,
74 ret <vscale x 4 x float> %out
77 define <vscale x 2 x double> @dup_f64(<vscale x 2 x double> %a, <vscale x 2 x i1> %pg, double %b) {
78 ; CHECK-LABEL: dup_f64:
79 ; CHECK: mov z0.d, p0/m, d1
81 %out = call <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double> %a,
82 <vscale x 2 x i1> %pg,
84 ret <vscale x 2 x double> %out
87 define <vscale x 8 x bfloat> @test_svdup_n_bf16_z(<vscale x 8 x i1> %pg, bfloat %op) #0 {
88 ; CHECK-LABEL: test_svdup_n_bf16_z:
90 ; CHECK: mov z1.h, p0/m, h0
91 ; CHECK: mov z0.d, z1.d
93 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat> zeroinitializer, <vscale x 8 x i1> %pg, bfloat %op)
94 ret <vscale x 8 x bfloat> %out
97 define <vscale x 8 x bfloat> @test_svdup_n_bf16_m(<vscale x 8 x bfloat> %inactive, <vscale x 8 x i1> %pg, bfloat %op) #0 {
98 ; CHECK-LABEL: test_svdup_n_bf16_m:
99 ; CHECK: mov z0.h, p0/m, h1
101 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat> %inactive, <vscale x 8 x i1> %pg, bfloat %op)
102 ret <vscale x 8 x bfloat> %out
106 define <vscale x 8 x bfloat> @test_svdup_n_bf16_x(<vscale x 8 x i1> %pg, bfloat %op) #0 {
107 ; CHECK-LABEL: test_svdup_n_bf16_x:
108 ; CHECK: mov z0.h, p0/m, h0
110 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat> undef, <vscale x 8 x i1> %pg, bfloat %op)
111 ret <vscale x 8 x bfloat> %out
114 declare <vscale x 16 x i8> @llvm.aarch64.sve.dup.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, i8)
115 declare <vscale x 8 x i16> @llvm.aarch64.sve.dup.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, i16)
116 declare <vscale x 4 x i32> @llvm.aarch64.sve.dup.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, i32)
117 declare <vscale x 2 x i64> @llvm.aarch64.sve.dup.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, i64)
118 declare <vscale x 8 x half> @llvm.aarch64.sve.dup.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, half)
119 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x i1>, bfloat)
120 declare <vscale x 4 x float> @llvm.aarch64.sve.dup.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, float)
121 declare <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, double)
123 ; +bf16 is required for the bfloat version.
124 attributes #0 = { "target-features"="+sve,+bf16" }