public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][GAS][ARM] Fix for POP {regs}^ problem
@ 2015-03-06 16:23 Michael Perkins
  2015-03-06 16:34 ` Kyrill Tkachov
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Perkins @ 2015-03-06 16:23 UTC (permalink / raw)
  To: binutils

Here is a diff for a patch to fix a problem with gas accepting the POP {reglist}^ instruction. It was encoding this in the same way as the POP {reglist} instruction. The patch rejects the POP {reglist}^ instruction in ARM mode (previously only rejected in THUMB mode). 

gas/ChangeLog: 

2015-03-06  Michael Perkins <perkinsmg75@yahoo.co.uk> 

* config/tc-arm.c (parse_operands): Set inst.operands[i].writeback for '^' on OP_REGLSTs. 
(do_push_pop): New writeback constraint. 



diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 08155ac..136e52c 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7042,7 +7042,7 @@ parse_operands (char *str, const
unsigned int *pattern, bf
          val =
parse_reg_list (&str);
          if (*str
== '^')
            {
-             inst.operands[1].writeback = 1;
+             inst.operands[i].writeback = 1;
              str++;
            }
          break;
@@ -9040,6 +9040,8 @@ do_pli (void)
 static void
 do_push_pop (void)
 {
+  constraint
(inst.operands[0].writeback,
+             _("push/pop do not support {reglist}^"));
   inst.operands[1]
= inst.operands[0];
   memset
(&inst.operands[0], 0, sizeof inst.operands[0]);
   inst.operands[0].isreg = 1;

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

* Re: [PATCH][GAS][ARM] Fix for POP {regs}^ problem
  2015-03-06 16:23 [PATCH][GAS][ARM] Fix for POP {regs}^ problem Michael Perkins
@ 2015-03-06 16:34 ` Kyrill Tkachov
  2015-03-06 17:14   ` Michael Perkins
  0 siblings, 1 reply; 4+ messages in thread
From: Kyrill Tkachov @ 2015-03-06 16:34 UTC (permalink / raw)
  To: Michael Perkins, binutils

Hi Michael,

On 06/03/15 16:20, Michael Perkins wrote:
> Here is a diff for a patch to fix a problem with gas accepting the POP {reglist}^ instruction. It was encoding this in the same way as the POP {reglist} instruction. The patch rejects the POP {reglist}^ instruction in ARM mode (previously only rejected in THUMB mode).
>
> gas/ChangeLog:
>
> 2015-03-06  Michael Perkins <perkinsmg75@yahoo.co.uk>
>
> * config/tc-arm.c (parse_operands): Set inst.operands[i].writeback for '^' on OP_REGLSTs.
> (do_push_pop): New writeback constraint.
>
>
>
> diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
> index 08155ac..136e52c 100644
> --- a/gas/config/tc-arm.c
> +++ b/gas/config/tc-arm.c
> @@ -7042,7 +7042,7 @@ parse_operands (char *str, const
> unsigned int *pattern, bf
>            val =
> parse_reg_list (&str);
>            if (*str
> == '^')
>              {
> -             inst.operands[1].writeback = 1;
> +             inst.operands[i].writeback = 1;
>                str++;
>              }
>            break;
> @@ -9040,6 +9040,8 @@ do_pli (void)
>   static void
>   do_push_pop (void)
>   {
> +  constraint
> (inst.operands[0].writeback,
> +             _("push/pop do not support {reglist}^"));
>     inst.operands[1]
> = inst.operands[0];
>     memset
> (&inst.operands[0], 0, sizeof inst.operands[0]);
>     inst.operands[0].isreg = 1;

Seems like your mail client or something else has munged the patch.
Can you please resend it as an attachment or ensure that the layout is
preserved?

Thanks,
Kyrill



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

* Re: [PATCH][GAS][ARM] Fix for POP {regs}^ problem
  2015-03-06 16:34 ` Kyrill Tkachov
@ 2015-03-06 17:14   ` Michael Perkins
  2015-03-10 11:49     ` Nicholas Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Perkins @ 2015-03-06 17:14 UTC (permalink / raw)
  To: Kyrill Tkachov, binutils

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



Hi Kyrill,

Sorry about that. Please find attached the patch.

Michael.



On Friday, 6 March 2015, 16:34, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
Hi Michael,


On 06/03/15 16:20, Michael Perkins wrote:
> Here is a diff for a patch to fix a problem with gas accepting the POP {reglist}^ instruction. It was encoding this in the same way as the POP {reglist} instruction. The patch rejects the POP {reglist}^ instruction in ARM mode (previously only rejected in THUMB mode).
>
> gas/ChangeLog:
>
> 2015-03-06  Michael Perkins <perkinsmg75@yahoo.co.uk>
>
> * config/tc-arm.c (parse_operands): Set inst.operands[i].writeback for '^' on OP_REGLSTs.
> (do_push_pop): New writeback constraint.
>
>
>
> diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
> index 08155ac..136e52c 100644
> --- a/gas/config/tc-arm.c
> +++ b/gas/config/tc-arm.c
> @@ -7042,7 +7042,7 @@ parse_operands (char *str, const
> unsigned int *pattern, bf
>            val =
> parse_reg_list (&str);
>            if (*str
> == '^')
>              {
> -             inst.operands[1].writeback = 1;
> +             inst.operands[i].writeback = 1;
>                str++;
>              }
>            break;
> @@ -9040,6 +9040,8 @@ do_pli (void)
>   static void
>   do_push_pop (void)
>   {
> +  constraint
> (inst.operands[0].writeback,
> +             _("push/pop do not support {reglist}^"));
>     inst.operands[1]
> = inst.operands[0];
>     memset
> (&inst.operands[0], 0, sizeof inst.operands[0]);
>     inst.operands[0].isreg = 1;

Seems like your mail client or something else has munged the patch.
Can you please resend it as an attachment or ensure that the layout is
preserved?

Thanks,
Kyrill

[-- Attachment #2: pop.patch --]
[-- Type: application/octet-stream, Size: 711 bytes --]

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 08155ac..136e52c 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7042,7 +7042,7 @@ parse_operands (char *str, const unsigned int *pattern, bfd_boolean thumb)
 	  val = parse_reg_list (&str);
 	  if (*str == '^')
 	    {
-	      inst.operands[1].writeback = 1;
+	      inst.operands[i].writeback = 1;
 	      str++;
 	    }
 	  break;
@@ -9040,6 +9040,8 @@ do_pli (void)
 static void
 do_push_pop (void)
 {
+  constraint (inst.operands[0].writeback,
+             _("push/pop do not support {reglist}^"));
   inst.operands[1] = inst.operands[0];
   memset (&inst.operands[0], 0, sizeof inst.operands[0]);
   inst.operands[0].isreg = 1;

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

* Re: [PATCH][GAS][ARM] Fix for POP {regs}^ problem
  2015-03-06 17:14   ` Michael Perkins
@ 2015-03-10 11:49     ` Nicholas Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nicholas Clifton @ 2015-03-10 11:49 UTC (permalink / raw)
  To: Michael Perkins, Kyrill Tkachov, binutils

Hi Michael,

>> gas/ChangeLog:
>> 2015-03-06  Michael Perkins <perkinsmg75@yahoo.co.uk>
>>
>> * config/tc-arm.c (parse_operands): Set inst.operands[i].writeback for '^' on OP_REGLSTs.
>> (do_push_pop): New writeback constraint.

Approved and applied.

Cheers
   Nick


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

end of thread, other threads:[~2015-03-10 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06 16:23 [PATCH][GAS][ARM] Fix for POP {regs}^ problem Michael Perkins
2015-03-06 16:34 ` Kyrill Tkachov
2015-03-06 17:14   ` Michael Perkins
2015-03-10 11:49     ` Nicholas Clifton

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).