Date: Thu, 03 Aug 2006 12:38:51 -0700 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Peter Grehan <grehan@FreeBSD.org> Cc: freebsd-ppc@FreeBSD.org Subject: Re: Unaligned 64-bits access on FreeBSD/powerpc Message-ID: <44D250CB.9050203@FreeBSD.org> In-Reply-To: <44D24A3F.5080407@freebsd.org> References: <44D23F02.9020709@FreeBSD.org> <200608031826.k73IQX835138@makai.watson.ibm.com> <44D2419F.1050100@FreeBSD.org> <44D245E5.4070102@freebsd.org> <44D24772.7080109@FreeBSD.org> <44D24A3F.5080407@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Peter Grehan wrote: >> According to the following link, unaligned floating-point 64-bits >> access isn't supported in the PowerPC: >> >> http://www-128.ibm.com/developerworks/library/pa-dalign/ > > Yep, that's right: I should have mentioned that unaligned ints are OK. > Which your program demonstrates :) > >> atype = "64"; >> for (i = 0; i < 256; i++) { >> apoint = (uint8_t *)&(buf[i]); >> v64 = *(uint64_t *)apoint; >> } > > Would you be able to do a disassembly on this ? I suspect gcc is using > floating-point regs to do the 64-bit loads. --- test.c ---- long long test(void) { volatile long long *foo = (long long *)0x1234; return(*foo); } --- test.s --- test: stwu 1,-32(1) stw 31,28(1) mr 31,1 li 0,4660 stw 0,8(31) lwz 9,8(31) lfd 0,0(9) stfd 0,16(31) lwz 9,16(31) lwz 10,20(31) mr 3,9 mr 4,10 lwz 11,0(1) lwz 31,-4(11) mr 1,11 blr -Maxim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44D250CB.9050203>