From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe0Su-0002kA-KT for qemu-devel@nongnu.org; Tue, 14 Oct 2014 07:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xe0So-0005os-EC for qemu-devel@nongnu.org; Tue, 14 Oct 2014 07:40:32 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:12570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe0So-0005np-62 for qemu-devel@nongnu.org; Tue, 14 Oct 2014 07:40:26 -0400 Message-ID: <543D0BA1.3000909@imgtec.com> Date: Tue, 14 Oct 2014 12:40:17 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1412765732-45369-1-git-send-email-leon.alrae@imgtec.com> <1412765732-45369-15-git-send-email-leon.alrae@imgtec.com> <543BD5AC.2030106@imgtec.com> In-Reply-To: <543BD5AC.2030106@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 14/21] target-mips: add AUI, LSA and PCREL instruction families List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yongbok Kim , qemu-devel@nongnu.org Cc: james.hogan@imgtec.com, aurelien@aurel32.net, rth@twiddle.net Hi Yongbok, On 13/10/2014 14:37, Yongbok Kim wrote: >> + OPC_PCREL = (0x3B << 26), >> +}; >> + >> +/* PC-relative address computation / loads */ >> +#define MASK_OPC_PCREL_TOP2BITS(op) (MASK_OP_MAJOR(op) | (op & (3 << >> 19))) >> +#define MASK_OPC_PCREL_TOP5BITS(op) (MASK_OP_MAJOR(op) | (op & (0x1f >> << 16))) > > There must be better name for this macro. > It confused me that was looking like 31 and 30 bits. > Just naming though... TOP2BITS and TOP5BITS are referring to "TTTTT" bits. R6 PC-relative family encoding: 111011.rs.TTTTT.imm16 Instructions: 111011.rs.00.<-----imm19> ADDIUPC 111011.rs.01.<----disp19> LWPC 111011.rs.10.<----disp19> LWUPC 111011.rs.110.<---disp18> LDPC 111011.rs.1110.<---imm17> reserved 111011.rs.11110.<--imm16> AUIPC 111011.rs.11111.<--imm16> ALUIPC I couldn't come up with better name having reasonable length, any suggestions are welcome. Thanks, Leon