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