From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19611 invoked by alias); 25 Oct 2004 15:58:22 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 19531 invoked from network); 25 Oct 2004 15:58:15 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 25 Oct 2004 15:58:15 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id i9PFwFCH001699 for ; Mon, 25 Oct 2004 11:58:15 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9PFwFr12226 for ; Mon, 25 Oct 2004 11:58:15 -0400 Received: from scox.laptop (scox.rdu.redhat.com [172.16.57.29]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i9PFwFl4004825; Mon, 25 Oct 2004 11:58:15 -0400 To: cgen@sources.redhat.com Subject: x86-like target From: Stan Cox Organization: Red Hat, RDU, NC, USA Date: Mon, 25 Oct 2004 15:58:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-q4/txt/msg00005.txt.bz2 What is the best way to handle an x86 like target wrt endianness? By x86 like I mean: 1. instructions are variable length "big endian" bytestreams 2. immediate and address fields within instructions are little endian 3. the processor is little endian Defining as: (default-insn-bitsize 32) (base-insn-bitsize 32) (default-insn-word-bitsize 32) derived/anyof operands big endian bfd pass CGEN_ENDIAN_BIG to m16c_cgen_cpu_open assembles instructions correctly except immediates and displacements are, of course, big endian. Changing: little endian bfd pass CGEN_ENDIAN_BIG to m16c_cgen_cpu_open set BFD_ENDIAN_BIG in disassemble.c assembles instructions correctly except immediates and displacements are still not correct and relocations cannot be handled by the generic relocation handler since instruction bytes are now fetched in little endian order. What is the best way to support this so that immediates from cgen, addresses from gas, and addresses and relocations from ld are all handled correctly?