From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22360 invoked by alias); 25 Jan 2007 14:20:50 -0000 Received: (qmail 22349 invoked by uid 22791); 25 Jan 2007 14:20:49 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO elsdt-razorfish.arc.com) (194.202.198.226) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 Jan 2007 14:20:40 +0000 Received: from elsdt-razorfish.arc.com (localhost.localdomain [127.0.0.1]) by elsdt-razorfish.arc.com (8.12.11.20060308/8.12.11) with ESMTP id l0PEKa93004750 for ; Thu, 25 Jan 2007 14:20:36 GMT Received: (from joernr@localhost) by elsdt-razorfish.arc.com (8.12.11.20060308/8.12.11/Submit) id l0PEKaMu004747 for cgen@sources.redhat.com; Thu, 25 Jan 2007 14:20:36 GMT Date: Thu, 25 Jan 2007 14:20:00 -0000 From: Joern Rennecke To: cgen@sources.redhat.com Subject: CGEN_DIS_HASH: how to get endianness and/or instruction size? Message-ID: <20070125142036.GA18395@elsdt-razorfish.arc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00024.txt.bz2 The ARCompact architecture has both 16 and 32 bit opcodes, and each can take an optional 32 bit immediate. Moreover, this is a bi-endian architecture. So, inside CGEN_DIS_HASH, how can I get the first 16 bits of the instruction, represented in host byte order? If I want to dereference the buffer pointer, I need to know the target endianness. If I want to use the passed instruction value, I need to know what size it is. Note that there are valid 32 bit opcodes which have all upper 16 bits cleared. It is also not quite clear if I can use this value if there is a 32 bit immediate attached to the opcode.