public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,ARM/Thumb1]Fix 'mov' instruction for Thumb-1 UAL
@ 2014-11-11  8:41 Terry Guo
  2014-11-11  8:44 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 2+ messages in thread
From: Terry Guo @ 2014-11-11  8:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ramana Radhakrishnan

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

Hi there,

Attached patch intends to fix below trunk failure caused by recent thumb-1
UAL patch:

/tmp/cc9EfnXy.s: Assembler messages:
/tmp/cc9EfnXy.s:69: Error: MOV Rd, Rs with two low registers is not
permitted on this architecture -- `mov r6,r7'

Now for pre-v6 Thumb-1, the 'movs' will be used rather than the 'mov'.

The multilib for ARM/Thumb1/hard-float all can be built. Tested with
regression test on armv4t thumb and v6m thumb. No regression. Is it ok to
trunk?

BR,
Terry

2014-11-11  Terry Guo  <terry.guo@arm.com>

     * doc/invoke.texi (-masm-syntax-unified): Reword and fix typo.
     * config/arm/thumb1.md (*thumb_mulsi3): Use movs to move low registers.
     (*thumb1_movhf): Likewise.

[-- Attachment #2: fix-thumb1-mov-v2.txt --]
[-- Type: text/plain, Size: 1772 bytes --]

diff --git a/gcc/config/arm/thumb1.md b/gcc/config/arm/thumb1.md
index 8a2abe9..3d6f80b 100644
--- a/gcc/config/arm/thumb1.md
+++ b/gcc/config/arm/thumb1.md
@@ -131,12 +131,10 @@
 	(mult:SI (match_operand:SI 1 "register_operand" "%l,*h,0")
 		 (match_operand:SI 2 "register_operand" "l,l,l")))]
  "TARGET_THUMB1 && !arm_arch6"
-  "*
-  if (which_alternative < 2)
-    return \"mov\\t%0, %1\;muls\\t%0, %2\";
-  else
-    return \"muls\\t%0, %2\";
-  "
+  "@
+   movs\\t%0, %1\;muls\\t%0, %2
+   mov\\t%0, %1\;muls\\t%0, %2
+   muls\\t%0, %2"
   [(set_attr "length" "4,4,2")
    (set_attr "type" "muls")]
 )
@@ -787,6 +785,8 @@
   "*
   switch (which_alternative)
     {
+    case 0:
+      return \"movs\\t%0, %1\";
     case 1:
       {
 	rtx addr;
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index cd20b6e..13270bc 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -13040,13 +13040,11 @@ off by default.
 
 @item -masm-syntax-unified
 @opindex masm-syntax-unified
-Assume the Thumb1 inline assembly code are using unified syntax.
-The default is currently off, which means divided syntax is assumed.
+Assume inline assembler is using unified asm syntax.  The default is
+currently off which implies divided syntax.  Currently this option is
+available only for Thumb1 and has no effect on ARM state and Thumb2.
 However, this may change in future releases of GCC.  Divided syntax
-should be considered deprecated.  This option has no effect when
-generating Thumb2 code.  Thumb2 assembly code always uses unified syntax.
-This option has no effect for ARM state assembly code which will still
-uses divided syntax.
+should be considered deprecated.
 
 @item -mrestrict-it
 @opindex mrestrict-it

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch,ARM/Thumb1]Fix 'mov' instruction for Thumb-1 UAL
  2014-11-11  8:41 [Patch,ARM/Thumb1]Fix 'mov' instruction for Thumb-1 UAL Terry Guo
@ 2014-11-11  8:44 ` Ramana Radhakrishnan
  0 siblings, 0 replies; 2+ messages in thread
From: Ramana Radhakrishnan @ 2014-11-11  8:44 UTC (permalink / raw)
  To: Terry Guo, gcc-patches



On 11/11/14 08:40, Terry Guo wrote:
> Hi there,
>
> Attached patch intends to fix below trunk failure caused by recent thumb-1
> UAL patch:
>
> /tmp/cc9EfnXy.s: Assembler messages:
> /tmp/cc9EfnXy.s:69: Error: MOV Rd, Rs with two low registers is not
> permitted on this architecture -- `mov r6,r7'
>
> Now for pre-v6 Thumb-1, the 'movs' will be used rather than the 'mov'.
>
> The multilib for ARM/Thumb1/hard-float all can be built. Tested with
> regression test on armv4t thumb and v6m thumb. No regression. Is it ok to
> trunk?

This is OK.

Ramana

>
> BR,
> Terry
>
> 2014-11-11  Terry Guo  <terry.guo@arm.com>
>
>       * doc/invoke.texi (-masm-syntax-unified): Reword and fix typo.
>       * config/arm/thumb1.md (*thumb_mulsi3): Use movs to move low registers.
>       (*thumb1_movhf): Likewise.
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-11  8:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11  8:41 [Patch,ARM/Thumb1]Fix 'mov' instruction for Thumb-1 UAL Terry Guo
2014-11-11  8:44 ` Ramana Radhakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).