From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23309 invoked by alias); 20 May 2011 14:29:57 -0000 Received: (qmail 23297 invoked by uid 22791); 20 May 2011 14:29:55 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f177.google.com (HELO mail-gx0-f177.google.com) (209.85.161.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 14:29:39 +0000 Received: by gxk2 with SMTP id 2so1953764gxk.22 for ; Fri, 20 May 2011 07:29:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.115.226 with SMTP id e62mr613101yhh.117.1305901778976; Fri, 20 May 2011 07:29:38 -0700 (PDT) Received: by 10.147.125.11 with HTTP; Fri, 20 May 2011 07:29:38 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 May 2011 19:40:00 -0000 Message-ID: Subject: Re: about named address space From: Rony Paul To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00303.txt.bz2 On Tue, May 17, 2011 at 5:35 PM, Rony Paul wrote: > Rony Paul writes: > >> On Wed, May 4, 2011 at 4:35 PM, Ian Lance Taylor wrote: >>> Rony Paul writes: >>> >>>> Thank you for your reply. I am new in this development. so I am askig >>>> you =C2very basic question. I dont have enough knowledge on "backend", >>>> what did you man with this term? >>>> >>>> my task is to use one memory space as big endian, other as little >>>> endian, and to use =C2copying of pointer from 1 memory space to anothe= r. >>>> Just tell me what should be my beggining step? which files I should mo= dify? >>> >>> Please reply to the mailing list, not just to me. =C2Also, please don't >>> top-post. =C2Thanks. >>> >>> Re: backend: See http://en.wikipedia.org/wiki/Compilers . =C2In gcc the >>> backend is the CPU-specific code in config/CPU. >>> >>> You haven't said anything about your target. =C2Is your memory different >>> at the hardware level? =C2If not, named address spaces are probably not >>> the right approach. >>> >>> Ian >>> >>> >>>> Rony Paul writes: >>>> >>>>> I want to use named address space support to allow mixed endian >>>>> applications. Specifying the endianness of address spaces. >>>>> Can you suggest me what should I do in this purpose? and which files I >>>>> need to modify ? >>>> >>>> In general named address space is described here: >>>> >>>> http://gcc.gnu.org/onlinedocs/gccint/Named-Address-Spaces.html >>>> >>>> You didn't mention which backend you are using and you didn't mention >>>> how you mean to handle pointers to an address space of different >>>> endianness. =C2Named address spaces seem appropriate if some of your >>>> memory is big-endian and some is little-endian. =C2I don't know whether >>>> they are appropriate if you want to have both big-endian and >>>> little-endian pointers to the same area of memory. >>>> >>>> Ian >>> >> Thank you for the reply. >> >> Yes I have separate memory at the hardware level. And as far I learnt >> that named address space is already implemented for SPU processor. SPU >> port uses the __ea address space to refer to memory in the host >> processor, rather than memory local to the SPU processor. >> I am now just in the learning phase. SO , if I want to modify that >> code (just to learn) and want to add one more address space keyword >> like "__ea"............what should I do? > > Start by reading the link I mentioned above: > > http://gcc.gnu.org/onlinedocs/gccint/Named-Address-Spaces.html > > That explains what you do to add more address spaces. =A0It requires > modifying the gcc source code and rebuilding gcc. > > Ian > > > Dear Ian, > > Thanks for your help. I have started according to the mentioned link. > And I could give support for another address space. what I want to do > now is, I want to store data in different byte order in the new > address space. that is, suppose I have 2 address spaces supported. 1.) > Generic address space. 2.) __net address space. > > when some variable is declared in the __net address space, I will > store in Bigendian order. , and whrn variable is declared in generic > address space, It will store in little Endian order. > > Do you have any suggestion or idea?? > > -Rony > Hello, Can you explain me the following piece of code? rtx result, ls; ls =3D gen_const_mem (DImode, gen_rtx_SYMBOL_REF (Pmode, "__ea_local_store")); set_mem_align (ls, 128); result =3D gen_reg_rtx (Pmode); ls =3D force_reg (Pmode, convert_modes (Pmode, DImode, ls, 1)); op =3D force_reg (Pmode, convert_modes (Pmode, EAmode, op, 1)); ls =3D emit_conditional_move (ls, NE, op, const0_rtx, Pmode, ls, const0_rtx, Pmode, 1); emit_insn (gen_subsi3 (result, op, ls)); -Rony