1 ; RUN: llc < %s -march=avr | FileCheck %s
6 define i8 @rol8(i8 %val, i8 %amt) {
9 ; CHECK-NEXT: cpi r22, 0
10 ; CHECK-NEXT: breq LBB0_2
14 ; CHECK-NEXT: subi r22, 1
15 ; CHECK-NEXT: brne LBB0_1
19 %mod = urem i8 %amt, 8
22 %parta = shl i8 %val, %mod
23 %partb = lshr i8 %val, %inv
25 %rotl = or i8 %parta, %partb
32 define i8 @ror8(i8 %val, i8 %amt) {
35 ; CHECK-NEXT: cpi r22, 0
36 ; CHECK-NEXT: breq LBB1_2
40 ; CHECK-NEXT: subi r22, 1
41 ; CHECK-NEXT: brne LBB1_1
45 %mod = urem i8 %amt, 8
48 %parta = lshr i8 %val, %mod
49 %partb = shl i8 %val, %inv
51 %rotr = or i8 %parta, %partb