2011-02-03 13:14:25 +00:00
|
|
|
; RUN: llc -march=xcore < %s | FileCheck %s
|
|
|
|
|
|
|
|
declare i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 %type)
|
|
|
|
declare void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
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)
|
2011-07-19 13:00:40 +00:00
|
|
|
declare i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)
|
2011-02-03 13:14:25 +00:00
|
|
|
declare void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
declare void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value)
|
2011-02-21 18:23:30 +00:00
|
|
|
declare i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
declare i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
declare void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
declare i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r)
|
2011-02-23 14:45:03 +00:00
|
|
|
declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
|
2011-02-23 16:46:37 +00:00
|
|
|
declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
|
2011-08-18 13:00:48 +00:00
|
|
|
declare void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p)
|
2011-02-24 13:39:18 +00:00
|
|
|
declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
|
2011-03-16 21:56:00 +00:00
|
|
|
declare void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
|
|
|
|
declare void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
|
2011-03-17 18:42:05 +00:00
|
|
|
declare void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
|
2011-07-19 12:50:25 +00:00
|
|
|
declare i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
|
|
|
|
declare i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
|
2011-02-03 13:14:25 +00:00
|
|
|
|
|
|
|
define i8 addrspace(1)* @getr() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: getr:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: getr r0, 5
|
|
|
|
%result = call i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 5)
|
|
|
|
ret i8 addrspace(1)* %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @freer(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: freer:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: freer res[r0]
|
|
|
|
call void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @in(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: in:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: in r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @int(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: int:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: int r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @inct(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: inct:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: inct r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @out(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: out:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: out res[r0], r1
|
|
|
|
call void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @outt(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: outt:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: outt res[r0], r1
|
|
|
|
call void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @outct(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: outct:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: outct res[r0], r1
|
|
|
|
call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @outcti(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: outcti:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: outct res[r0], 11
|
|
|
|
call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 11)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @chkct(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: chkct:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: chkct res[r0], r1
|
|
|
|
call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @chkcti(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: chkcti:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: chkct res[r0], 11
|
|
|
|
call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 11)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @setd(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setd:
|
2011-02-03 13:14:25 +00:00
|
|
|
; CHECK: setd res[r0], r1
|
|
|
|
call void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
2011-02-09 13:22:12 +00:00
|
|
|
|
|
|
|
define void @setc(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setc:
|
2011-02-09 13:22:12 +00:00
|
|
|
; CHECK: setc res[r0], r1
|
|
|
|
call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @setci(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setci:
|
2011-02-09 13:22:12 +00:00
|
|
|
; CHECK: setc res[r0], 2
|
|
|
|
call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 2)
|
|
|
|
ret void
|
|
|
|
}
|
2011-02-21 18:23:30 +00:00
|
|
|
|
|
|
|
define i32 @inshr(i32 %value, i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: inshr:
|
2011-02-21 18:23:30 +00:00
|
|
|
; CHECK: inshr r0, res[r1]
|
|
|
|
%result = call i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @outshr(i32 %value, i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: outshr:
|
2011-02-21 18:23:30 +00:00
|
|
|
; CHECK: outshr res[r1], r0
|
|
|
|
%result = call i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @setpt(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setpt:
|
2011-02-21 18:23:30 +00:00
|
|
|
; CHECK: setpt res[r0], r1
|
|
|
|
call void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @getts(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: getts:
|
2011-02-21 18:23:30 +00:00
|
|
|
; CHECK: getts r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @syncr(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: syncr:
|
2011-02-21 18:23:30 +00:00
|
|
|
; CHECK: syncr res[r0]
|
|
|
|
call void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret void
|
|
|
|
}
|
2011-02-23 14:45:03 +00:00
|
|
|
|
|
|
|
define void @settw(i8 addrspace(1)* %r, i32 %value) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: settw:
|
2011-02-23 14:45:03 +00:00
|
|
|
; CHECK: settw res[r0], r1
|
|
|
|
call void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
2011-02-23 16:46:37 +00:00
|
|
|
|
|
|
|
define void @setv(i8 addrspace(1)* %r, i8* %p) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setv:
|
2011-02-23 16:46:37 +00:00
|
|
|
; CHECK: mov r11, r1
|
|
|
|
; CHECK-NEXT: setv res[r0], r11
|
|
|
|
call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
|
|
|
|
ret void
|
|
|
|
}
|
2011-02-24 13:39:18 +00:00
|
|
|
|
2011-08-18 13:00:48 +00:00
|
|
|
define void @setev(i8 addrspace(1)* %r, i8* %p) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: setev:
|
2011-08-18 13:00:48 +00:00
|
|
|
; CHECK: mov r11, r1
|
|
|
|
; CHECK-NEXT: setev res[r0], r11
|
|
|
|
call void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-24 13:39:18 +00:00
|
|
|
define void @eeu(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: eeu:
|
2011-02-24 13:39:18 +00:00
|
|
|
; CHECK: eeu res[r0]
|
|
|
|
call void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret void
|
|
|
|
}
|
2011-03-16 21:56:00 +00:00
|
|
|
|
|
|
|
define void @setclk(i8 addrspace(1)* %a, i8 addrspace(1)* %b) {
|
|
|
|
; CHECK: setclk
|
|
|
|
; CHECK: setclk res[r0], r1
|
|
|
|
call void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @setrdy(i8 addrspace(1)* %a, i8 addrspace(1)* %b) {
|
|
|
|
; CHECK: setrdy
|
|
|
|
; CHECK: setrdy res[r0], r1
|
|
|
|
call void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
|
|
|
|
ret void
|
|
|
|
}
|
2011-03-17 18:42:05 +00:00
|
|
|
|
|
|
|
define void @setpsc(i8 addrspace(1)* %r, i32 %value) {
|
|
|
|
; CHECK: setpsc
|
|
|
|
; CHECK: setpsc res[r0], r1
|
|
|
|
call void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
|
|
|
|
ret void
|
|
|
|
}
|
2011-07-19 12:50:25 +00:00
|
|
|
|
|
|
|
define i32 @peek(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: peek:
|
2011-07-19 12:50:25 +00:00
|
|
|
; CHECK: peek r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @endin(i8 addrspace(1)* %r) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: endin:
|
2011-07-19 12:50:25 +00:00
|
|
|
; CHECK: endin r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
2011-07-19 13:00:40 +00:00
|
|
|
|
|
|
|
define i32 @testct(i8 addrspace(1)* %r) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: testct:
|
2011-07-19 13:00:40 +00:00
|
|
|
; CHECK: testct r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @testwct(i8 addrspace(1)* %r) {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: testwct:
|
2011-07-19 13:00:40 +00:00
|
|
|
; CHECK: testwct r0, res[r0]
|
|
|
|
%result = call i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)
|
|
|
|
ret i32 %result
|
|
|
|
}
|