1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -aarch64-sve-vector-bits-min=512 -aarch64-sve-vector-bits-max=512 < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
6 define void @add_v64i8(ptr %a, ptr %b) #0 {
7 ; CHECK-LABEL: add_v64i8:
9 ; CHECK-NEXT: ptrue p0.b
10 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
11 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
12 ; CHECK-NEXT: add z0.b, z0.b, z1.b
13 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
15 %op1 = load <64 x i8>, ptr %a
16 %op2 = load <64 x i8>, ptr %b
17 %res = add <64 x i8> %op1, %op2
18 store <64 x i8> %res, ptr %a
22 define void @add_v32i16(ptr %a, ptr %b, ptr %c) #0 {
23 ; CHECK-LABEL: add_v32i16:
25 ; CHECK-NEXT: ptrue p0.h
26 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
27 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
28 ; CHECK-NEXT: add z0.h, z0.h, z1.h
29 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
31 %op1 = load <32 x i16>, ptr %a
32 %op2 = load <32 x i16>, ptr %b
33 %res = add <32 x i16> %op1, %op2
34 store <32 x i16> %res, ptr %a
38 define void @abs_v16i32(ptr %a) #0 {
39 ; CHECK-LABEL: abs_v16i32:
41 ; CHECK-NEXT: ptrue p0.s
42 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
43 ; CHECK-NEXT: abs z0.s, p0/m, z0.s
44 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
46 %op1 = load <16 x i32>, ptr %a
47 %res = call <16 x i32> @llvm.abs.v16i32(<16 x i32> %op1, i1 false)
48 store <16 x i32> %res, ptr %a
52 define void @abs_v8i64(ptr %a) #0 {
53 ; CHECK-LABEL: abs_v8i64:
55 ; CHECK-NEXT: ptrue p0.d
56 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
57 ; CHECK-NEXT: abs z0.d, p0/m, z0.d
58 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
60 %op1 = load <8 x i64>, ptr %a
61 %res = call <8 x i64> @llvm.abs.v8i64(<8 x i64> %op1, i1 false)
62 store <8 x i64> %res, ptr %a
66 define void @fadd_v32f16(ptr %a, ptr %b) #0 {
67 ; CHECK-LABEL: fadd_v32f16:
69 ; CHECK-NEXT: ptrue p0.h
70 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
71 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
72 ; CHECK-NEXT: fadd z0.h, z0.h, z1.h
73 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
75 %op1 = load <32 x half>, ptr %a
76 %op2 = load <32 x half>, ptr %b
77 %res = fadd <32 x half> %op1, %op2
78 store <32 x half> %res, ptr %a
82 define void @fadd_v16f32(ptr %a, ptr %b) #0 {
83 ; CHECK-LABEL: fadd_v16f32:
85 ; CHECK-NEXT: ptrue p0.s
86 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
87 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
88 ; CHECK-NEXT: fadd z0.s, z0.s, z1.s
89 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
91 %op1 = load <16 x float>, ptr %a
92 %op2 = load <16 x float>, ptr %b
93 %res = fadd <16 x float> %op1, %op2
94 store <16 x float> %res, ptr %a
98 define void @fadd_v8f64(ptr %a, ptr %b) #0 {
99 ; CHECK-LABEL: fadd_v8f64:
101 ; CHECK-NEXT: ptrue p0.d
102 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
103 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
104 ; CHECK-NEXT: fadd z0.d, z0.d, z1.d
105 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
107 %op1 = load <8 x double>, ptr %a
108 %op2 = load <8 x double>, ptr %b
109 %res = fadd <8 x double> %op1, %op2
110 store <8 x double> %res, ptr %a
114 declare <16 x i32> @llvm.abs.v16i32(<16 x i32>, i1)
115 declare <8 x i64> @llvm.abs.v8i64(<8 x i64>, i1)
117 attributes #0 = { "target-features"="+sve" }