1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
8 define <vscale x 16 x i8> @dup_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, i8 %b) {
11 ; CHECK-NEXT: mov z0.b, p0/m, w0
13 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.nxv16i8(<vscale x 16 x i8> %a,
14 <vscale x 16 x i1> %pg,
16 ret <vscale x 16 x i8> %out
19 define <vscale x 8 x i16> @dup_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, i16 %b) {
20 ; CHECK-LABEL: dup_i16:
22 ; CHECK-NEXT: mov z0.h, p0/m, w0
24 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.nxv8i16(<vscale x 8 x i16> %a,
25 <vscale x 8 x i1> %pg,
27 ret <vscale x 8 x i16> %out
30 define <vscale x 4 x i32> @dup_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, i32 %b) {
31 ; CHECK-LABEL: dup_i32:
33 ; CHECK-NEXT: mov z0.s, p0/m, w0
35 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.nxv4i32(<vscale x 4 x i32> %a,
36 <vscale x 4 x i1> %pg,
38 ret <vscale x 4 x i32> %out
41 define <vscale x 2 x i64> @dup_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, i64 %b) {
42 ; CHECK-LABEL: dup_i64:
44 ; CHECK-NEXT: mov z0.d, p0/m, x0
46 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.nxv2i64(<vscale x 2 x i64> %a,
47 <vscale x 2 x i1> %pg,
49 ret <vscale x 2 x i64> %out
52 define <vscale x 8 x half> @dup_f16(<vscale x 8 x half> %a, <vscale x 8 x i1> %pg, half %b) {
53 ; CHECK-LABEL: dup_f16:
55 ; CHECK-NEXT: mov z0.h, p0/m, h1
57 %out = call <vscale x 8 x half> @llvm.aarch64.sve.dup.nxv8f16(<vscale x 8 x half> %a,
58 <vscale x 8 x i1> %pg,
60 ret <vscale x 8 x half> %out
63 define <vscale x 8 x bfloat> @dup_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x i1> %pg, bfloat %b) #0 {
64 ; CHECK-LABEL: dup_bf16:
66 ; CHECK-NEXT: mov z0.h, p0/m, h1
68 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat> %a,
69 <vscale x 8 x i1> %pg,
71 ret <vscale x 8 x bfloat> %out
74 define <vscale x 4 x float> @dup_f32(<vscale x 4 x float> %a, <vscale x 4 x i1> %pg, float %b) {
75 ; CHECK-LABEL: dup_f32:
77 ; CHECK-NEXT: mov z0.s, p0/m, s1
79 %out = call <vscale x 4 x float> @llvm.aarch64.sve.dup.nxv4f32(<vscale x 4 x float> %a,
80 <vscale x 4 x i1> %pg,
82 ret <vscale x 4 x float> %out
85 define <vscale x 2 x double> @dup_f64(<vscale x 2 x double> %a, <vscale x 2 x i1> %pg, double %b) {
86 ; CHECK-LABEL: dup_f64:
88 ; CHECK-NEXT: mov z0.d, p0/m, d1
90 %out = call <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double> %a,
91 <vscale x 2 x i1> %pg,
93 ret <vscale x 2 x double> %out
96 define <vscale x 8 x bfloat> @test_svdup_n_bf16_z(<vscale x 8 x i1> %pg, bfloat %op) #0 {
97 ; CHECK-LABEL: test_svdup_n_bf16_z:
99 ; CHECK-NEXT: mov z1.h, #0 // =0x0
100 ; CHECK-NEXT: mov z1.h, p0/m, h0
101 ; CHECK-NEXT: mov z0.d, z1.d
103 %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)
104 ret <vscale x 8 x bfloat> %out
107 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 {
108 ; CHECK-LABEL: test_svdup_n_bf16_m:
110 ; CHECK-NEXT: mov z0.h, p0/m, h1
112 %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)
113 ret <vscale x 8 x bfloat> %out
117 define <vscale x 8 x bfloat> @test_svdup_n_bf16_x(<vscale x 8 x i1> %pg, bfloat %op) #0 {
118 ; CHECK-LABEL: test_svdup_n_bf16_x:
120 ; CHECK-NEXT: mov z0.h, p0/m, h0
122 %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)
123 ret <vscale x 8 x bfloat> %out
126 declare <vscale x 16 x i8> @llvm.aarch64.sve.dup.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, i8)
127 declare <vscale x 8 x i16> @llvm.aarch64.sve.dup.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, i16)
128 declare <vscale x 4 x i32> @llvm.aarch64.sve.dup.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, i32)
129 declare <vscale x 2 x i64> @llvm.aarch64.sve.dup.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, i64)
130 declare <vscale x 8 x half> @llvm.aarch64.sve.dup.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, half)
131 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.dup.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x i1>, bfloat)
132 declare <vscale x 4 x float> @llvm.aarch64.sve.dup.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, float)
133 declare <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, double)
135 ; +bf16 is required for the bfloat version.
136 attributes #0 = { "target-features"="+sve,+bf16" }