Xref: utzoo comp.arch:13330 comp.lang.c:25286 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.arch,comp.lang.c Subject: Re: RISC Machine Data Structure Word Alignment Problems? Summary: How expensive in unaligned? Keywords: risc sun Message-ID: <1852@l.cc.purdue.edu> Date: 23 Jan 90 11:43:53 GMT References: <111@melpar.UUCP> <1990Jan21.224826.1699@esegue.segue.boston.ma.us> Followup-To: comp.arch Organization: Purdue University Statistics Department Lines: 20 In article , peter@ficc.uu.net (Peter da Silva) writes: > > I guess all the world's not a Vax any more, now it's a 68020. > > Worse, since non-word-aligned values do cost extra cycles to access, any > 68020 C compiler that didn't pad that structure is broken. Some "features" > of CISC processors are just too expensive to use. Having seen the statement about penalties for unaligned, I tried the following code (hand coded in assembler to eliminate unnecessary overhead): ..... while(k < end)*k++ = *i++ ^ *j++; and the j pointer was deliberately unaligned. Now this was on a VAX, and it is possible that other machines may give different results, but the time penalty, while there, was not excessive. -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)