1 ; RUN: llc -march=xcore < %s | FileCheck %s 2 3 declare i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 %type) 4 declare void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r) 5 declare i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r) 6 declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r) 7 declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r) 8 declare void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value) 9 declare void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value) 10 declare void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value) 11 declare void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value) 12 declare i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r) 13 declare i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r) 14 declare void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value) 15 declare void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value) 16 declare i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value) 17 declare i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value) 18 declare void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value) 19 declare i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r) 20 declare void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r) 21 declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value) 22 declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p) 23 declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r) 24 declare void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 25 declare void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 26 declare void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value) 27 declare i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r) 28 declare i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r) 29 30 define i8 addrspace(1)* @getr() { 31 ; CHECK: getr: 32 ; CHECK: getr r0, 5 33 %result = call i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 5) 34 ret i8 addrspace(1)* %result 35 } 36 37 define void @freer(i8 addrspace(1)* %r) { 38 ; CHECK: freer: 39 ; CHECK: freer res[r0] 40 call void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r) 41 ret void 42 } 43 44 define i32 @in(i8 addrspace(1)* %r) { 45 ; CHECK: in: 46 ; CHECK: in r0, res[r0] 47 %result = call i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r) 48 ret i32 %result 49 } 50 51 define i32 @int(i8 addrspace(1)* %r) { 52 ; CHECK: int: 53 ; CHECK: int r0, res[r0] 54 %result = call i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r) 55 ret i32 %result 56 } 57 58 define i32 @inct(i8 addrspace(1)* %r) { 59 ; CHECK: inct: 60 ; CHECK: inct r0, res[r0] 61 %result = call i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r) 62 ret i32 %result 63 } 64 65 define void @out(i8 addrspace(1)* %r, i32 %value) { 66 ; CHECK: out: 67 ; CHECK: out res[r0], r1 68 call void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value) 69 ret void 70 } 71 72 define void @outt(i8 addrspace(1)* %r, i32 %value) { 73 ; CHECK: outt: 74 ; CHECK: outt res[r0], r1 75 call void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value) 76 ret void 77 } 78 79 define void @outct(i8 addrspace(1)* %r, i32 %value) { 80 ; CHECK: outct: 81 ; CHECK: outct res[r0], r1 82 call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value) 83 ret void 84 } 85 86 define void @outcti(i8 addrspace(1)* %r) { 87 ; CHECK: outcti: 88 ; CHECK: outct res[r0], 11 89 call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 11) 90 ret void 91 } 92 93 define void @chkct(i8 addrspace(1)* %r, i32 %value) { 94 ; CHECK: chkct: 95 ; CHECK: chkct res[r0], r1 96 call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value) 97 ret void 98 } 99 100 define void @chkcti(i8 addrspace(1)* %r) { 101 ; CHECK: chkcti: 102 ; CHECK: chkct res[r0], 11 103 call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 11) 104 ret void 105 } 106 107 define void @setd(i8 addrspace(1)* %r, i32 %value) { 108 ; CHECK: setd: 109 ; CHECK: setd res[r0], r1 110 call void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value) 111 ret void 112 } 113 114 define void @setc(i8 addrspace(1)* %r, i32 %value) { 115 ; CHECK: setc: 116 ; CHECK: setc res[r0], r1 117 call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value) 118 ret void 119 } 120 121 define void @setci(i8 addrspace(1)* %r) { 122 ; CHECK: setci: 123 ; CHECK: setc res[r0], 2 124 call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 2) 125 ret void 126 } 127 128 define i32 @inshr(i32 %value, i8 addrspace(1)* %r) { 129 ; CHECK: inshr: 130 ; CHECK: inshr r0, res[r1] 131 %result = call i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value) 132 ret i32 %result 133 } 134 135 define i32 @outshr(i32 %value, i8 addrspace(1)* %r) { 136 ; CHECK: outshr: 137 ; CHECK: outshr res[r1], r0 138 %result = call i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value) 139 ret i32 %result 140 } 141 142 define void @setpt(i8 addrspace(1)* %r, i32 %value) { 143 ; CHECK: setpt: 144 ; CHECK: setpt res[r0], r1 145 call void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value) 146 ret void 147 } 148 149 define i32 @getts(i8 addrspace(1)* %r) { 150 ; CHECK: getts: 151 ; CHECK: getts r0, res[r0] 152 %result = call i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r) 153 ret i32 %result 154 } 155 156 define void @syncr(i8 addrspace(1)* %r) { 157 ; CHECK: syncr: 158 ; CHECK: syncr res[r0] 159 call void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r) 160 ret void 161 } 162 163 define void @settw(i8 addrspace(1)* %r, i32 %value) { 164 ; CHECK: settw: 165 ; CHECK: settw res[r0], r1 166 call void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value) 167 ret void 168 } 169 170 define void @setv(i8 addrspace(1)* %r, i8* %p) { 171 ; CHECK: setv: 172 ; CHECK: mov r11, r1 173 ; CHECK-NEXT: setv res[r0], r11 174 call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p) 175 ret void 176 } 177 178 define void @eeu(i8 addrspace(1)* %r) { 179 ; CHECK: eeu: 180 ; CHECK: eeu res[r0] 181 call void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r) 182 ret void 183 } 184 185 define void @setclk(i8 addrspace(1)* %a, i8 addrspace(1)* %b) { 186 ; CHECK: setclk 187 ; CHECK: setclk res[r0], r1 188 call void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 189 ret void 190 } 191 192 define void @setrdy(i8 addrspace(1)* %a, i8 addrspace(1)* %b) { 193 ; CHECK: setrdy 194 ; CHECK: setrdy res[r0], r1 195 call void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 196 ret void 197 } 198 199 define void @setpsc(i8 addrspace(1)* %r, i32 %value) { 200 ; CHECK: setpsc 201 ; CHECK: setpsc res[r0], r1 202 call void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value) 203 ret void 204 } 205 206 define i32 @peek(i8 addrspace(1)* %r) { 207 ; CHECK: peek: 208 ; CHECK: peek r0, res[r0] 209 %result = call i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r) 210 ret i32 %result 211 } 212 213 define i32 @endin(i8 addrspace(1)* %r) { 214 ; CHECK: endin: 215 ; CHECK: endin r0, res[r0] 216 %result = call i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r) 217 ret i32 %result 218 } 219 220 define i32 @testct(i8 addrspace(1)* %r) { 221 ; CHECK: testct: 222 ; CHECK: testct r0, res[r0] 223 %result = call i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r) 224 ret i32 %result 225 } 226 227 define i32 @testwct(i8 addrspace(1)* %r) { 228 ; CHECK: testwct: 229 ; CHECK: testwct r0, res[r0] 230 %result = call i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r) 231 ret i32 %result 232 } 233