annotate test/CodeGen/SystemZ/trap-05.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test load-and-trap instructions (LFHAT)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; See comments in asm-18.ll about testing high-word operations.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=zEC12 \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; RUN: -no-integrated-as | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 declare void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; Check LAT with no displacement.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 define void @f1(i32 *%ptr) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ; CHECK-LABEL: f1:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 ; CHECK: lfhat [[REG:%r[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; CHECK: stepa [[REG]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 call void asm sideeffect "stepa $0", "h"(i32 %val)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ret void;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; Check the high end of the LAT range.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 define void @f2(i32 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; CHECK-LABEL: f2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ; CHECK: lfhat [[REG:%r[0-9]+]], 524284(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; CHECK: stepa [[REG]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 %ptr = getelementptr i32, i32 *%src, i64 131071
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 call void asm sideeffect "stepa $0", "h"(i32 %val)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ret void;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; Check the next word up, which needs separate address logic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; Other sequences besides this one would be OK.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 define void @f3(i32 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ; CHECK-LABEL: f3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ; CHECK: agfi %r2, 524288
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 ; CHECK: lfhat [[REG:%r[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 ; CHECK: stepa [[REG]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 %ptr = getelementptr i32, i32 *%src, i64 131072
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 call void asm sideeffect "stepa $0", "h"(i32 %val)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 ret void;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 ; Check that LAT allows an index.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 define void @f4(i64 %src, i64 %index) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 ; CHECK-LABEL: f4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 ; CHECK: lfhat [[REG:%r[0-9]+]], 524287(%r3,%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 ; CHECK: stepa [[REG]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 %add1 = add i64 %src, %index
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 %add2 = add i64 %add1, 524287
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 %ptr = inttoptr i64 %add2 to i32 *
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 call void asm sideeffect "stepa $0", "h"(i32 %val)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 ret void;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92