1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+sve | FileCheck %s
4 define <2 x i64> @test_mul_add_2x64(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
5 ; CHECK-LABEL: test_mul_add_2x64:
7 ; CHECK-NEXT: ptrue p0.d, vl2
8 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
9 ; CHECK-NEXT: // kill: def $q2 killed $q2 def $z2
10 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
11 ; CHECK-NEXT: mla z0.d, p0/m, z1.d, z2.d
12 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
14 %mul = mul <2 x i64> %b, %c
15 %add = add <2 x i64> %a, %mul
19 define <1 x i64> @test_mul_add_1x64(<1 x i64> %a, <1 x i64> %b, <1 x i64> %c) {
20 ; CHECK-LABEL: test_mul_add_1x64:
22 ; CHECK-NEXT: ptrue p0.d, vl1
23 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
24 ; CHECK-NEXT: // kill: def $d2 killed $d2 def $z2
25 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
26 ; CHECK-NEXT: mla z0.d, p0/m, z1.d, z2.d
27 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
29 %mul = mul <1 x i64> %b, %c
30 %add = add <1 x i64> %mul, %a
34 define <2 x i64> @test_mul_sub_2x64(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
35 ; CHECK-LABEL: test_mul_sub_2x64:
37 ; CHECK-NEXT: ptrue p0.d, vl2
38 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
39 ; CHECK-NEXT: // kill: def $q2 killed $q2 def $z2
40 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
41 ; CHECK-NEXT: mls z0.d, p0/m, z1.d, z2.d
42 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
44 %mul = mul <2 x i64> %b, %c
45 %sub = sub <2 x i64> %a, %mul
49 define <2 x i64> @test_mul_sub_2x64_2(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, <2 x i64> %d) {
50 ; CHECK-LABEL: test_mul_sub_2x64_2:
52 ; CHECK-NEXT: ptrue p0.d, vl2
53 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
54 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
55 ; CHECK-NEXT: // kill: def $q3 killed $q3 def $z3
56 ; CHECK-NEXT: // kill: def $q2 killed $q2 def $z2
57 ; CHECK-NEXT: sdiv z0.d, p0/m, z0.d, z1.d
58 ; CHECK-NEXT: movprfx z1, z2
59 ; CHECK-NEXT: mul z1.d, p0/m, z1.d, z3.d
60 ; CHECK-NEXT: sub v0.2d, v1.2d, v0.2d
62 %div = sdiv <2 x i64> %a, %b
63 %mul = mul <2 x i64> %c, %d
64 %sub = sub <2 x i64> %mul, %div
68 define <2 x i64> @test_mul_sub_2x64_3(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, <2 x i64> %d) {
69 ; CHECK-LABEL: test_mul_sub_2x64_3:
71 ; CHECK-NEXT: ptrue p0.d, vl2
72 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
73 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
74 ; CHECK-NEXT: // kill: def $q3 killed $q3 def $z3
75 ; CHECK-NEXT: // kill: def $q2 killed $q2 def $z2
76 ; CHECK-NEXT: sdiv z0.d, p0/m, z0.d, z1.d
77 ; CHECK-NEXT: mls z0.d, p0/m, z2.d, z3.d
78 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
80 %div = sdiv <2 x i64> %a, %b
81 %mul = mul <2 x i64> %c, %d
82 %sub = sub <2 x i64> %div, %mul
86 define <1 x i64> @test_mul_sub_1x64(<1 x i64> %a, <1 x i64> %b, <1 x i64> %c) {
87 ; CHECK-LABEL: test_mul_sub_1x64:
89 ; CHECK-NEXT: ptrue p0.d, vl1
90 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
91 ; CHECK-NEXT: // kill: def $d2 killed $d2 def $z2
92 ; CHECK-NEXT: mul z1.d, p0/m, z1.d, z2.d
93 ; CHECK-NEXT: sub d0, d1, d0
95 %mul = mul <1 x i64> %b, %c
96 %sub = sub <1 x i64> %mul, %a