Skip to content

Commit e8ac6e7

Browse files
sjkellymbauman
andcommitted
Harmonize and add docs for --math-mode
The behavior was changed and the CLI doc was removed in JuliaLang#41638, though we current still allow users to selectively use the `@fastmath` macro. This adds back the CLI docs and makes a minor clarification about behavior. Co-authored-by: Matt Bauman <[email protected]>
1 parent 9145571 commit e8ac6e7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

doc/man/julia.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ Control whether inlining is permitted, including overriding @inline declarations
200200
Emit bounds checks always, never, or respect @inbounds declarations
201201

202202
.TP
203-
--math-mode={ieee|user}
204-
Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)
203+
--math-mode={ieee|user*}
204+
Always follow `ieee` floating point semantics or respect `@fastmath` declarations
205205

206206
.TP
207207
--code-coverage[={none*|user|all}]

doc/src/manual/command-line-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The following is a complete list of command-line switches available when launchi
195195
|`-g`, `--debug-info={0,1*,2}` |Set the level of debug info generation (level is 2 if `-g` is used without a level) ($)|
196196
|`--inline={yes\|no}` |Control whether inlining is permitted, including overriding `@inline` declarations|
197197
|`--check-bounds={yes\|no\|auto*}` |Emit bounds checks always, never, or respect `@inbounds` declarations ($)|
198-
|`--math-mode={ieee,fast}` |Disallow or enable unsafe floating point optimizations (overrides `@fastmath` declaration)|
198+
|`--math-mode={ieee\|user*}` |Always follow `ieee` floating point semantics or respect `@fastmath` declarations|
199199
|`--code-coverage[={none*\|user\|all}]` |Count executions of source lines (omitting setting is equivalent to `user`)|
200200
|`--code-coverage=@<path>` |Count executions but only in files that fall under the given file path/directory. The `@` prefix is required to select this option. A `@` with no path will track the current directory.|
201201
|`--code-coverage=tracefile.info` |Append coverage information to the LCOV tracefile (filename supports format tokens).|

src/jloptions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static const char opts[] =
177177
#ifdef USE_POLLY
178178
" --polly={yes*|no} Enable or disable the polyhedral optimizer Polly (overrides @polly declaration)\n"
179179
#endif
180+
" --math-mode={ieee|user*} Always follow `ieee` floating point semantics or respect `@fastmath` declarations\n\n"
180181

181182
// instrumentation options
182183
" --code-coverage[={none*|user|all}]\n"
@@ -782,7 +783,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
782783
else if (!strcmp(optarg,"user"))
783784
jl_options.fast_math = JL_OPTIONS_FAST_MATH_DEFAULT;
784785
else
785-
jl_errorf("julia: invalid argument to --math-mode (%s)", optarg);
786+
jl_errorf("julia: invalid argument to --math-mode={ieee|user} (%s)", optarg);
786787
break;
787788
case opt_worker:
788789
jl_options.worker = 1;

0 commit comments

Comments
 (0)