This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Renaming -mshort-load-bytes


The patch is fine, but I think the documentation should read:

Target specific options:
...
  -malignment-traps       The MMU will trap on unaligned accesses


`-malignment-traps'
	Generate code that will not trap if the MMU has alignment traps
	enabled.  On ARM architectures prior to ARMv4, there were no
	instructions to access half-word objects stored in memory.  However,
	when reading from memory a feature of the ARM architecture allows a
	word load to be used, even if the address is unaligned, and the
	processor core will rotate the data as it is being loaded.  This 
	option tells the compiler that such misaligned accesses will cause
	a MMU trap and that it should instead synthesise the access as
	a series of byte accesses.  The compiler can still use word accesses
	to load half-word data if it knows that the address is aligned to
	a word boundary.

	This option is ignored when compiling for ARM architecture 4 or
	later, since these processors have instructions to directly access
	half-word objects in memory.

`-mno-alignment-traps'
	Generate code that assumes that the MMU will not trap unaligned
	accesses.  This produces better code when the target instruction
	set does not have half-word memory operations (implementations
	prior to ARMv4).

	Note that you cannot use this option to access unaligned word
	objects, since the processor will only fetch one 32-bit aligned
	object from memory.

	The default setting for most targets is -mno-alignment-traps, since
	this produces better code when there are no half-word memory
	instructions available.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]