[PATCH] allow != instead of <> in as
Arnold Metselaar
arnold.metselaar@planet.nl
Sun Oct 2 01:43:00 GMT 2005
The following patch will make as accept "!=" as a synonym for
"<>". The operator "!=" appears in some Z80 sources, and I
don't see a reason not to allow it.
Regards,
Arnold
gas/ChangeLog
* expr.c (operator) <case '!'>: allow "!=" for O_ne
* doc/as.texinfo (infix operators): mention "!="
--- gas/expr.c 2005-05-05 11:12:45.000000000 +0200
+++ gas/expr.c.new 2005-10-01 21:28:50.000000000 +0200
@@ -1587,16 +1587,18 @@
return ret;
case '!':
- /* We accept !! as equivalent to ^ for MRI compatibility.
*/
- if (input_line_pointer[1] != '!')
- {
+ switch (input_line_pointer[1]) {
+ default:
if (flag_m68k_mri)
return O_bit_inclusive_or;
return op_encoding[c];
- }
+ case '!': /* We accept !! as equivalent to ^ for MRI
compatibility. */
*num_chars = 2;
return O_bit_exclusive_or;
-
+ case '=': /* We accept != as equivalent to <> */
+ *num_chars = 2;
+ return O_ne;
+ }
case '|':
if (input_line_pointer[1] != '|')
return op_encoding[c];
--- gas/doc/as.texinfo 2005-10-01 21:53:21.121261048 +0200
+++ gas/doc/as.texinfo.new 2005-10-01 22:26:53.023405432
+0200
@@ -3619,6 +3619,7 @@
@item ==
@dfn{Is Equal To}
@item <>
+@itemx !=
@dfn{Is Not Equal To}
@item <
@dfn{Is Less Than}
More information about the Binutils
mailing list