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

« back to all changes in this revision

Viewing changes to test/CodeGen/SystemZ/fp-cmp-01.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 floating-point comparison.
 
2
;
 
3
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
 
4
 
 
5
; Check comparison with registers.
 
6
define i64 @f1(i64 %a, i64 %b, float %f1, float %f2) {
 
7
; CHECK: f1:
 
8
; CHECK: cebr %f0, %f2
 
9
; CHECK-NEXT: je
 
10
; CHECK: lgr %r2, %r3
 
11
; CHECK: br %r14
 
12
  %cond = fcmp oeq float %f1, %f2
 
13
  %res = select i1 %cond, i64 %a, i64 %b
 
14
  ret i64 %res
 
15
}
 
16
 
 
17
; Check the low end of the CEB range.
 
18
define i64 @f2(i64 %a, i64 %b, float %f1, float *%ptr) {
 
19
; CHECK: f2:
 
20
; CHECK: ceb %f0, 0(%r4)
 
21
; CHECK-NEXT: je
 
22
; CHECK: lgr %r2, %r3
 
23
; CHECK: br %r14
 
24
  %f2 = load float *%ptr
 
25
  %cond = fcmp oeq float %f1, %f2
 
26
  %res = select i1 %cond, i64 %a, i64 %b
 
27
  ret i64 %res
 
28
}
 
29
 
 
30
; Check the high end of the aligned CEB range.
 
31
define i64 @f3(i64 %a, i64 %b, float %f1, float *%base) {
 
32
; CHECK: f3:
 
33
; CHECK: ceb %f0, 4092(%r4)
 
34
; CHECK-NEXT: je
 
35
; CHECK: lgr %r2, %r3
 
36
; CHECK: br %r14
 
37
  %ptr = getelementptr float *%base, i64 1023
 
38
  %f2 = load float *%ptr
 
39
  %cond = fcmp oeq float %f1, %f2
 
40
  %res = select i1 %cond, i64 %a, i64 %b
 
41
  ret i64 %res
 
42
}
 
43
 
 
44
; Check the next word up, which needs separate address logic.
 
45
; Other sequences besides this one would be OK.
 
46
define i64 @f4(i64 %a, i64 %b, float %f1, float *%base) {
 
47
; CHECK: f4:
 
48
; CHECK: aghi %r4, 4096
 
49
; CHECK: ceb %f0, 0(%r4)
 
50
; CHECK-NEXT: je
 
51
; CHECK: lgr %r2, %r3
 
52
; CHECK: br %r14
 
53
  %ptr = getelementptr float *%base, i64 1024
 
54
  %f2 = load float *%ptr
 
55
  %cond = fcmp oeq float %f1, %f2
 
56
  %res = select i1 %cond, i64 %a, i64 %b
 
57
  ret i64 %res
 
58
}
 
59
 
 
60
; Check negative displacements, which also need separate address logic.
 
61
define i64 @f5(i64 %a, i64 %b, float %f1, float *%base) {
 
62
; CHECK: f5:
 
63
; CHECK: aghi %r4, -4
 
64
; CHECK: ceb %f0, 0(%r4)
 
65
; CHECK-NEXT: je
 
66
; CHECK: lgr %r2, %r3
 
67
; CHECK: br %r14
 
68
  %ptr = getelementptr float *%base, i64 -1
 
69
  %f2 = load float *%ptr
 
70
  %cond = fcmp oeq float %f1, %f2
 
71
  %res = select i1 %cond, i64 %a, i64 %b
 
72
  ret i64 %res
 
73
}
 
74
 
 
75
; Check that CEB allows indices.
 
76
define i64 @f6(i64 %a, i64 %b, float %f1, float *%base, i64 %index) {
 
77
; CHECK: f6:
 
78
; CHECK: sllg %r1, %r5, 2
 
79
; CHECK: ceb %f0, 400(%r1,%r4)
 
80
; CHECK-NEXT: je
 
81
; CHECK: lgr %r2, %r3
 
82
; CHECK: br %r14
 
83
  %ptr1 = getelementptr float *%base, i64 %index
 
84
  %ptr2 = getelementptr float *%ptr1, i64 100
 
85
  %f2 = load float *%ptr2
 
86
  %cond = fcmp oeq float %f1, %f2
 
87
  %res = select i1 %cond, i64 %a, i64 %b
 
88
  ret i64 %res
 
89
}