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]

S390: Allowing a NOP instruction without operands


Hi Martin,

  A Fedora user recently filed a binutils bug report about the NOP
  instruction for the s390:

    https://bugzilla.redhat.com/show_bug.cgi?id=506417

  In it they report that the s390's NOP instruction has to have some
  operands specified, which seems rather counter-intuitive given that
  it does not do anything.

  I have proposed a patch (attached here and also available via that
  bugzilla page) to allow the assembler to ignore any missing operands
  when a NOP instruction is found.  What do you think ?  Would this be
  OK for the s390 port or is there a reason why the NOP instruction
  should take some parameters ?

Cheers
  Nick

Index: gas/config/tc-s390.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-s390.c,v
retrieving revision 1.56
diff -c -3 -p -r1.56 tc-s390.c
*** gas/config/tc-s390.c	12 Aug 2008 23:39:31 -0000	1.56
--- gas/config/tc-s390.c	17 Jun 2009 15:57:06 -0000
*************** md_gather_operands (char *str,
*** 1188,1194 ****
        if (ex.X_op == O_illegal)
  	as_bad (_("illegal operand"));
        else if (ex.X_op == O_absent)
! 	as_bad (_("missing operand"));
        else if (ex.X_op == O_register || ex.X_op == O_constant)
  	{
  	  s390_lit_suffix (&str, &ex, ELF_SUFFIX_NONE);
--- 1188,1200 ----
        if (ex.X_op == O_illegal)
  	as_bad (_("illegal operand"));
        else if (ex.X_op == O_absent)
! 	{
! 	  /* Special case for the NOP instruction.  In order to allow
! 	     the (naive) user to just put 'nop' into their assembly
! 	     code without any operands we skip the error generation here.  */
! 	  if (strcmp (opcode->name, "nop") != 0)
! 	    as_bad (_("missing operand"));
! 	}
        else if (ex.X_op == O_register || ex.X_op == O_constant)
  	{
  	  s390_lit_suffix (&str, &ex, ELF_SUFFIX_NONE);

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