Skip to content

Commit

Permalink
[XCore] Add intrinsic for EDU (event disable unconditional) instruction.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202171 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Richard Osborne committed Feb 25, 2014
1 parent 57edc9d commit fb2f73a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/llvm/IR/IntrinsicsXCore.td
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.".
def int_xcore_setev : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty],
[NoCapture<0>]>;
def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
def int_xcore_edu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>;
def int_xcore_setclk : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
[NoCapture<0>, NoCapture<1>]>;
def int_xcore_setrdy : Intrinsic<[],[llvm_anyptr_ty, llvm_anyptr_ty],
Expand Down
3 changes: 2 additions & 1 deletion lib/Target/XCore/XCoreInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,8 @@ def SETEV_1r : _F1R<0b001111, (outs), (ins GRRegs:$a),

def DGETREG_1r : _F1R<0b001110, (outs GRRegs:$a), (ins), "dgetreg $a", []>;

def EDU_1r : _F1R<0b000000, (outs), (ins GRRegs:$a), "edu res[$a]", []>;
def EDU_1r : _F1R<0b000000, (outs), (ins GRRegs:$a), "edu res[$a]",
[(int_xcore_edu GRRegs:$a)]>;

def EEU_1r : _F1R<0b000001, (outs), (ins GRRegs:$a),
"eeu res[$a]",
Expand Down
8 changes: 8 additions & 0 deletions test/CodeGen/XCore/resources.ll
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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)
declare void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p)
declare void @llvm.xcore.edu.p1i8(i8 addrspace(1)* %r)
declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
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)
Expand Down Expand Up @@ -184,6 +185,13 @@ define void @setev(i8 addrspace(1)* %r, i8* %p) {
ret void
}

define void @edu(i8 addrspace(1)* %r) {
; CHECK-LABEL: edu:
; CHECK: edu res[r0]
call void @llvm.xcore.edu.p1i8(i8 addrspace(1)* %r)
ret void
}

define void @eeu(i8 addrspace(1)* %r) {
; CHECK-LABEL: eeu:
; CHECK: eeu res[r0]
Expand Down

0 comments on commit fb2f73a

Please sign in to comment.