From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39925 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbLq3-0005Nk-1p for qemu-devel@nongnu.org; Fri, 07 Jan 2011 18:35:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbLq2-0005Vo-1I for qemu-devel@nongnu.org; Fri, 07 Jan 2011 18:35:18 -0500 Received: from b.c.painless.aaisp.net.uk ([81.187.30.63]:35952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbLq1-0005VN-QK for qemu-devel@nongnu.org; Fri, 07 Jan 2011 18:35:17 -0500 Date: Fri, 7 Jan 2011 23:35:03 +0000 From: Stuart Brady Subject: Re: [Qemu-devel] [PATCH 3/7] tcg-hppa: Implement deposit operation. Message-ID: <20110107233503.GA20743@zubnet.me.uk> References: <1294440183-885-1-git-send-email-rth@twiddle.net> <1294440183-885-4-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1294440183-885-4-git-send-email-rth@twiddle.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Aurelien Jarno , Alexander Graf On Fri, Jan 07, 2011 at 02:42:59PM -0800, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > tcg/hppa/tcg-target.c | 58 +++++++++++++++++++++++++++++++++++++++++++----- > tcg/hppa/tcg-target.h | 1 + > 2 files changed, 53 insertions(+), 6 deletions(-) > > diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c > index 7f4653e..2c5df57 100644 > --- a/tcg/hppa/tcg-target.c > +++ b/tcg/hppa/tcg-target.c > @@ -467,6 +467,22 @@ static inline void tcg_out_dep(TCGContext *s, int ret, int arg, > | INSN_SHDEP_CP(31 - ofs) | INSN_DEP_LEN(len)); > } > > +static inline void tcg_out_depi(TCGContext *s, int ret, int arg, ^^^ > + unsigned ofs, unsigned len) > +{ > + assert(ofs < 32 && len <= 32 - ofs); > + tcg_out32(s, INSN_DEPI | INSN_R2(ret) | INSN_IM5(val) ^^^ The parameter should be named val, too. [...] > static void tcg_out_shl(TCGContext *s, int ret, int arg, int creg) > @@ -1407,6 +1420,38 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, > } > break; > > + case INDEX_op_deposit_i32: > + { > + unsigned ofs = args[3] >> 8, len = args[3] & 0xff; > + int arg2 = args[2]; > + int arg1 = args[1]; > + int arg0 = args[0]; > + > + if (const_args[1]) { Surely const_args[1] && arg1 == 0? > + if (const_args[2]) { > + tcg_out_movi(s, TCG_TYPE_I32, arg0, > + (arg2 & ((1u << len) - 1)) << ofs); > + } else { > + tcg_out_zdep(s, arg0, arg2, ofs, len); > + } Otherwise, looks good at first glance. It'll be a few days before I can test on an HPPA box, though. Cheers, -- Stuart Brady