Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make math-mode=fast no op, it's too dangerous #41638

Merged
merged 4 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/jloptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ static const char opts[] =
#ifdef USE_POLLY
" --polly={yes*|no} Enable or disable the polyhedral optimizer Polly (overrides @polly declaration)\n"
#endif
" --math-mode={ieee,fast} Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)\n\n"

// instrumentation options
" --code-coverage[={none*|user|all}]\n"
Expand Down Expand Up @@ -692,7 +691,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
if (!strcmp(optarg,"ieee"))
jl_options.fast_math = JL_OPTIONS_FAST_MATH_OFF;
else if (!strcmp(optarg,"fast"))
jl_options.fast_math = JL_OPTIONS_FAST_MATH_ON;
jl_options.fast_math = JL_OPTIONS_FAST_MATH_DEFAULT;
else if (!strcmp(optarg,"user"))
jl_options.fast_math = JL_OPTIONS_FAST_MATH_DEFAULT;
else
Expand Down
2 changes: 1 addition & 1 deletion test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
@test parse(Int,readchomp(`$exename --math-mode=ieee -E
"Int(Base.JLOptions().fast_math)"`)) == JL_OPTIONS_FAST_MATH_OFF
@test parse(Int,readchomp(`$exename --math-mode=fast -E
"Int(Base.JLOptions().fast_math)"`)) == JL_OPTIONS_FAST_MATH_ON
"Int(Base.JLOptions().fast_math)"`)) == JL_OPTIONS_FAST_MATH_DEFAULT
end

# --worker takes default / custom as argument (default/custom arguments
Expand Down