This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR gas/1874: mwait/monitor don't work in 64bit


>I really don't like to use memory operand for monitor. Here is the new
>patch without memory operand.

Any particular reason for that? But I don't really mind...

>+	  if (((flag_code == CODE_16BIT || flag_code == CODE_64BIT)
>+	       && (i.op->regs[0].reg_type & Reg32))
>+	      || (flag_code == CODE_32BIT
>+		  && i.op->regs[0].reg_type & Reg16))

While I recognize this is partly a stylistic thing, I would see this
more readable if simplified:

	  if (i.op->regs[0].reg_type & (flag_code != CODE_32BIT ? Reg32
: Reg16))

>+      /* Remove "addr16/addr32" if we aren't in Intel mode.  */
>+      if (!intel_syntax
>+	  && (prefixes & PREFIX_ADDR)
>+	  && olen >= (4 + 7)
>+	  && *(p - 1) == ' '
>+	  && strncmp (p - 7, "addr", 4) == 0
>+	  && (strncmp (p - 3, "16", 2) == 0
>+	      || strncmp (p - 3, "32", 2) == 0))
>+	p -= 7;
>+

Oh, I see, I asked for a thing that needs general cleanup. I was mixing
up the behaviors of PREFIX_ADDR and PREFIX_DATA. It really should be
opcode-independent code that deals with suppressing this. I withdraw my
request to suppress addrXX, but I leave it up to you if you want to keep
this piece.

Jan

Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]