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@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2020-07-30 15:25:00 -07:00
parent e56c2dc5b7
commit 0e6e013813
4 changed files with 20 additions and 9 deletions

View file

@ -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));

View file

@ -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"

View file

@ -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

View file

@ -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: