Re: Architectures with strict alignment?
- From: perryh@xxxxxxxxxxxxxx
- Date: Sat, 29 Dec 2007 22:09:44 -0800
Ivan Voras <freebsd.org!ivoras@xxxxxxxxxxxxxxx> wrote:
perryh@xxxxxxxxxxxxxx wrote:
The degree to which a PowerPC imposes a strict alignment
requirement depends on both the particular processor model
and the operation being performed.
For ordinary integer arithmetic and logical operations, newer
PPC processors tend to be more tolerant (although misalignment
will typically carry a performance penalty) ...
How would it behave in operations like
x = x + 1
where x is unaligned in memory? A RISC would have to load the
value from memory, increment it and store it.
It depends on the processor type. IIRC most of the recent ones
(7xx, 74xx) will handle it in hardware, taking a few extra cycles
to do the extra memory accesses. Some of the older ones (403)
will take an alignment exception, which can potentially be fixed
up by a handler but at a cost of, at least, hundreds of cycles --
and only if the OS or the application has provided the handler.
I recently ran into a case where a PPC970 took an alignment
exception on something resembling this, but I think it was because
the data cache was disabled (the 970's hardware misalignment handler
being part of the cache logic).
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Architectures with strict alignment?
- From: Ivan Voras
- Re: Architectures with strict alignment?
- From: M. Warner Losh
- Re: Architectures with strict alignment?
- From: perryh
- Re: Architectures with strict alignment?
- From: Ivan Voras
- Architectures with strict alignment?
- Prev by Date: Re: BSD license compatible hash algorithm?
- Next by Date: Re: Architectures with strict alignment?
- Previous by thread: Re: Architectures with strict alignment?
- Index(es):
Relevant Pages
- Re: will the memory allocated by malloc get released when program exits?
... Always free all memory you allocate. ... Let's examine for a moment how one
can come across a SIGSEGV: ... why one should not allocate or free memory within a SIGSEGV
handler. ... But it's the undefined behavior that's the underlying problem. ...
(comp.lang.c) - Re: Win32: Using SEH to search memory
... //push the address of our exception handler ... //Now we have to adjust our
thread information block to reflect we may be anywhere in memory ... //As of Windows
XP SP1, you cannot have your exception handler itself on the stack - but most versions of windows
check to make sure your exception blcck is on the stack. ... (Vuln-Dev) - Re: Memory management
... The real problem for me is that I would like to use the data cache in the ...
ARM but it require the MMU to be enabled ... and MMU requires some RAM for working.
... I understand caching and memory protection are similar in some points but I ...
(comp.arch.embedded) - Re: PPC405 32 bit aligned accesses
... If the data cache is in write-back mode and is turned on for a certain memory region
you will not see byte, ... You can do that with a small program running from BRAM and the
jump to the entry point of the application in the DDR2 memory. ... Linux uses the MMU to
set up cacheable regions, ie. it will/may put descriptors into uncacheable areas. ... (comp.arch.fpga) - Re: PPC405 32 bit aligned accesses
... If the data cache is in write-back mode and is turned on for a certain memory region
you will not see byte, ... You can do that with a small program running from BRAM and the
jump to the entry point of the application in the DDR2 memory. ... Linux uses the MMU to
set up cacheable regions, ie. it will/may put descriptors into uncacheable areas. ... (comp.arch.fpga)