PR31345.ll
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; RUN: llc < %s -march=avr | FileCheck %s
; Unit test for: PR 31345
define i16 @and16_reg_imm_0xff00(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0xff00
; CHECK: andi {{r[0-9]+}}, 0
; CHECK-NOT: andi {{r[0-9]+}}, 255
%result = and i16 %a, 65280
ret i16 %result
}
define i16 @and16_reg_imm_0xffb3(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0xffb3
; CHECK: andi {{r[0-9]+}}, 179
; CHECK-NOT: andi {{r[0-9]+}}, 255
%result = and i16 %a, 65459
ret i16 %result
}
define i16 @and16_reg_imm_0x00ff(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0x00ff
; CHECK-NOT: andi {{r[0-9]+}}, 255
; CHECK: andi {{r[0-9]+}}, 0
%result = and i16 %a, 255
ret i16 %result
}
define i16 @and16_reg_imm_0xb3ff(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0xb3ff
; CHECK-NOT: andi {{r[0-9]+}}, 255
; CHECK: andi {{r[0-9]+}}, 179
%result = and i16 %a, 46079
ret i16 %result
}
define i16 @and16_reg_imm_0xffff(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0xffff
; CHECK-NOT: andi {{r[0-9]+}}, 255
; CHECK-NOT: andi {{r[0-9]+}}, 255
%result = and i16 %a, 65535
ret i16 %result
}
define i16 @and16_reg_imm_0xabcd(i16 %a) {
; CHECK-LABEL: and16_reg_imm_0xabcd
; CHECK: andi {{r[0-9]+}}, 205
; CHECK: andi {{r[0-9]+}}, 171
%result = and i16 %a, 43981
ret i16 %result
}