From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2036 invoked by alias); 30 Nov 2001 02:20:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2015 invoked from network); 30 Nov 2001 02:20:53 -0000 Received: from unknown (HELO localhost.cygnus.com) (216.138.202.10) by hostedprojects.ges.redhat.com with SMTP; 30 Nov 2001 02:20:53 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 96F573DE9; Thu, 29 Nov 2001 21:20:52 -0500 (EST) Message-ID: <3C06ED04.70005@cygnus.com> Date: Wed, 21 Nov 2001 04:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Kevin Buettner , Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA] W.I.P. AltiVec ppc registers support. References: <15365.39495.801289.497931@krustylu.cygnus.com> <1011129183830.ZM18856@ocotillo.lan> <15366.44991.616576.411278@krustylu.cygnus.com> <1011129222000.ZM19585@ocotillo.lan> <20011129174621.B15429@nevyn.them.org> <1011129231229.ZM19791@ocotillo.lan> <20011129183732.A17705@nevyn.them.org> <1011129234527.ZM19890@ocotillo.lan> <20011129185802.A18421@nevyn.them.org> <3C06D034.4070007@cygnus.com> <20011129203801.A21872@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00383.txt.bz2 Message-ID: <20011121041000.CZ1-9W383ftAM8WoboM_D6EtGhal5AdZR1ZZOwO0sRw@z> >> > >> > >> >How does it work? Badly. >> > >> >The types look like this right now: >> > >> >+typedef unsigned char elf_greg_t[4]; >> >+typedef unsigned char elf_fpreg_t[8]; >> >+typedef struct { >> >+ unsigned char u[16]; >> >+} __attribute((aligned(16))) __uint128_t; >> >+/* Altivec registers */ >> >+typedef __uint128_t elf_vrreg_t; > >> >> Hmm, Kevin did have good reason to be concerned. That is wrong. >> Mechanisms similar to shlib et.al. should be used. > > > What is wrong with it? > > I agree that it is messy, but it is completely correct. I know of no > platform with 8-bit bytes stupid enough to do this any way other than > the way I intend. Several things come to mind: the __attribute() - there are alignment independant functions for packing/unpacking/copying stuff; the __unint128_t is is a name in system space. The shlib code does this by describing the actual layout using a very thin interface (like how remote.c unpacks the g-packet) so host issues aren't a problem (but yes, it would be a suprise to find one that didn't have 8 bit chars). The other way of doing this is more like C++ where it creates a ``struct type'' to describe the structure exactly how the target sees it. enjoy, Andrew