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: asr {{.*}}[[LOW]]
17 ; CHECK: asr {{.*}}[[LOW]]
18 ; CHECK: asr {{.*}}[[LOW]]
19 ; CHECK: asr {{.*}}[[LOW]]
20 ; CHECK: asr {{.*}}[[LOW]]
21 ; CHECK: asr {{.*}}[[LOW]]
22 ; CHECK: asr {{.*}}[[LOW]]
23 ; CHECK: ldi [[RET:r[0-9]+]], 1
24 ; CHECK: cp {{.*}}[[HIGH]], {{.*}}[[LOW]]
25 ; CHECK: brne [[LABEL:LBB[_0-9]+]]
26 ; CHECK: ldi {{.*}}[[RET]], 0
27 ; CHECK: {{.*}}[[LABEL]]
31 declare { i8, i1 } @llvm.smul.with.overflow.i8(i8, i8)