Add XCore intrinsic for the setv instruction.

llvm-svn: 126315
This commit is contained in:
Richard Osborne 2011-02-23 16:46:37 +00:00
parent 2374e9683e
commit aaac1b01fd
3 changed files with 17 additions and 1 deletions

View File

@ -45,4 +45,6 @@ let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.".
[NoCapture<0>]>;
def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty],
[NoCapture<0>]>;
def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
[NoCapture<0>]>;
}

View File

@ -841,7 +841,7 @@ def SETTW_l2r : _FL2R<(outs), (ins GRRegs:$r, GRRegs:$val),
// One operand short
// TODO edu, eeu, waitet, waitef, tstart, msync, mjoin, clrtp
// setdp, setcp, setv, setev, kcall
// setdp, setcp, setev, kcall
// dgetreg
let isBranch=1, isIndirectBranch=1, isTerminator=1, isBarrier = 1 in
def BAU_1r : _F1R<(outs), (ins GRRegs:$addr),
@ -889,6 +889,11 @@ def FREER_1r : _F1R<(outs), (ins GRRegs:$r),
"freer res[$r]",
[(int_xcore_freer GRRegs:$r)]>;
let Uses=[R11] in
def SETV_1r : _F1R<(outs), (ins GRRegs:$r),
"setv res[$r], r11",
[(int_xcore_setv GRRegs:$r, R11)]>;
// Zero operand short
// TODO waiteu, clre, ssync, freet, ldspc, stspc, ldssr, stssr, ldsed, stsed,
// stet, geted, getet, getkep, getksp, setkep, getid, kret, dcall, dret,

View File

@ -17,6 +17,7 @@ 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)
declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
define i8 addrspace(1)* @getr() {
; CHECK: getr:
@ -157,3 +158,11 @@ define void @settw(i8 addrspace(1)* %r, i32 %value) {
call void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
ret void
}
define void @setv(i8 addrspace(1)* %r, i8* %p) {
; CHECK: setv:
; CHECK: mov r11, r1
; CHECK-NEXT: setv res[r0], r11
call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
ret void
}