Path: utzoo!attcan!uunet!brunix!doorknob!wsd From: wsd@cs.brown.edu (Wm. Scott `Spot' Draves) Newsgroups: comp.arch Subject: Re: RISC hard to program? (was: Moto's data predicts...) Message-ID: Date: 14 Jul 90 22:44:53 GMT References: <40088@mips.mips.COM> <2162@opus.cs.mcgill.ca> <1990Jul13.071511.22250@Neon.Stanford.EDU> Sender: news@brunix.UUCP Organization: Department of Computer Science, Brown University Lines: 38 In-reply-to: kaufman@Neon.Stanford.EDU's message of 13 Jul 90 07:15:11 GMT In article <1990Jul13.071511.22250@Neon.Stanford.EDU> kaufman@Neon.Stanford.EDU (Marc T. Kaufman) writes: SPARC requires fullword alignment for 32-bit operands and DOUBLEword alignment (e.g. 8-bytes) for 64-bit operands, in memory. Are you sure? I think doubles can be loaded from 4 byte boundaries. Witness the following code, which runs fine on this SS1: main() { char data[12]; double d, *dp; dp = (double *)(data + 0); *dp = 66.6; printf("%g\n", *dp); dp = (double *)(data + 4); *dp = 66.6; printf("%g\n", *dp); } Data misalignment problems are independent of how well a program is written, especially if the program was written for another target architecture. no way. A correctly written program will have no problems with alignment on any architecture. Can you give an example of correct code that will fail? (I am assuming that well written programs are correct :) Marc Kaufman (kaufman@Neon.stanford.edu) -- Scott Draves Space... The Final Frontier wsd@cs.brown.edu uunet!brunix!wsd