From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,6373b9200cc9eb65 X-Google-Attributes: gid111c93,public From: Joachim Wesner Subject: Re: assembly programming on alphas Date: 1998/12/12 Message-ID: <36729BEF.36CA000C@frankfurt.netsurf.de>#1/1 X-Deja-AN: 421550951 Content-Transfer-Encoding: 7bit References: <36704B54.55298E9F@xs4all.nl> Content-Type: text/plain; charset=us-ascii X-Trace: 12 Dec 1998 17:39:34 -0100, deck-170.frankfurt.netsurf.de Organization: OMNILINK -- your link to the Net MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha Bram wrote: > > I've been reading DEC's Assembly Language Programmer's Guide. > But I have a couple of questions. > > How can I have egcs generate more verbose assembly output? > The samples in the guide show the C-source as comments in > the assembly file. > The output from egcc -S does not give these. To my knowledge, there is no way to have the assembly output mixed with the C-source on gcc/egcs. I would love to hear about any possibility. > Also, isn't there a more convenient method for memory > to memory copying? It seems that the only way to move > data from memory to memory, is by loading, and then > storing registers. > On Intel, I use movsb/movsw/movsl a lot, but there > does not seem to be an alpha-equivalent. NOPE, there is none. This is RISC philosophy, resp, the "load & store" architecture. Basically, the idea is to use the multiple issue possiblities, branch prediction etc. to emulate the x86 instructions at the same speed. Also, x86 mov** does no real memory to memory copy (some DMA controllers allow this if your memory subsystem can handle it), but instead feed it in parts through a temporary processor register. > I am curious how memcpy is implemented on the alpha. > What is the fastest way to copy, say, 32 bytes or more > from one location to another? And what if the data > is not alligned? If it's not aligned, you will get a slowdown due to the need to copy in smaller bunches. HOWEVER, the very same happens on x86, even if it is all handled in hardware/microcode. Alpha philosphy again is to avoid (if possible) any "non naturally" aligned data like "the plague". Actually, I do not know the source for memcpy on Linux/AXP. You could assemble/compile a simple program that uses it and look inside with gdb to get an idea how it is implemented. Joachim