1; RUN: llc -mattr=mul,movw < %s -march=avr | FileCheck %s
2
3define i8 @mult8(i8 %a, i8 %b) {
4; CHECK-LABEL: mult8:
5; CHECK: muls r22, r24
6; CHECK: clr r1
7; CHECK: mov  r24, r0
8  %mul = mul i8 %b, %a
9  ret i8 %mul
10}
11
12define i16 @mult16(i16 %a, i16 %b) {
13; CHECK-LABEL: mult16:
14; CHECK: muls r22, r25
15; CHECK: mov  r18, r0
16; CHECK: mul  r22, r24
17; CHECK: mov  r19, r0
18; CHECK: mov  r20, r1
19; CHECK: clr r1
20; CHECK: add  r20, r18
21; CHECK: muls r23, r24
22; CHECK: clr r1
23; CHECK: mov  r22, r0
24; CHECK: add  r22, r20
25; :TODO: finish after reworking shift instructions
26  %mul = mul nsw i16 %b, %a
27  ret i16 %mul
28}
29