1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
| ; RUN: llc -march=xcore < %s | FileCheck %s
declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
declare i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
declare i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)
declare i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
declare void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
declare void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
declare void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
declare void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value)
define i32 @int(i8 addrspace(1)* %r) nounwind {
; CHECK-LABEL: int:
; CHECK: int r0, res[r0]
; CHECK-NEXT: retsp 0
%result = call i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
%trunc = and i32 %result, 255
ret i32 %trunc
}
define i32 @inct(i8 addrspace(1)* %r) nounwind {
; CHECK-LABEL: inct:
; CHECK: inct r0, res[r0]
; CHECK-NEXT: retsp 0
%result = call i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
%trunc = and i32 %result, 255
ret i32 %trunc
}
define i32 @testct(i8 addrspace(1)* %r) nounwind {
; CHECK-LABEL: testct:
; CHECK: testct r0, res[r0]
; CHECK-NEXT: retsp 0
%result = call i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
%trunc = and i32 %result, 1
ret i32 %trunc
}
define i32 @testwct(i8 addrspace(1)* %r) nounwind {
; CHECK-LABEL: testwct:
; CHECK: testwct r0, res[r0]
; CHECK-NEXT: retsp 0
%result = call i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)
%trunc = and i32 %result, 7
ret i32 %trunc
}
define i32 @getts(i8 addrspace(1)* %r) nounwind {
; CHECK-LABEL: getts:
; CHECK: getts r0, res[r0]
; CHECK-NEXT: retsp 0
%result = call i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
%trunc = and i32 %result, 65535
ret i32 %result
}
define void @outt(i8 addrspace(1)* %r, i32 %value) nounwind {
; CHECK-LABEL: outt:
; CHECK-NOT: zext
; CHECK: outt res[r0], r1
; CHECK-NEXT: retsp 0
%trunc = and i32 %value, 255
call void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %trunc)
ret void
}
define void @outct(i8 addrspace(1)* %r, i32 %value) nounwind {
; CHECK-LABEL: outct:
; CHECK-NOT: zext
; CHECK: outct res[r0], r1
%trunc = and i32 %value, 255
call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %trunc)
ret void
}
define void @chkct(i8 addrspace(1)* %r, i32 %value) nounwind {
; CHECK-LABEL: chkct:
; CHECK-NOT: zext
; CHECK: chkct res[r0], r1
%trunc = and i32 %value, 255
call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %trunc)
ret void
}
define void @setpt(i8 addrspace(1)* %r, i32 %value) nounwind {
; CHECK-LABEL: setpt:
; CHECK-NOT: zext
; CHECK: setpt res[r0], r1
%trunc = and i32 %value, 65535
call void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %trunc)
ret void
}
|