From dc0bf47feb96884d658d0eceba8ce669c81cf591 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 30 Sep 2008 16:24:47 -0700 Subject: [PATCH] Document the -O0 and -O1 behaviors. Document the way the -O0 and -O1 options actually behave. -O0, in particular, is NASM 0.98 compatibility mode. Signed-off-by: H. Peter Anvin --- doc/changes.src | 6 ++++++ doc/nasmdoc.src | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index 3cd0b221..6624f128 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -8,6 +8,12 @@ The NASM 2 series support x86-64, and is the production version of NASM since 2007. +\S{cl-2.05} Version 2.05 + +\b Make the behaviour of \c{-O0} match NASM 0.98 legacy behavior. + See \k{opt-O}. + + \S{cl-2.04} Version 2.04 \b Sanitize macro handing in the \c{%error} directive. diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 847f02e7..9b66bb6d 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -787,22 +787,26 @@ NASM defaults to not optimizing operands which can fit into a signed byte. This means that if you want the shortest possible object code, you have to enable optimization. -Using the \c{-O} option, you can tell NASM to carry out different levels of optimization. -The syntax is: +Using the \c{-O} option, you can tell NASM to carry out different +levels of optimization. The syntax is: \b \c{-O0}: No optimization. All operands take their long forms, - if a short form is not specified. + if a short form is not specified, except conditional jumps. + This is intended to match NASM 0.98 behavior. \b \c{-O1}: Minimal optimization. As above, but immediate operands which will fit in a signed byte are optimized, - unless the long form is specified. + unless the long form is specified. Conditional jumps default + to the long form unless otherwise specified. \b \c{-Ox} (where \c{x} is the actual letter \c{x}): Multipass optimization. Minimize branch offsets and signed immediate bytes, - overriding size specification unless the \c{strict} keyword - has been used (see \k{strict}). For compatability with earlier - releases, the letter \c{x} may also be any number greater than - one. This number has no effect on the actual number of passes. + overriding size specification unless the \c{strict} keyword + has been used (see \k{strict}). For compatability with earlier + releases, the letter \c{x} may also be any number greater than + one. This number has no effect on the actual number of passes. + +The \c{-Ox} mode is recommended for most uses. Note that this is a capital \c{O}, and is different from a small \c{o}, which is used to specify the output file name. See \k{opt-o}. -- 2.11.4.GIT