blob: fc9e6bab48cb97297d13f19b209306de29cb25c3 [file] [log] [blame]
Edward O'Callaghanc5a7ee52009-11-22 15:18:27 +00001; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
David Goodwine5671072009-06-26 18:10:30 +00002
3define i32 @f1(i32 %a, i32 %b, i32 %c) {
4 %tmp1 = mul i32 %a, %b
5 %tmp2 = sub i32 %c, %tmp1
6 ret i32 %tmp2
7}
Edward O'Callaghanc5a7ee52009-11-22 15:18:27 +00008; CHECK: f1:
9; CHECK: mls r0, r0, r1, r2
David Goodwine5671072009-06-26 18:10:30 +000010
11; sub doesn't commute, so no mls for this one
12define i32 @f2(i32 %a, i32 %b, i32 %c) {
13 %tmp1 = mul i32 %a, %b
14 %tmp2 = sub i32 %tmp1, %c
15 ret i32 %tmp2
16}
Edward O'Callaghanc5a7ee52009-11-22 15:18:27 +000017; CHECK: f2:
18; CHECK: muls r0, r1
19