blob: e4a00e9ac303d5225ad56c530315e00e600331ce [file] [log] [blame]
Arnold Schwaighofer67514e92012-09-04 14:37:49 +00001; RUN: llc < %s -march=arm | FileCheck %s
2; Check generated signed and unsigned multiply accumulate long.
3
4define i64 @MACLongTest1(i32 %a, i32 %b, i64 %c) {
5;CHECK: MACLongTest1:
6;CHECK: umlal
7 %conv = zext i32 %a to i64
8 %conv1 = zext i32 %b to i64
9 %mul = mul i64 %conv1, %conv
10 %add = add i64 %mul, %c
11 ret i64 %add
12}
13
14define i64 @MACLongTest2(i32 %a, i32 %b, i64 %c) {
15;CHECK: MACLongTest2:
16;CHECK: smlal
17 %conv = sext i32 %a to i64
18 %conv1 = sext i32 %b to i64
19 %mul = mul nsw i64 %conv1, %conv
20 %add = add nsw i64 %mul, %c
21 ret i64 %add
22}
23
24define i64 @MACLongTest3(i32 %a, i32 %b, i32 %c) {
25;CHECK: MACLongTest3:
26;CHECK: umlal
27 %conv = zext i32 %b to i64
28 %conv1 = zext i32 %a to i64
29 %mul = mul i64 %conv, %conv1
30 %conv2 = zext i32 %c to i64
31 %add = add i64 %mul, %conv2
32 ret i64 %add
33}
34
35define i64 @MACLongTest4(i32 %a, i32 %b, i32 %c) {
36;CHECK: MACLongTest4:
37;CHECK: smlal
38 %conv = sext i32 %b to i64
39 %conv1 = sext i32 %a to i64
40 %mul = mul nsw i64 %conv, %conv1
41 %conv2 = sext i32 %c to i64
42 %add = add nsw i64 %mul, %conv2
43 ret i64 %add
44}