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