1 ; RUN: llc -mattr=avr6 < %s -march=avr | FileCheck %s
3 define i1 @signed_multiplication_did_overflow(i8, i8) unnamed_addr {
4 ; CHECK-LABEL: signed_multiplication_did_overflow:
6 %2 = tail call { i8, i1 } @llvm.smul.with.overflow.i8(i8 %0, i8 %1)
7 %3 = extractvalue { i8, i1 } %2, 1
10 ; Multiply, fill the low byte with the sign of the low byte via
11 ; arithmetic shifting, compare it to the high byte.
13 ; CHECK: muls r24, r22
14 ; CHECK: mov [[HIGH:r[0-9]+]], r1
15 ; CHECK: mov [[LOW:r[0-9]+]], r0
16 ; CHECK: lsl {{.*}}[[LOW]]
17 ; CHECK: sbc {{.*}}[[LOW]], {{.*}}[[LOW]]
18 ; CHECK: ldi [[RET:r[0-9]+]], 1
19 ; CHECK: cp {{.*}}[[HIGH]], {{.*}}[[LOW]]
20 ; CHECK: brne [[LABEL:.LBB[_0-9]+]]
21 ; CHECK: mov {{.*}}[[RET]], r1
22 ; CHECK: {{.*}}[[LABEL]]
26 declare { i8, i1 } @llvm.smul.with.overflow.i8(i8, i8)