1 ; RUN: llc < %s -march=avr | FileCheck %s
3 define i8 @and8_reg_reg(i8 %a, i8 %b) {
4 ; CHECK-LABEL: and8_reg_reg:
6 %result = and i8 %a, %b
10 define i8 @and8_reg_imm(i8 %a) {
11 ; CHECK-LABEL: and8_reg_imm:
13 %result = and i8 %a, 5
17 define i16 @and16_reg_reg(i16 %a, i16 %b) {
18 ; CHECK-LABEL: and16_reg_reg:
21 %result = and i16 %a, %b
25 define i16 @and16_reg_imm(i16 %a) {
26 ; CHECK-LABEL: and16_reg_imm:
27 ; CHECK: andi r24, 210
29 %result = and i16 %a, 1234
33 define i32 @and32_reg_reg(i32 %a, i32 %b) {
34 ; CHECK-LABEL: and32_reg_reg:
39 %result = and i32 %a, %b
43 define i32 @and32_reg_imm(i32 %a) {
44 ; CHECK-LABEL: and32_reg_imm:
46 ; CHECK: andi r23, 205
49 %result = and i32 %a, 123456789
53 define i64 @and64_reg_reg(i64 %a, i64 %b) {
54 ; CHECK-LABEL: and64_reg_reg:
63 %result = and i64 %a, %b
67 define i64 @and64_reg_imm(i64 %a) {
68 ; CHECK-LABEL: and64_reg_imm:
69 ; CHECK: andi r18, 253
70 ; Per PR 31345, we optimize away ANDI Rd, 0xff
71 ; CHECK-NOT: andi r19, 255
72 ; CHECK: andi r20, 155
77 ; CHECK: andi r25, 242
78 %result = and i64 %a, 17446744073709551613