• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
3; RUN:   -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
4; RUN:  --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
5; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
6; RUN:   -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
7; RUN:  --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
8
9@glob = common local_unnamed_addr global i16 0, align 2
10
11; Function Attrs: norecurse nounwind readnone
12define i64 @test_lleqss(i16 signext %a, i16 signext %b) {
13; CHECK-LABEL: test_lleqss:
14; CHECK:       # %bb.0: # %entry
15; CHECK-NEXT:    xor r3, r3, r4
16; CHECK-NEXT:    cntlzw r3, r3
17; CHECK-NEXT:    srwi r3, r3, 5
18; CHECK-NEXT:    blr
19entry:
20  %cmp = icmp eq i16 %a, %b
21  %conv3 = zext i1 %cmp to i64
22  ret i64 %conv3
23}
24
25; Function Attrs: norecurse nounwind readnone
26define i64 @test_lleqss_sext(i16 signext %a, i16 signext %b) {
27; CHECK-LABEL: test_lleqss_sext:
28; CHECK:       # %bb.0: # %entry
29; CHECK-NEXT:    xor r3, r3, r4
30; CHECK-NEXT:    cntlzw r3, r3
31; CHECK-NEXT:    srwi r3, r3, 5
32; CHECK-NEXT:    neg r3, r3
33; CHECK-NEXT:    blr
34entry:
35  %cmp = icmp eq i16 %a, %b
36  %conv3 = sext i1 %cmp to i64
37  ret i64 %conv3
38}
39
40; Function Attrs: norecurse nounwind readnone
41define i64 @test_lleqss_z(i16 signext %a) {
42; CHECK-LABEL: test_lleqss_z:
43; CHECK:       # %bb.0: # %entry
44; CHECK-NEXT:    cntlzw r3, r3
45; CHECK-NEXT:    srwi r3, r3, 5
46; CHECK-NEXT:    blr
47entry:
48  %cmp = icmp eq i16 %a, 0
49  %conv2 = zext i1 %cmp to i64
50  ret i64 %conv2
51}
52
53; Function Attrs: norecurse nounwind readnone
54define i64 @test_lleqss_sext_z(i16 signext %a) {
55; CHECK-LABEL: test_lleqss_sext_z:
56; CHECK:       # %bb.0: # %entry
57; CHECK-NEXT:    cntlzw r3, r3
58; CHECK-NEXT:    srwi r3, r3, 5
59; CHECK-NEXT:    neg r3, r3
60; CHECK-NEXT:    blr
61entry:
62  %cmp = icmp eq i16 %a, 0
63  %conv2 = sext i1 %cmp to i64
64  ret i64 %conv2
65}
66
67; Function Attrs: norecurse nounwind
68define void @test_lleqss_store(i16 signext %a, i16 signext %b) {
69; CHECK-LABEL: test_lleqss_store:
70; CHECK:       # %bb.0: # %entry
71; CHECK-NEXT:    addis r5, r2, .LC0@toc@ha
72; CHECK-NEXT:    xor r3, r3, r4
73; CHECK-NEXT:    ld r4, .LC0@toc@l(r5)
74; CHECK-NEXT:    cntlzw r3, r3
75; CHECK-NEXT:    srwi r3, r3, 5
76; CHECK-NEXT:    sth r3, 0(r4)
77; CHECK-NEXT:    blr
78entry:
79  %cmp = icmp eq i16 %a, %b
80  %conv3 = zext i1 %cmp to i16
81  store i16 %conv3, i16* @glob, align 2
82  ret void
83}
84
85; Function Attrs: norecurse nounwind
86define void @test_lleqss_sext_store(i16 signext %a, i16 signext %b) {
87; CHECK-LABEL: test_lleqss_sext_store:
88; CHECK:       # %bb.0: # %entry
89; CHECK-NEXT:    addis r5, r2, .LC0@toc@ha
90; CHECK-NEXT:    xor r3, r3, r4
91; CHECK-NEXT:    cntlzw r3, r3
92; CHECK-NEXT:    ld r4, .LC0@toc@l(r5)
93; CHECK-NEXT:    srwi r3, r3, 5
94; CHECK-NEXT:    neg r3, r3
95; CHECK-NEXT:    sth r3, 0(r4)
96; CHECK-NEXT:    blr
97entry:
98  %cmp = icmp eq i16 %a, %b
99  %conv3 = sext i1 %cmp to i16
100  store i16 %conv3, i16* @glob, align 2
101  ret void
102}
103
104; Function Attrs: norecurse nounwind
105define void @test_lleqss_z_store(i16 signext %a) {
106; CHECK-LABEL: test_lleqss_z_store:
107; CHECK:       # %bb.0: # %entry
108; CHECK-NEXT:    addis r4, r2, .LC0@toc@ha
109; CHECK-NEXT:    cntlzw r3, r3
110; CHECK-NEXT:    ld r4, .LC0@toc@l(r4)
111; CHECK-NEXT:    srwi r3, r3, 5
112; CHECK-NEXT:    sth r3, 0(r4)
113; CHECK-NEXT:    blr
114entry:
115  %cmp = icmp eq i16 %a, 0
116  %conv2 = zext i1 %cmp to i16
117  store i16 %conv2, i16* @glob, align 2
118  ret void
119}
120
121; Function Attrs: norecurse nounwind
122define void @test_lleqss_sext_z_store(i16 signext %a) {
123; CHECK-LABEL: test_lleqss_sext_z_store:
124; CHECK:       # %bb.0: # %entry
125; CHECK-NEXT:    addis r4, r2, .LC0@toc@ha
126; CHECK-NEXT:    cntlzw r3, r3
127; CHECK-NEXT:    ld r4, .LC0@toc@l(r4)
128; CHECK-NEXT:    srwi r3, r3, 5
129; CHECK-NEXT:    neg r3, r3
130; CHECK-NEXT:    sth r3, 0(r4)
131; CHECK-NEXT:    blr
132entry:
133  %cmp = icmp eq i16 %a, 0
134  %conv2 = sext i1 %cmp to i16
135  store i16 %conv2, i16* @glob, align 2
136  ret void
137}
138