1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s
4 define i32 @func(i32 %x, i32 %y) nounwind {
7 ; CHECK-NEXT: umull x8, w0, w1
8 ; CHECK-NEXT: lsr x9, x8, #32
9 ; CHECK-NEXT: extr w0, w9, w8, #2
11 %tmp = call i32 @llvm.umul.fix.i32(i32 %x, i32 %y, i32 2)
15 define i64 @func2(i64 %x, i64 %y) nounwind {
18 ; CHECK-NEXT: mul x8, x0, x1
19 ; CHECK-NEXT: umulh x9, x0, x1
20 ; CHECK-NEXT: extr x0, x9, x8, #2
22 %tmp = call i64 @llvm.umul.fix.i64(i64 %x, i64 %y, i32 2)
26 define i4 @func3(i4 %x, i4 %y) nounwind {
29 ; CHECK-NEXT: and w8, w1, #0xf
30 ; CHECK-NEXT: and w9, w0, #0xf
31 ; CHECK-NEXT: mul w8, w9, w8
32 ; CHECK-NEXT: lsr w0, w8, #2
34 %tmp = call i4 @llvm.umul.fix.i4(i4 %x, i4 %y, i32 2)
38 ;; These result in regular integer multiplication
39 define i32 @func4(i32 %x, i32 %y) nounwind {
42 ; CHECK-NEXT: mul w0, w0, w1
44 %tmp = call i32 @llvm.umul.fix.i32(i32 %x, i32 %y, i32 0)
48 define i64 @func5(i64 %x, i64 %y) nounwind {
51 ; CHECK-NEXT: mul x0, x0, x1
53 %tmp = call i64 @llvm.umul.fix.i64(i64 %x, i64 %y, i32 0)
57 define i4 @func6(i4 %x, i4 %y) nounwind {
60 ; CHECK-NEXT: and w8, w1, #0xf
61 ; CHECK-NEXT: and w9, w0, #0xf
62 ; CHECK-NEXT: mul w0, w9, w8
64 %tmp = call i4 @llvm.umul.fix.i4(i4 %x, i4 %y, i32 0)
68 define i64 @func7(i64 %x, i64 %y) nounwind {
71 ; CHECK-NEXT: mul x8, x0, x1
72 ; CHECK-NEXT: umulh x9, x0, x1
73 ; CHECK-NEXT: extr x0, x9, x8, #32
75 %tmp = call i64 @llvm.umul.fix.i64(i64 %x, i64 %y, i32 32)
79 define i64 @func8(i64 %x, i64 %y) nounwind {
82 ; CHECK-NEXT: mul x8, x0, x1
83 ; CHECK-NEXT: umulh x9, x0, x1
84 ; CHECK-NEXT: extr x0, x9, x8, #63
86 %tmp = call i64 @llvm.umul.fix.i64(i64 %x, i64 %y, i32 63)
90 define i64 @func9(i64 %x, i64 %y) nounwind {
93 ; CHECK-NEXT: umulh x0, x0, x1
95 %tmp = call i64 @llvm.umul.fix.i64(i64 %x, i64 %y, i32 64)
99 define <2 x i32> @vec(<2 x i32> %x, <2 x i32> %y) nounwind {
102 ; CHECK-NEXT: mul v0.2s, v0.2s, v1.2s
104 %tmp = call <2 x i32> @llvm.umul.fix.v2i32(<2 x i32> %x, <2 x i32> %y, i32 0)
108 define <4 x i32> @vec2(<4 x i32> %x, <4 x i32> %y) nounwind {
111 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
113 %tmp = call <4 x i32> @llvm.umul.fix.v4i32(<4 x i32> %x, <4 x i32> %y, i32 0)
117 define <4 x i64> @vec3(<4 x i64> %x, <4 x i64> %y) nounwind {
120 ; CHECK-NEXT: mov x8, v2.d[1]
121 ; CHECK-NEXT: mov x9, v0.d[1]
122 ; CHECK-NEXT: fmov x10, d2
123 ; CHECK-NEXT: fmov x11, d0
124 ; CHECK-NEXT: mov x14, v3.d[1]
125 ; CHECK-NEXT: mov x15, v1.d[1]
126 ; CHECK-NEXT: mul x12, x11, x10
127 ; CHECK-NEXT: mul x13, x9, x8
128 ; CHECK-NEXT: umulh x8, x9, x8
129 ; CHECK-NEXT: umulh x9, x11, x10
130 ; CHECK-NEXT: fmov x10, d3
131 ; CHECK-NEXT: fmov x11, d1
132 ; CHECK-NEXT: mul x16, x11, x10
133 ; CHECK-NEXT: extr x8, x8, x13, #32
134 ; CHECK-NEXT: umulh x10, x11, x10
135 ; CHECK-NEXT: extr x9, x9, x12, #32
136 ; CHECK-NEXT: mul x11, x15, x14
137 ; CHECK-NEXT: fmov d0, x9
138 ; CHECK-NEXT: umulh x14, x15, x14
139 ; CHECK-NEXT: extr x10, x10, x16, #32
140 ; CHECK-NEXT: mov v0.d[1], x8
141 ; CHECK-NEXT: fmov d1, x10
142 ; CHECK-NEXT: extr x11, x14, x11, #32
143 ; CHECK-NEXT: mov v1.d[1], x11
145 %tmp = call <4 x i64> @llvm.umul.fix.v4i64(<4 x i64> %x, <4 x i64> %y, i32 32)