Re: Commit: ARM: Document -munaligned-access

2012-07-18 Thread Ramana Radhakrishnan
On 18 July 2012 07:51, Nick Clifton  wrote:
> Hi Guys,
>
>   I am checking in this patch to the mainline to document the ARM port's
>   -munaligned-access command line option.

Could you ask if RM's object to backporting this to the 4.7 branch. ?

Thanks,
ramana

>
> Cheers
>   Nick
>
> gcc/ChangeLog
> 2012-07-18  Nick Clifton  
>
> * doc/invoke.texi (ARM Options): Document -munaligned-access.
>
> Index: gcc/doc/invoke.texi
> ===
> --- gcc/doc/invoke.texi (revision 189603)
> +++ gcc/doc/invoke.texi (working copy)
> @@ -497,7 +497,8 @@
>  -mcaller-super-interworking  -mcallee-super-interworking @gol
>  -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
>  -mword-relocations @gol
> --mfix-cortex-m3-ldrd}
> +-mfix-cortex-m3-ldrd @gol
> +-munaligned-access}
>
>  @emph{AVR Options}
>  @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
> @@ -11049,6 +11050,23 @@
>  generating these instructions.  This option is enabled by default when
>  @option{-mcpu=cortex-m3} is specified.
>
> +@item -munaligned-access
> +@itemx -mno-unaligned-access
> +@opindex munaligned-access
> +@opindex mno-unaligned-access
> +Enables (or disables) reading and writing of 16- and 32- bit values
> +from addresses that are not 16- or 32- bit aligned.  By default
> +unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
> +architectures, and enabled for all other architectures.  If unaligned
> +access is not enabled then words in packed data structures will be
> +accessed a byte at a time.
> +
> +The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
> +generated object file to either true or false, depending upon the
> +setting of this option.  If unaligned access is enabled then the
> +preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
> +defined.
> +
>  @end table
>
>  @node AVR Options


Re: Commit: ARM: Document -munaligned-access

2012-07-19 Thread Hans-Peter Nilsson
> From: Nick Clifton 
> Date: Wed, 18 Jul 2012 08:51:16 +0200


> 2012-07-18  Nick Clifton  
> 
> * doc/invoke.texi (ARM Options): Document -munaligned-access.
> 
> Index: gcc/doc/invoke.texi
> ===
> --- gcc/doc/invoke.texi   (revision 189603)
> +++ gcc/doc/invoke.texi   (working copy)
> @@ -497,7 +497,8 @@
>  -mcaller-super-interworking  -mcallee-super-interworking @gol
>  -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
>  -mword-relocations @gol
> --mfix-cortex-m3-ldrd}
> +-mfix-cortex-m3-ldrd @gol
> +-munaligned-access}
>  
>  @emph{AVR Options}
>  @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
> @@ -11049,6 +11050,23 @@
>  generating these instructions.  This option is enabled by default when
>  @option{-mcpu=cortex-m3} is specified.
>  
> +@item -munaligned-access
> +@itemx -mno-unaligned-access
> +@opindex munaligned-access
> +@opindex mno-unaligned-access
> +Enables (or disables) reading and writing of 16- and 32- bit values
> +from addresses that are not 16- or 32- bit aligned.  By default
> +unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
> +architectures, and enabled for all other architectures.

*cough*

Sounds like a call for a note in changes.html, to warn people
that they have to turn on the alignment feature in their startup
code (for whatever OS) for their ARMv6-or-later targets, if they
have not already done so.

Maybe something like:

> > Index: changes.html
> > ===
> > RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
> > retrieving revision 1.113
> > diff -p -u -r1.113 changes.html
> > --- changes.html5 Jun 2012 11:03:53 -   1.113
> > +++ changes.html15 Jun 2012 02:04:46 -
> > @@ -43,6 +43,19 @@
> >  
> >  
> >  
> > +On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
> > +ARMv7-R, or ARMv7-M, the new option
> > +-munaligned-access is active by default, which for
> > +some source codes generates code that accesses memory on unaligned
> > +adresses.  This will require the kernel of those systems to enable
> > +such accesses (controlled by CP15 register c1, refer
> > +to ARM documentation).  Alternatively or for compatibility with
> > +kernels where unaligned accesses are not supported, all code has
> > +to be compiled with -mno-unaligned-access.
> > +Linux/ARM in official releases has automatically and
> > +unconditionally supported unaligned accesses as emitted by GCC due
> > +to this option being active since Linux version 2.6.28.
> > +
> >  Support on ARM for the legacy floating-point accelerator (FPA) and
> >  the mixed-endian floating-point format that it used has been obsoleted.
> >  The ports that still use this format have been obsoleted as well.
> > 
> 



Sorry, but I couldn't miss the opportunity to ping this now that
the ARM maintainers have this issue in their L1-cache.  A simple
yes or no would do; I don't see what could possibly need any
contemplation regarding this note.

brgds, H-P



Re: Commit: ARM: Document -munaligned-access

2012-07-20 Thread nick clifton

Hi H-P,


*cough*

Sounds like a call for a note in changes.html, to warn people
that they have to turn on the alignment feature in their startup
code (for whatever OS) for their ARMv6-or-later targets, if they
have not already done so.


What a good idea :-)



Maybe something like:


Index: changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.113
diff -p -u -r1.113 changes.html
--- changes.html5 Jun 2012 11:03:53 -   1.113
+++ changes.html15 Jun 2012 02:04:46 -
@@ -43,6 +43,19 @@

  

+On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
+ARMv7-R, or ARMv7-M, the new option
+-munaligned-access is active by default, which for
+some source codes generates code that accesses memory on unaligned
+adresses.  This will require the kernel of those systems to enable
+such accesses (controlled by CP15 register c1, refer
+to ARM documentation).  Alternatively or for compatibility with
+kernels where unaligned accesses are not supported, all code has
+to be compiled with -mno-unaligned-access.
+Linux/ARM in official releases has automatically and
+unconditionally supported unaligned accesses as emitted by GCC due
+to this option being active since Linux version 2.6.28.
+
  Support on ARM for the legacy floating-point accelerator (FPA) and
  the mixed-endian floating-point format that it used has been obsoleted.
  The ports that still use this format have been obsoleted as well.







Sorry, but I couldn't miss the opportunity to ping this now that
the ARM maintainers have this issue in their L1-cache.  A simple
yes or no would do; I don't see what could possibly need any
contemplation regarding this note.


Agreed - in fact agreed so much that as an ARM maintainer I say 
"approved - please apply".


Cheers
  Nick


Re: Commit: ARM: Document -munaligned-access

2012-07-20 Thread Ryan Mansfield

On 12-07-19 05:33 PM, Hans-Peter Nilsson wrote:

Maybe something like:


Index: changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.113
diff -p -u -r1.113 changes.html
--- changes.html5 Jun 2012 11:03:53 -   1.113
+++ changes.html15 Jun 2012 02:04:46 -
@@ -43,6 +43,19 @@

  

+On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
+ARMv7-R, or ARMv7-M, the new option
+-munaligned-access is active by default, which for
+some source codes generates code that accesses memory on unaligned
+adresses.  This will require the kernel of those systems to enable


adresses -> addresses.

Regards,

Ryan Mansfield



Re: Commit: ARM: Document -munaligned-access

2012-07-20 Thread Hans-Peter Nilsson
> From: nick clifton 
> Date: Fri, 20 Jul 2012 09:18:52 +0200

> "approved - please apply".

Thanks!  I see the last sentence could do with better
punctuation, so I added the obvious comma.  Installed as
follows.

Index: changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.121
diff -p -u -r1.121 changes.html
--- changes.html15 Jul 2012 15:04:38 -  1.121
+++ changes.html20 Jul 2012 13:35:48 -
@@ -43,6 +43,19 @@
 
 
 
+On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
+ARMv7-R, or ARMv7-M, the new option
+-munaligned-access is active by default, which for
+some source codes generates code that accesses memory on unaligned
+adresses.  This will require the kernel of those systems to enable
+such accesses (controlled by CP15 register c1, refer
+to ARM documentation).  Alternatively or for compatibility with
+kernels where unaligned accesses are not supported, all code has
+to be compiled with -mno-unaligned-access.
+Linux/ARM in official releases has automatically and
+unconditionally supported unaligned accesses as emitted by GCC due
+to this option being active, since Linux version 2.6.28.
+
 Support on ARM for the legacy floating-point accelerator (FPA) and
 the mixed-endian floating-point format that it used has been obsoleted.
 The ports that still use this format have been obsoleted as well.


brgds, H-P


Re: Commit: ARM: Document -munaligned-access

2012-07-22 Thread Hans-Peter Nilsson
On Fri, 20 Jul 2012, Ryan Mansfield wrote:
> On 12-07-19 05:33 PM, Hans-Peter Nilsson wrote:
> > > > Index: changes.html
> > > > +some source codes generates code that accesses memory on unaligned
> > > > +adresses.  This will require the kernel of those systems to enable
>
> adresses -> addresses.

Thanks, fixed.

brgds, H-P


Fwd: Re: Commit: ARM: Document -munaligned-access

2012-07-18 Thread nick clifton

Hi Richard,

  I have a documentation update for the 4.7 branch.  Is it OK to apply 
this ?


Cheers
  Nick


gcc/ChangeLog
2012-07-18  Nick Clifton  

* doc/invoke.texi (ARM Options): Document -munaligned-access.

Index: gcc/doc/invoke.texi
===
--- gcc/doc/invoke.texi (revision 189603)
+++ gcc/doc/invoke.texi (working copy)
@@ -497,7 +497,8 @@
 -mcaller-super-interworking  -mcallee-super-interworking @gol
 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
 -mword-relocations @gol
--mfix-cortex-m3-ldrd}
+-mfix-cortex-m3-ldrd @gol
+-munaligned-access}

 @emph{AVR Options}
 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
@@ -11049,6 +11050,23 @@
 generating these instructions.  This option is enabled by default when
 @option{-mcpu=cortex-m3} is specified.

+@item -munaligned-access
+@itemx -mno-unaligned-access
+@opindex munaligned-access
+@opindex mno-unaligned-access
+Enables (or disables) reading and writing of 16- and 32- bit values
+from addresses that are not 16- or 32- bit aligned.  By default
+unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
+architectures, and enabled for all other architectures.  If unaligned
+access is not enabled then words in packed data structures will be
+accessed a byte at a time.
+
+The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
+generated object file to either true or false, depending upon the
+setting of this option.  If unaligned access is enabled then the
+preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
+defined.
+
 @end table

 @node AVR Options







Re: Fwd: Re: Commit: ARM: Document -munaligned-access

2012-07-18 Thread Richard Guenther
On Wed, 18 Jul 2012, nick clifton wrote:

> Hi Richard,
> 
>   I have a documentation update for the 4.7 branch.  Is it OK to apply this ?

Sure.

Thanks,
Richard.

> Cheers
>   Nick
> 
> > gcc/ChangeLog
> > 2012-07-18  Nick Clifton  
> > 
> > * doc/invoke.texi (ARM Options): Document -munaligned-access.
> > 
> > Index: gcc/doc/invoke.texi
> > ===
> > --- gcc/doc/invoke.texi (revision 189603)
> > +++ gcc/doc/invoke.texi (working copy)
> > @@ -497,7 +497,8 @@
> >  -mcaller-super-interworking  -mcallee-super-interworking @gol
> >  -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
> >  -mword-relocations @gol
> > --mfix-cortex-m3-ldrd}
> > +-mfix-cortex-m3-ldrd @gol
> > +-munaligned-access}
> > 
> >  @emph{AVR Options}
> >  @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
> > @@ -11049,6 +11050,23 @@
> >  generating these instructions.  This option is enabled by default when
> >  @option{-mcpu=cortex-m3} is specified.
> > 
> > +@item -munaligned-access
> > +@itemx -mno-unaligned-access
> > +@opindex munaligned-access
> > +@opindex mno-unaligned-access
> > +Enables (or disables) reading and writing of 16- and 32- bit values
> > +from addresses that are not 16- or 32- bit aligned.  By default
> > +unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
> > +architectures, and enabled for all other architectures.  If unaligned
> > +access is not enabled then words in packed data structures will be
> > +accessed a byte at a time.
> > +
> > +The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
> > +generated object file to either true or false, depending upon the
> > +setting of this option.  If unaligned access is enabled then the
> > +preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
> > +defined.
> > +
> >  @end table
> > 
> >  @node AVR Options
> 
> 
> 
> 
> 

-- 
Richard Guenther 
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend