From fb2f73acb92da67b360244b12e0c655a078736e4 Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Tue, 25 Feb 2014 17:31:06 +0000 Subject: [PATCH] [XCore] Add intrinsic for EDU (event disable unconditional) instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202171 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/IntrinsicsXCore.td | 1 + lib/Target/XCore/XCoreInstrInfo.td | 3 ++- test/CodeGen/XCore/resources.ll | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/llvm/IR/IntrinsicsXCore.td b/include/llvm/IR/IntrinsicsXCore.td index bf345d4d00c0..085644cc6416 100644 --- a/include/llvm/IR/IntrinsicsXCore.td +++ b/include/llvm/IR/IntrinsicsXCore.td @@ -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], diff --git a/lib/Target/XCore/XCoreInstrInfo.td b/lib/Target/XCore/XCoreInstrInfo.td index 0aecca064f25..2dd2fc1a7d79 100644 --- a/lib/Target/XCore/XCoreInstrInfo.td +++ b/lib/Target/XCore/XCoreInstrInfo.td @@ -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]", diff --git a/test/CodeGen/XCore/resources.ll b/test/CodeGen/XCore/resources.ll index 5385010e138b..1b50d00e3a56 100644 --- a/test/CodeGen/XCore/resources.ll +++ b/test/CodeGen/XCore/resources.ll @@ -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) @@ -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]