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

« back to all changes in this revision

Viewing changes to test/CodeGen/SystemZ/fp-sub-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 subtraction.
 
2
;
 
3
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
 
4
 
 
5
; Check register subtraction.
 
6
define float @f1(float %f1, float %f2) {
 
7
; CHECK: f1:
 
8
; CHECK: sebr %f0, %f2
 
9
; CHECK: br %r14
 
10
  %res = fsub float %f1, %f2
 
11
  ret float %res
 
12
}
 
13
 
 
14
; Check the low end of the SEB range.
 
15
define float @f2(float %f1, float *%ptr) {
 
16
; CHECK: f2:
 
17
; CHECK: seb %f0, 0(%r2)
 
18
; CHECK: br %r14
 
19
  %f2 = load float *%ptr
 
20
  %res = fsub float %f1, %f2
 
21
  ret float %res
 
22
}
 
23
 
 
24
; Check the high end of the aligned SEB range.
 
25
define float @f3(float %f1, float *%base) {
 
26
; CHECK: f3:
 
27
; CHECK: seb %f0, 4092(%r2)
 
28
; CHECK: br %r14
 
29
  %ptr = getelementptr float *%base, i64 1023
 
30
  %f2 = load float *%ptr
 
31
  %res = fsub float %f1, %f2
 
32
  ret float %res
 
33
}
 
34
 
 
35
; Check the next word up, which needs separate address logic.
 
36
; Other sequences besides this one would be OK.
 
37
define float @f4(float %f1, float *%base) {
 
38
; CHECK: f4:
 
39
; CHECK: aghi %r2, 4096
 
40
; CHECK: seb %f0, 0(%r2)
 
41
; CHECK: br %r14
 
42
  %ptr = getelementptr float *%base, i64 1024
 
43
  %f2 = load float *%ptr
 
44
  %res = fsub float %f1, %f2
 
45
  ret float %res
 
46
}
 
47
 
 
48
; Check negative displacements, which also need separate address logic.
 
49
define float @f5(float %f1, float *%base) {
 
50
; CHECK: f5:
 
51
; CHECK: aghi %r2, -4
 
52
; CHECK: seb %f0, 0(%r2)
 
53
; CHECK: br %r14
 
54
  %ptr = getelementptr float *%base, i64 -1
 
55
  %f2 = load float *%ptr
 
56
  %res = fsub float %f1, %f2
 
57
  ret float %res
 
58
}
 
59
 
 
60
; Check that SEB allows indices.
 
61
define float @f6(float %f1, float *%base, i64 %index) {
 
62
; CHECK: f6:
 
63
; CHECK: sllg %r1, %r3, 2
 
64
; CHECK: seb %f0, 400(%r1,%r2)
 
65
; CHECK: br %r14
 
66
  %ptr1 = getelementptr float *%base, i64 %index
 
67
  %ptr2 = getelementptr float *%ptr1, i64 100
 
68
  %f2 = load float *%ptr2
 
69
  %res = fsub float %f1, %f2
 
70
  ret float %res
 
71
}