Skip to content

Commit

Permalink
Add command line option --math-mode=ieee to disable fast math
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Jan 13, 2015
1 parent 7f23d52 commit 9d462ed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ui/repl.c
Expand Up @@ -86,7 +86,8 @@ void parse_opts(int *argcp, char ***argvp)
opt_dump_bitcode,
opt_compile,
opt_depwarn,
opt_inline
opt_inline,
opt_math_mode
};
static const char shortopts[] = "+H:hJ:C:O";
static const struct option longopts[] = {
Expand All @@ -105,6 +106,7 @@ void parse_opts(int *argcp, char ***argvp)
{ "compile", required_argument, 0, opt_compile },
{ "depwarn", required_argument, 0, opt_depwarn },
{ "inline", required_argument, 0, opt_inline },
{ "math-mode", required_argument, 0, opt_math_mode },
{ 0, 0, 0, 0 }
};
int c;
Expand Down Expand Up @@ -218,6 +220,16 @@ void parse_opts(int *argcp, char ***argvp)
exit(1);
}
break;
case opt_math_mode:
if (!strcmp(optarg, "ieee"))
jl_compileropts.fast_math = JL_COMPILEROPT_FAST_MATH_OFF;
else if (!strcmp(optarg, "user"))
jl_compileropts.fast_math = JL_COMPILEROPT_FAST_MATH_DEFAULT;
else {
ios_printf(ios_stderr, "julia: invalid argument to --math-mode (%s)\n", optarg);
exit(1);
}
break;
default:
ios_printf(ios_stderr, "julia: unhandled option -- %c\n", c);
ios_printf(ios_stderr, "This is a bug, please report it.\n");
Expand Down

0 comments on commit 9d462ed

Please sign in to comment.