public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86-64: remove an inconsistent and redundant diagnostic
@ 2012-07-24 15:26 Jan Beulich
  2012-07-30 17:02 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-07-24 15:26 UTC (permalink / raw)
  To: binutils

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

Since the word to byte register conversion isn't active for x86-64
anyway, there's also no need to issue a separate, inconsistent
diagnostic in some of the cases - non-matching operands will be
complained about anyway.

2012-07-24  Jan Beulich <jbeulich@suse.com>

	* config/tc-i386-intel.c (check_byte_reg): Check for I/O port
	register earlier, and just once. Drop diagnostic that got
	issued only for some registers.

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4734,6 +4734,10 @@ check_byte_reg (void)
       if (i.types[op].bitfield.reg8)
 	continue;
 
+      /* I/O port address operands are OK too.  */
+      if (i.tm.operand_types[op].bitfield.inoutportreg)
+	continue;
+
       /* crc32 doesn't generate this warning.  */
       if (i.tm.base_opcode == 0xf20f38f0)
 	continue;
@@ -4741,21 +4745,13 @@ check_byte_reg (void)
       if ((i.types[op].bitfield.reg16
 	   || i.types[op].bitfield.reg32
 	   || i.types[op].bitfield.reg64)
-	  && i.op[op].regs->reg_num < 4)
+	  && i.op[op].regs->reg_num < 4
+	  /* Prohibit these changes in 64bit mode, since the lowering
+	     would be more complicated.  */
+	  && flag_code != CODE_64BIT)
 	{
-	  /* Prohibit these changes in the 64bit mode, since the
-	     lowering is more complicated.  */
-	  if (flag_code == CODE_64BIT
-	      && !i.tm.operand_types[op].bitfield.inoutportreg)
-	    {
-	      as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
-		      register_prefix, i.op[op].regs->reg_name,
-		      i.suffix);
-	      return 0;
-	    }
 #if REGISTER_WARNINGS
-	  if (!quiet_warnings
-	      && !i.tm.operand_types[op].bitfield.inoutportreg)
+	  if (!quiet_warnings)
 	    as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
 		     register_prefix,
 		     (i.op[op].regs + (i.types[op].bitfield.reg16




[-- Attachment #2: binutils-mainline-x86_64-consistent-diag.patch --]
[-- Type: text/plain, Size: 1859 bytes --]

Since the word to byte register conversion isn't active for x86-64
anyway, there's also no need to issue a separate, inconsistent
diagnostic in some of the cases - non-matching operands will be
complained about anyway.

2012-07-24  Jan Beulich <jbeulich@suse.com>

	* config/tc-i386-intel.c (check_byte_reg): Check for I/O port
	register earlier, and just once. Drop diagnostic that got
	issued only for some registers.

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4734,6 +4734,10 @@ check_byte_reg (void)
       if (i.types[op].bitfield.reg8)
 	continue;
 
+      /* I/O port address operands are OK too.  */
+      if (i.tm.operand_types[op].bitfield.inoutportreg)
+	continue;
+
       /* crc32 doesn't generate this warning.  */
       if (i.tm.base_opcode == 0xf20f38f0)
 	continue;
@@ -4741,21 +4745,13 @@ check_byte_reg (void)
       if ((i.types[op].bitfield.reg16
 	   || i.types[op].bitfield.reg32
 	   || i.types[op].bitfield.reg64)
-	  && i.op[op].regs->reg_num < 4)
+	  && i.op[op].regs->reg_num < 4
+	  /* Prohibit these changes in 64bit mode, since the lowering
+	     would be more complicated.  */
+	  && flag_code != CODE_64BIT)
 	{
-	  /* Prohibit these changes in the 64bit mode, since the
-	     lowering is more complicated.  */
-	  if (flag_code == CODE_64BIT
-	      && !i.tm.operand_types[op].bitfield.inoutportreg)
-	    {
-	      as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
-		      register_prefix, i.op[op].regs->reg_name,
-		      i.suffix);
-	      return 0;
-	    }
 #if REGISTER_WARNINGS
-	  if (!quiet_warnings
-	      && !i.tm.operand_types[op].bitfield.inoutportreg)
+	  if (!quiet_warnings)
 	    as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
 		     register_prefix,
 		     (i.op[op].regs + (i.types[op].bitfield.reg16

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

* Re: [PATCH] x86-64: remove an inconsistent and redundant diagnostic
  2012-07-24 15:26 [PATCH] x86-64: remove an inconsistent and redundant diagnostic Jan Beulich
@ 2012-07-30 17:02 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2012-07-30 17:02 UTC (permalink / raw)
  To: Jan Beulich; +Cc: binutils

On Tue, Jul 24, 2012 at 8:26 AM, Jan Beulich <JBeulich@suse.com> wrote:
> Since the word to byte register conversion isn't active for x86-64
> anyway, there's also no need to issue a separate, inconsistent
> diagnostic in some of the cases - non-matching operands will be
> complained about anyway.
>
> 2012-07-24  Jan Beulich <jbeulich@suse.com>
>
>         * config/tc-i386-intel.c (check_byte_reg): Check for I/O port
>         register earlier, and just once. Drop diagnostic that got
>         issued only for some registers.
>
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -4734,6 +4734,10 @@ check_byte_reg (void)
>        if (i.types[op].bitfield.reg8)
>         continue;
>
> +      /* I/O port address operands are OK too.  */
> +      if (i.tm.operand_types[op].bitfield.inoutportreg)
> +       continue;
> +
>        /* crc32 doesn't generate this warning.  */
>        if (i.tm.base_opcode == 0xf20f38f0)
>         continue;
> @@ -4741,21 +4745,13 @@ check_byte_reg (void)
>        if ((i.types[op].bitfield.reg16
>            || i.types[op].bitfield.reg32
>            || i.types[op].bitfield.reg64)
> -         && i.op[op].regs->reg_num < 4)
> +         && i.op[op].regs->reg_num < 4
> +         /* Prohibit these changes in 64bit mode, since the lowering
> +            would be more complicated.  */
> +         && flag_code != CODE_64BIT)
>         {
> -         /* Prohibit these changes in the 64bit mode, since the
> -            lowering is more complicated.  */
> -         if (flag_code == CODE_64BIT
> -             && !i.tm.operand_types[op].bitfield.inoutportreg)
> -           {
> -             as_bad (_("incorrect register `%s%s' used with `%c' suffix"),
> -                     register_prefix, i.op[op].regs->reg_name,
> -                     i.suffix);
> -             return 0;
> -           }
>  #if REGISTER_WARNINGS
> -         if (!quiet_warnings
> -             && !i.tm.operand_types[op].bitfield.inoutportreg)
> +         if (!quiet_warnings)
>             as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
>                      register_prefix,
>                      (i.op[op].regs + (i.types[op].bitfield.reg16
>

OK.  Thanks.

-- 
H.J.

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

end of thread, other threads:[~2012-07-30 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 15:26 [PATCH] x86-64: remove an inconsistent and redundant diagnostic Jan Beulich
2012-07-30 17:02 ` H.J. Lu

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