~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to test/CodeGen/SystemZ/int-cmp-26.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; Test 32-bit equality comparisons that are really between a memory halfword
 
2
; and a constant.
 
3
;
 
4
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
 
5
 
 
6
; Check the low end of the 16-bit unsigned range, with zero extension.
 
7
define double @f1(double %a, double %b, i16 *%ptr) {
 
8
; CHECK: f1:
 
9
; CHECK: clhhsi 0(%r2), 0
 
10
; CHECK-NEXT: je
 
11
; CHECK: br %r14
 
12
  %val = load i16 *%ptr
 
13
  %ext = zext i16 %val to i32
 
14
  %cond = icmp eq i32 %ext, 0
 
15
  %res = select i1 %cond, double %a, double %b
 
16
  ret double %res
 
17
}
 
18
 
 
19
; Check the high end of the 16-bit unsigned range, with zero extension.
 
20
define double @f2(double %a, double %b, i16 *%ptr) {
 
21
; CHECK: f2:
 
22
; CHECK: clhhsi 0(%r2), 65535
 
23
; CHECK-NEXT: je
 
24
; CHECK: br %r14
 
25
  %val = load i16 *%ptr
 
26
  %ext = zext i16 %val to i32
 
27
  %cond = icmp eq i32 %ext, 65535
 
28
  %res = select i1 %cond, double %a, double %b
 
29
  ret double %res
 
30
}
 
31
 
 
32
; Check the next value up, with zero extension.  The condition is always false.
 
33
define double @f3(double %a, double %b, i16 *%ptr) {
 
34
; CHECK: f3:
 
35
; CHECK-NOT: clhhsi
 
36
; CHECK: br %r14
 
37
  %val = load i16 *%ptr
 
38
  %ext = zext i16 %val to i32
 
39
  %cond = icmp eq i32 %ext, 65536
 
40
  %res = select i1 %cond, double %a, double %b
 
41
  ret double %res
 
42
}
 
43
 
 
44
; Check comparisons with -1, with zero extension.
 
45
; This condition is also always false.
 
46
define double @f4(double %a, double %b, i16 *%ptr) {
 
47
; CHECK: f4:
 
48
; CHECK-NOT: clhhsi
 
49
; CHECK: br %r14
 
50
  %val = load i16 *%ptr
 
51
  %ext = zext i16 %val to i32
 
52
  %cond = icmp eq i32 %ext, -1
 
53
  %res = select i1 %cond, double %a, double %b
 
54
  ret double %res
 
55
}
 
56
 
 
57
; Check comparisons with 0, using sign extension.
 
58
define double @f5(double %a, double %b, i16 *%ptr) {
 
59
; CHECK: f5:
 
60
; CHECK: clhhsi 0(%r2), 0
 
61
; CHECK-NEXT: je
 
62
; CHECK: br %r14
 
63
  %val = load i16 *%ptr
 
64
  %ext = sext i16 %val to i32
 
65
  %cond = icmp eq i32 %ext, 0
 
66
  %res = select i1 %cond, double %a, double %b
 
67
  ret double %res
 
68
}
 
69
 
 
70
; Check the high end of the signed 16-bit range, using sign extension.
 
71
define double @f6(double %a, double %b, i16 *%ptr) {
 
72
; CHECK: f6:
 
73
; CHECK: clhhsi 0(%r2), 32767
 
74
; CHECK-NEXT: je
 
75
; CHECK: br %r14
 
76
  %val = load i16 *%ptr
 
77
  %ext = sext i16 %val to i32
 
78
  %cond = icmp eq i32 %ext, 32767
 
79
  %res = select i1 %cond, double %a, double %b
 
80
  ret double %res
 
81
}
 
82
 
 
83
; Check the next value up, using sign extension.
 
84
; The condition is always false.
 
85
define double @f7(double %a, double %b, i16 *%ptr) {
 
86
; CHECK: f7:
 
87
; CHECK-NOT: clhhsi
 
88
; CHECK: br %r14
 
89
  %val = load i16 *%ptr
 
90
  %ext = sext i16 %val to i32
 
91
  %cond = icmp eq i32 %ext, 32768
 
92
  %res = select i1 %cond, double %a, double %b
 
93
  ret double %res
 
94
}
 
95
 
 
96
; Check comparisons with -1, using sign extension.
 
97
define double @f8(double %a, double %b, i16 *%ptr) {
 
98
; CHECK: f8:
 
99
; CHECK: clhhsi 0(%r2), 65535
 
100
; CHECK-NEXT: je
 
101
; CHECK: br %r14
 
102
  %val = load i16 *%ptr
 
103
  %ext = sext i16 %val to i32
 
104
  %cond = icmp eq i32 %ext, -1
 
105
  %res = select i1 %cond, double %a, double %b
 
106
  ret double %res
 
107
}
 
108
 
 
109
; Check the low end of the signed 16-bit range, using sign extension.
 
110
define double @f9(double %a, double %b, i16 *%ptr) {
 
111
; CHECK: f9:
 
112
; CHECK: clhhsi 0(%r2), 32768
 
113
; CHECK-NEXT: je
 
114
; CHECK: br %r14
 
115
  %val = load i16 *%ptr
 
116
  %ext = sext i16 %val to i32
 
117
  %cond = icmp eq i32 %ext, -32768
 
118
  %res = select i1 %cond, double %a, double %b
 
119
  ret double %res
 
120
}
 
121
 
 
122
; Check the next value down, using sign extension.
 
123
; The condition is always false.
 
124
define double @f10(double %a, double %b, i16 *%ptr) {
 
125
; CHECK: f10:
 
126
; CHECK-NOT: clhhsi
 
127
; CHECK: br %r14
 
128
  %val = load i16 *%ptr
 
129
  %ext = sext i16 %val to i32
 
130
  %cond = icmp eq i32 %ext, -32769
 
131
  %res = select i1 %cond, double %a, double %b
 
132
  ret double %res
 
133
}