[nasm:nasm-2.15.xx] nasm: don't make -L+ imply -Lw
nasm-bot for H. Peter Anvin (Intel)
hpa at zytor.com
Thu Jul 30 15:27:03 PDT 2020
Commit-ID: 0e6e0138136dd3201f55fccd5fb149051f68d7e1
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=0e6e0138136dd3201f55fccd5fb149051f68d7e1
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Thu, 30 Jul 2020 15:25:00 -0700
Committer: H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Thu, 30 Jul 2020 15:25:00 -0700
nasm: don't make -L+ imply -Lw
-Lw really is only useful to debug NASM crashes, and can hugely slow
down the assembler. Make -L+ simply imply full verbosity; if NASM
crashes use -Lw+ instead.
Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>
---
asm/listing.h | 17 ++++++++++++-----
asm/nasm.c | 4 ++--
doc/changes.src | 3 +++
doc/nasmdoc.src | 5 +++--
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/asm/listing.h b/asm/listing.h
index 351fc69e..f62fc08f 100644
--- a/asm/listing.h
+++ b/asm/listing.h
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 1996-2019 The NASM Authors - All Rights Reserved
+ * Copyright 1996-2020 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@@ -134,12 +134,13 @@ extern uint64_t list_options, active_list_options;
* is when parsing the -L option or %pragma list options, neither of
* which is in any way performance critical.
*
- * The character + represents ALL listing options.
+ * The character + represents ALL listing options except -Lw (flush
+ * after every line.)
*
* This returns 0 for invalid values, so that no bit is accessed
* for unsupported characters.
*/
-static inline const_func uint64_t list_option_mask(unsigned char x)
+static inline const_func uint64_t list_option_mask_val(unsigned char x)
{
if (x >= 'a') {
if (x > 'z')
@@ -153,8 +154,6 @@ static inline const_func uint64_t list_option_mask(unsigned char x)
if (x > '9')
return 0;
x = x - '0' + 26*2;
- } else if (x == '+') {
- return ~UINT64_C(0);
} else {
return 0;
}
@@ -162,6 +161,14 @@ static inline const_func uint64_t list_option_mask(unsigned char x)
return UINT64_C(1) << x;
}
+static inline const_func uint64_t list_option_mask(unsigned char x)
+{
+ if (x == '+')
+ return ~list_option_mask_val('w');
+ else
+ return list_option_mask_val(x);
+}
+
static inline pure_func bool list_option(unsigned char x)
{
return unlikely(active_list_options & list_option_mask(x));
diff --git a/asm/nasm.c b/asm/nasm.c
index a0e17193..c5d03c8a 100644
--- a/asm/nasm.c
+++ b/asm/nasm.c
@@ -2266,8 +2266,8 @@ static void help(FILE *out)
" -Lm show multi-line macro calls with expanded parmeters\n"
" -Lp output a list file every pass, in case of errors\n"
" -Ls show all single-line macro definitions\n"
- " -Lw flush the output after every line\n"
- " -L+ enable all listing options (very verbose!)\n"
+ " -Lw flush the output after every line (very slow!)\n"
+ " -L+ enable all listing options except -Lw (very verbose!)\n"
"\n"
" -Oflags... optimize opcodes, immediates and branch offsets\n"
" -O0 no optimization\n"
diff --git a/doc/changes.src b/doc/changes.src
index 02ba2a4f..3de5ac7e 100644
--- a/doc/changes.src
+++ b/doc/changes.src
@@ -31,6 +31,9 @@ behavior, other backends, or user expectations.
\b Fix SSE instructions not being recognized with an explicit memory
operation size (e.g. \c{movsd qword [eax],xmm0}).
+\b The \c{-L+} option no longer enables \c{-Lw}, which is mainly
+useful to debug NASM crashes. See \k{opt-L}.
+
\S{cl-2.15.03} Version 2.15.03
\b Add instructions from the Intel Instruction Set Extensions and
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index 0d56f5c1..9e96ea3e 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -491,9 +491,10 @@ Supported options are:
\b \c{-Ls} show all single-line macro definitions
-\b \c{-Lw} flush the output after every line (very slow!)
+\b \c{-Lw} flush the output after every line (very slow, mainly useful
+to debug NASM crashes)
-\b \c{-L+} enable \e{all} listing options
+\b \c{-L+} enable \e{all} listing options except \c{-Lw} (very verbose)
These options can be enabled or disabled at runtime using the
\c{%pragma list options} directive:
More information about the Nasm-commits
mailing list