Unaligned 64-bits access on FreeBSD/powerpc
David Edelsohn
dje at watson.ibm.com
Thu Aug 3 19:30:32 UTC 2006
>>>>> Peter Grehan writes:
>> atype = "64";
>> for (i = 0; i < 256; i++) {
>> apoint = (uint8_t *)&(buf[i]);
>> v64 = *(uint64_t *)apoint;
>> }
Peter> Would you be able to do a disassembly on this ? I suspect gcc is using
Peter> floating-point regs to do the 64-bit loads.
That does not matter. The OS is suppose to catch the misaligned
load and emulate the instruction in a handler. If FreeBSD cannot handle
that, then it needs to configure GCC for PowerPC in strict-alignment
embedded mode, which is ABI incompatible. If FreeBSD wants to use the
standard PPC SVR4 ABI or PPC32 Linux variant, it must support any
misaligned load. That is the OS's responsibility, period.
David
More information about the freebsd-ppc
mailing list