* [runtime] Fix parse_optimizations () so the optimization names don't need to be in a particular order.
* [jit] Avoid unused bits in optflags.
-static const OptFunc
-opt_funcs [sizeof (int) * 8] = {
- NULL
-};
-
#ifdef __native_client__
extern char *nacl_mono_path;
#endif
#ifdef __native_client__
extern char *nacl_mono_path;
#endif
{
guint32 exclude = 0;
const char *n;
{
guint32 exclude = 0;
const char *n;
+ int i, invert;
+ char **parts, **ptr;
/* Initialize the hwcap module if necessary. */
mono_hwcap_init ();
/* Initialize the hwcap module if necessary. */
mono_hwcap_init ();
+ parts = g_strsplit (p, ",", -1);
+ for (ptr = parts; ptr && *ptr; ptr ++) {
+ char *arg = *ptr;
+ char *p = arg;
+
if (*p == '-') {
p++;
invert = TRUE;
if (*p == '-') {
p++;
invert = TRUE;
}
for (i = 0; i < G_N_ELEMENTS (opt_names) && optflag_get_name (i); ++i) {
n = optflag_get_name (i);
}
for (i = 0; i < G_N_ELEMENTS (opt_names) && optflag_get_name (i); ++i) {
n = optflag_get_name (i);
- len = strlen (n);
- if (strncmp (p, n, len) == 0) {
if (invert)
opt &= ~ (1 << i);
else
opt |= 1 << i;
if (invert)
opt &= ~ (1 << i);
else
opt |= 1 << i;
- p += len;
- if (*p == ',') {
- p++;
- break;
- } else if (*p == '=') {
- p++;
- if (opt_funcs [i])
- opt_funcs [i] (p);
- while (*p && *p++ != ',');
- break;
- }
- /* error out */
opt = 0;
else
opt = ~(EXCLUDED_FROM_ALL | exclude);
opt = 0;
else
opt = ~(EXCLUDED_FROM_ALL | exclude);
- p += 3;
- if (*p == ',')
- p++;
} else {
fprintf (stderr, "Invalid optimization name `%s'\n", p);
exit (1);
}
}
} else {
fprintf (stderr, "Invalid optimization name `%s'\n", p);
exit (1);
}
}
OPTFLAG(SSAPRE ,19, "ssapre", "SSA based Partial Redundancy Elimination (obsolete)")
OPTFLAG(EXCEPTION,20, "exception", "Optimize exception catch blocks")
OPTFLAG(SSA ,21, "ssa", "Use plain SSA form")
OPTFLAG(SSAPRE ,19, "ssapre", "SSA based Partial Redundancy Elimination (obsolete)")
OPTFLAG(EXCEPTION,20, "exception", "Optimize exception catch blocks")
OPTFLAG(SSA ,21, "ssa", "Use plain SSA form")
+OPTFLAG(FLOAT32 ,22, "float32", "Use 32 bit float arithmetic if possible")
OPTFLAG(SSE2 ,23, "sse2", "SSE2 instructions on x86")
OPTFLAG(SSE2 ,23, "sse2", "SSE2 instructions on x86")
-/* The id has to be smaller than gshared's, the parser code depends on this */
OPTFLAG(GSHAREDVT,24, "gsharedvt", "Generic sharing for valuetypes")
OPTFLAG(GSHAREDVT,24, "gsharedvt", "Generic sharing for valuetypes")
-OPTFLAG (GSHARED, 25, "gshared", "Generic Sharing")
+OPTFLAG (GSHARED, 25, "gshared", "Generic Sharing")
OPTFLAG(SIMD ,26, "simd", "Simd intrinsics")
OPTFLAG(UNSAFE ,27, "unsafe", "Remove bound checks and perform other dangerous changes")
OPTFLAG(ALIAS_ANALYSIS ,28, "alias-analysis", "Alias analysis of locals")
OPTFLAG(SIMD ,26, "simd", "Simd intrinsics")
OPTFLAG(UNSAFE ,27, "unsafe", "Remove bound checks and perform other dangerous changes")
OPTFLAG(ALIAS_ANALYSIS ,28, "alias-analysis", "Alias analysis of locals")
-OPTFLAG(FLOAT32 ,29, "float32", "Use 32 bit float arithmetic if possible")
-