brintos

brintos / llvm-project-archived public Read only

0
0
Text · 850 B · 4206aeb Raw
27 lines · plain
1; RUN: llc -mattr=avr6 < %s -mtriple=avr | FileCheck %s2 3define i1 @signed_multiplication_did_overflow(i8, i8) unnamed_addr {4; CHECK-LABEL: signed_multiplication_did_overflow:5entry-block:6  %2 = tail call { i8, i1 } @llvm.smul.with.overflow.i8(i8 %0, i8 %1)7  %3 = extractvalue { i8, i1 } %2, 18  ret i1 %39 10; Multiply, fill the low byte with the sign of the low byte via11; arithmetic shifting, compare it to the high byte.12;13; CHECK: muls   r24, r2214; CHECK: mov    [[HIGH:r[0-9]+]], r115; CHECK: mov    [[LOW:r[0-9]+]], r016; CHECK: lsl    {{.*}}[[LOW]]17; CHECK: sbc    {{.*}}[[LOW]], {{.*}}[[LOW]]18; CHECK: ldi    [[RET:r[0-9]+]], 119; CHECK: cp     {{.*}}[[HIGH]], {{.*}}[[LOW]]20; CHECK: brne   [[LABEL:.LBB[_0-9]+]]21; CHECK: mov    {{.*}}[[RET]], r122; CHECK: {{.*}}[[LABEL]]23; CHECK: ret24}25 26declare { i8, i1 } @llvm.smul.with.overflow.i8(i8, i8)27