1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=avr | FileCheck %s
3 ; RUN: llc < %s -mtriple=avr -mattr=+avrtiny | FileCheck --check-prefix=TINY %s
5 define i8 @rol8(i8 %val, i8 %amt) {
8 ; CHECK-NEXT: andi r22, 7
10 ; CHECK-NEXT: brmi .LBB0_2
11 ; CHECK-NEXT: .LBB0_1: ; =>This Inner Loop Header: Depth=1
13 ; CHECK-NEXT: adc r24, r1
15 ; CHECK-NEXT: brpl .LBB0_1
16 ; CHECK-NEXT: .LBB0_2:
21 ; TINY-NEXT: andi r22, 7
23 ; TINY-NEXT: brmi .LBB0_2
24 ; TINY-NEXT: .LBB0_1: ; =>This Inner Loop Header: Depth=1
26 ; TINY-NEXT: adc r24, r17
28 ; TINY-NEXT: brpl .LBB0_1
31 %mod = urem i8 %amt, 8
33 %parta = shl i8 %val, %mod
34 %partb = lshr i8 %val, %inv
35 %rotl = or i8 %parta, %partb
40 define i8 @ror8(i8 %val, i8 %amt) {
43 ; CHECK-NEXT: andi r22, 7
45 ; CHECK-NEXT: brmi .LBB1_2
46 ; CHECK-NEXT: .LBB1_1: ; =>This Inner Loop Header: Depth=1
47 ; CHECK-NEXT: bst r24, 0
49 ; CHECK-NEXT: bld r24, 7
51 ; CHECK-NEXT: brpl .LBB1_1
52 ; CHECK-NEXT: .LBB1_2:
57 ; TINY-NEXT: andi r22, 7
59 ; TINY-NEXT: brmi .LBB1_2
60 ; TINY-NEXT: .LBB1_1: ; =>This Inner Loop Header: Depth=1
61 ; TINY-NEXT: bst r24, 0
63 ; TINY-NEXT: bld r24, 7
65 ; TINY-NEXT: brpl .LBB1_1
68 %mod = urem i8 %amt, 8
70 %parta = lshr i8 %val, %mod
71 %partb = shl i8 %val, %inv
72 %rotr = or i8 %parta, %partb