From 2a2cb2852632f2008acdd43a7a6501fc5c6b951c Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Wed, 23 Feb 2011 14:45:03 +0000 Subject: [PATCH] Add XCore intrinsic for settw instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126313 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IntrinsicsXCore.td | 2 ++ lib/Target/XCore/XCoreInstrInfo.td | 6 +++++- test/CodeGen/XCore/resources.ll | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/llvm/IntrinsicsXCore.td b/include/llvm/IntrinsicsXCore.td index f42511b3805..09f482f941c 100644 --- a/include/llvm/IntrinsicsXCore.td +++ b/include/llvm/IntrinsicsXCore.td @@ -43,4 +43,6 @@ let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.". [NoCapture<0>]>; def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>; + def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], + [NoCapture<0>]>; } diff --git a/lib/Target/XCore/XCoreInstrInfo.td b/lib/Target/XCore/XCoreInstrInfo.td index bf327287800..8806af2a40f 100644 --- a/lib/Target/XCore/XCoreInstrInfo.td +++ b/lib/Target/XCore/XCoreInstrInfo.td @@ -817,7 +817,7 @@ def SETD_2r : _F2R<(outs), (ins GRRegs:$r, GRRegs:$val), [(int_xcore_setd GRRegs:$r, GRRegs:$val)]>; // Two operand long -// TODO settw, setclk, setrdy, setpsc, endin, peek, +// TODO setclk, setrdy, setpsc, endin, peek, // getd, testlcl, tinitlr, getps, setps def BITREV_l2r : _FL2R<(outs GRRegs:$dst), (ins GRRegs:$src), "bitrev $dst, $src", @@ -835,6 +835,10 @@ def SETC_l2r : _FRU6<(outs), (ins GRRegs:$r, GRRegs:$val), "setc res[$r], $val", [(int_xcore_setc GRRegs:$r, GRRegs:$val)]>; +def SETTW_l2r : _FL2R<(outs), (ins GRRegs:$r, GRRegs:$val), + "settw res[$r], $val", + [(int_xcore_settw GRRegs:$r, GRRegs:$val)]>; + // One operand short // TODO edu, eeu, waitet, waitef, tstart, msync, mjoin, clrtp // setdp, setcp, setv, setev, kcall diff --git a/test/CodeGen/XCore/resources.ll b/test/CodeGen/XCore/resources.ll index b7cda589021..695efec26b2 100644 --- a/test/CodeGen/XCore/resources.ll +++ b/test/CodeGen/XCore/resources.ll @@ -16,6 +16,7 @@ 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) +declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value) define i8 addrspace(1)* @getr() { ; CHECK: getr: @@ -149,3 +150,10 @@ define void @syncr(i8 addrspace(1)* %r) { call void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r) ret void } + +define void @settw(i8 addrspace(1)* %r, i32 %value) { +; CHECK: settw: +; CHECK: settw res[r0], r1 + call void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value) + ret void +} -- 2.34.1