diff mbox

[arm-embedded] Simply enable GCC to support -march=armv6s-m as GAS does.

Message ID 003401cc7027$e2483440$a6d89cc0$@guo@arm.com
State New
Headers show

Commit Message

Terry Guo Sept. 11, 2011, 2:09 a.m. UTC
Hello,

This patch adds simple support of -march=armv6s-m which is already supported
by GAS. With this patch, inline assembly code containing "SVC" instruction
can be handled by option -march=armv6s-m. Otherwise one has to use option
-mcpu=cortex-m0. Committed into ARM/embedded-4_6-branch.

BR,
Terry

2011-09-08  Terry Guo  <terry.guo@arm.com>

	* config/arm/arm.c (all_architectures): Simple support for
	option -march=armv6s-m.


FL_FOR_ARCH6M, NULL},
   {"armv7",   cortexa8,	  "7",	 FL_CO_PROC |
FL_FOR_ARCH7, NULL},
   {"armv7-a", cortexa8,	  "7A",	 FL_CO_PROC |
FL_FOR_ARCH7A, NULL},
   {"armv7-r", cortexr4,	  "7R",	 FL_CO_PROC |
FL_FOR_ARCH7R, NULL},

Comments

Richard Earnshaw Sept. 11, 2011, 8:23 a.m. UTC | #1
On 11 Sep 2011, at 03:10, "Terry Guo" <terry.guo@arm.com> wrote:

> Hello,
> 
> This patch adds simple support of -march=armv6s-m which is already supported
> by GAS. With this patch, inline assembly code containing "SVC" instruction
> can be handled by option -march=armv6s-m. Otherwise one has to use option
> -mcpu=cortex-m0. Committed into ARM/embedded-4_6-branch.
> 
> BR,
> Terry
> 
> 2011-09-08  Terry Guo  <terry.guo@arm.com>
> 
>    * config/arm/arm.c (all_architectures): Simple support for
>    option -march=armv6s-m.
> 
> 

Ok.

R.

> Index: gcc/config/arm/arm.c
> ===================================================================
> --- gcc/config/arm/arm.c    (revision 178753)
> +++ gcc/config/arm/arm.c    (working copy)
> @@ -933,6 +933,7 @@
>   {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC |             FL_FOR_ARCH6ZK,
> NULL},
>   {"armv6t2", arm1156t2s, "6T2", FL_CO_PROC |             FL_FOR_ARCH6T2,
> NULL},
>   {"armv6-m", cortexm1,      "6M",
> FL_FOR_ARCH6M, NULL},
> +  {"armv6s-m", cortexm1,  "6M",
> FL_FOR_ARCH6M, NULL},
>   {"armv7",   cortexa8,      "7",     FL_CO_PROC |
> FL_FOR_ARCH7, NULL},
>   {"armv7-a", cortexa8,      "7A",     FL_CO_PROC |
> FL_FOR_ARCH7A, NULL},
>   {"armv7-r", cortexr4,      "7R",     FL_CO_PROC |
> FL_FOR_ARCH7R, NULL},
> 
> 
>
Terry Guo Sept. 11, 2011, 8:36 a.m. UTC | #2
Hello Richard,

> 
> > Hello,
> >
> > This patch adds simple support of -march=armv6s-m which is already
> supported
> > by GAS. With this patch, inline assembly code containing "SVC"
> instruction
> > can be handled by option -march=armv6s-m. Otherwise one has to use
> option
> > -mcpu=cortex-m0. Committed into ARM/embedded-4_6-branch.
> >
> > BR,
> > Terry
> >
> > 2011-09-08  Terry Guo  <terry.guo@arm.com>
> >
> >    * config/arm/arm.c (all_architectures): Simple support for
> >    option -march=armv6s-m.
> >
> >
> 
> Ok.
> 
> R.

Can I apply this patch to trunk and GCC 4.6 branch?

BR,
Terry
Joseph Myers Sept. 11, 2011, 10:59 a.m. UTC | #3
On Sun, 11 Sep 2011, Terry Guo wrote:

> > > 2011-09-08  Terry Guo  <terry.guo@arm.com>
> > >
> > >    * config/arm/arm.c (all_architectures): Simple support for
> > >    option -march=armv6s-m.
> > >
> > >
> > 
> > Ok.
> > 
> > R.
> 
> Can I apply this patch to trunk and GCC 4.6 branch?

It won't apply to trunk; you'll need to patch arm-arches.def and 
regenerate the generated file arm-tables.opt.
Joseph Myers Sept. 11, 2011, 12:40 p.m. UTC | #4
On Sun, 11 Sep 2011, Terry Guo wrote:

> > It won't apply to trunk; you'll need to patch arm-arches.def and
> > regenerate the generated file arm-tables.opt.
> 
> Thanks for your help and I will do that. What else do you think I should 
> do besides that?

I have no other comments on this patch.
Richard Earnshaw Sept. 11, 2011, 2:34 p.m. UTC | #5
On 11 Sep 2011, at 09:37, "Terry Guo" <terry.guo@arm.com> wrote:

> Hello Richard,
> 
>> 
>>> Hello,
>>> 
>>> This patch adds simple support of -march=armv6s-m which is already
>> supported
>>> by GAS. With this patch, inline assembly code containing "SVC"
>> instruction
>>> can be handled by option -march=armv6s-m. Otherwise one has to use
>> option
>>> -mcpu=cortex-m0. Committed into ARM/embedded-4_6-branch.
>>> 
>>> BR,
>>> Terry
>>> 
>>> 2011-09-08  Terry Guo  <terry.guo@arm.com>
>>> 
>>>   * config/arm/arm.c (all_architectures): Simple support for
>>>   option -march=armv6s-m.
>>> 
>>> 
>> 
>> Ok.
>> 
>> R.
> 
> Can I apply this patch to trunk and GCC 4.6 branch?

Yes, once you've done as Joseph suggests.

R.
> 
> BR,
> Terry
> 
> 
> 
>
diff mbox

Patch

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 178753)
+++ gcc/config/arm/arm.c	(working copy)
@@ -933,6 +933,7 @@ 
   {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC |             FL_FOR_ARCH6ZK,
NULL},
   {"armv6t2", arm1156t2s, "6T2", FL_CO_PROC |             FL_FOR_ARCH6T2,
NULL},
   {"armv6-m", cortexm1,	  "6M",
FL_FOR_ARCH6M, NULL},
+  {"armv6s-m", cortexm1,  "6M",