1; RUN: llc -march=xcore < %s | FileCheck %s 2 3declare i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 %type) 4declare void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r) 5declare i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r) 6declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r) 7declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r) 8declare void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value) 9declare void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value) 10declare void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value) 11declare void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value) 12declare i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r) 13declare i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r) 14declare void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value) 15declare void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value) 16declare i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value) 17declare i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value) 18declare void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value) 19declare i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r) 20declare void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r) 21declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value) 22declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p) 23declare void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p) 24declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r) 25declare void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 26declare void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b) 27declare void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value) 28declare i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r) 29declare i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r) 30 31define i8 addrspace(1)* @getr() { 32; CHECK-LABEL: 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 38define void @freer(i8 addrspace(1)* %r) { 39; CHECK-LABEL: freer: 40; CHECK: freer res[r0] 41 call void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r) 42 ret void 43} 44 45define i32 @in(i8 addrspace(1)* %r) { 46; CHECK-LABEL: 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 52define i32 @int(i8 addrspace(1)* %r) { 53; CHECK-LABEL: 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 59define i32 @inct(i8 addrspace(1)* %r) { 60; CHECK-LABEL: 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 66define void @out(i8 addrspace(1)* %r, i32 %value) { 67; CHECK-LABEL: 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 73define void @outt(i8 addrspace(1)* %r, i32 %value) { 74; CHECK-LABEL: 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 80define void @outct(i8 addrspace(1)* %r, i32 %value) { 81; CHECK-LABEL: 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 87define void @outcti(i8 addrspace(1)* %r) { 88; CHECK-LABEL: 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 94define void @chkct(i8 addrspace(1)* %r, i32 %value) { 95; CHECK-LABEL: 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 101define void @chkcti(i8 addrspace(1)* %r) { 102; CHECK-LABEL: 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 108define void @setd(i8 addrspace(1)* %r, i32 %value) { 109; CHECK-LABEL: 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 115define void @setc(i8 addrspace(1)* %r, i32 %value) { 116; CHECK-LABEL: 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 122define void @setci(i8 addrspace(1)* %r) { 123; CHECK-LABEL: 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 129define i32 @inshr(i32 %value, i8 addrspace(1)* %r) { 130; CHECK-LABEL: 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 136define i32 @outshr(i32 %value, i8 addrspace(1)* %r) { 137; CHECK-LABEL: 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 143define void @setpt(i8 addrspace(1)* %r, i32 %value) { 144; CHECK-LABEL: 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 150define i32 @getts(i8 addrspace(1)* %r) { 151; CHECK-LABEL: 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 157define void @syncr(i8 addrspace(1)* %r) { 158; CHECK-LABEL: syncr: 159; CHECK: syncr res[r0] 160 call void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r) 161 ret void 162} 163 164define void @settw(i8 addrspace(1)* %r, i32 %value) { 165; CHECK-LABEL: 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 171define void @setv(i8 addrspace(1)* %r, i8* %p) { 172; CHECK-LABEL: 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 179define void @setev(i8 addrspace(1)* %r, i8* %p) { 180; CHECK-LABEL: 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 187define void @eeu(i8 addrspace(1)* %r) { 188; CHECK-LABEL: eeu: 189; CHECK: eeu res[r0] 190 call void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r) 191 ret void 192} 193 194define 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 201define 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 208define 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 215define i32 @peek(i8 addrspace(1)* %r) { 216; CHECK-LABEL: 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 222define i32 @endin(i8 addrspace(1)* %r) { 223; CHECK-LABEL: 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 229define i32 @testct(i8 addrspace(1)* %r) { 230; CHECK-LABEL: 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 236define i32 @testwct(i8 addrspace(1)* %r) { 237; CHECK-LABEL: 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