1 ; RUN: llc < %s -march=avr | FileCheck %s
6 define i8 @rol8(i8 %val, i8 %amt) {
10 ; CHECK-NEXT: brmi .LBB0_2
12 ; CHECK-NEXT: .LBB0_1:
14 ; CHECK-NEXT: adc r24, r1
16 ; CHECK-NEXT: brpl .LBB0_1
18 ; CHECK-NEXT: .LBB0_2:
20 %mod = urem i8 %amt, 8
23 %parta = shl i8 %val, %mod
24 %partb = lshr i8 %val, %inv
26 %rotl = or i8 %parta, %partb
33 define i8 @ror8(i8 %val, i8 %amt) {
37 ; CHECK-NEXT: brmi .LBB1_2
39 ; CHECK-NEXT: .LBB1_1:
40 ; CHECK-NEXT: bst r24, 0
42 ; CHECK-NEXT: bld r24, 7
44 ; CHECK-NEXT: brpl .LBB1_1
46 ; CHECK-NEXT: .LBB1_2:
48 %mod = urem i8 %amt, 8
51 %parta = lshr i8 %val, %mod
52 %partb = shl i8 %val, %inv
54 %rotr = or i8 %parta, %partb