annotate test/CodeGen/Hexagon/bit-has.ll @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: llc -march=hexagon < %s | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; REQUIRES: asserts
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; This used to crash. Check for some sane output.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; CHECK: sath
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 target triple = "hexagon"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 define void @fred() local_unnamed_addr #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 b0:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 %v1 = load i32, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 %v2 = tail call i32 @llvm.hexagon.A2.sath(i32 undef)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 %v3 = and i32 %v1, 603979776
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 %v4 = trunc i32 %v3 to i30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 switch i30 %v4, label %b22 [
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 i30 -536870912, label %b5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 i30 -469762048, label %b6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 b5: ; preds = %b0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 b6: ; preds = %b0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 %v7 = load i32, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 %v8 = sub nsw i32 65536, %v7
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 %v9 = load i32, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 %v10 = mul nsw i32 %v9, %v9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 %v11 = zext i32 %v10 to i64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 %v12 = mul nsw i32 %v2, %v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 %v13 = sext i32 %v12 to i64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 %v14 = mul nsw i64 %v13, %v11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 %v15 = trunc i64 %v14 to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 %v16 = and i32 %v15, 2147483647
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 store i32 %v16, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 %v17 = lshr i64 %v14, 31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 %v18 = trunc i64 %v17 to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 store i32 %v18, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 br label %b19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 b19: ; preds = %b6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 br i1 undef, label %b20, label %b21
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 b20: ; preds = %b19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 b21: ; preds = %b19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 br label %b23
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 b22: ; preds = %b0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 b23: ; preds = %b21
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 %v24 = load i32, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 %v25 = shl i32 %v24, 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 %v26 = and i32 %v25, 65534
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 %v27 = or i32 %v26, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 store i32 %v27, i32* undef, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 declare i32 @llvm.hexagon.A2.sath(i32) #1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 attributes #0 = { nounwind "target-cpu"="hexagonv5" "target-features"="-hvx,-long-calls" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 attributes #1 = { nounwind readnone }