1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mattr=mul,movw < %s -mtriple=avr | FileCheck %s
4 ; Tests lowering of multiplication to hardware instructions.
6 define i8 @mult8(i8 %a, i8 %b) {
9 ; CHECK-NEXT: muls r22, r24
11 ; CHECK-NEXT: mov r24, r0
17 define i16 @mult16(i16 %a, i16 %b) {
18 ; CHECK-LABEL: mult16:
20 ; CHECK-NEXT: muls r22, r25
21 ; CHECK-NEXT: mov r25, r0
23 ; CHECK-NEXT: mul r22, r24
24 ; CHECK-NEXT: mov r20, r0
25 ; CHECK-NEXT: mov r18, r1
27 ; CHECK-NEXT: add r18, r25
28 ; CHECK-NEXT: muls r23, r24
30 ; CHECK-NEXT: add r18, r0
31 ; CHECK-NEXT: mov r19, r18
33 ; CHECK-NEXT: mov r24, r20
35 ; CHECK-NEXT: or r24, r18
36 ; CHECK-NEXT: or r25, r19
38 %mul = mul nsw i16 %b, %a