Add controls for enabling M, F, and D RISC-V extensions.

Three predicates affect each extension:

- supports_m determines whether the target CPU supports the instruction set.
- enable_m determines if the instructions should be used, assuming they're
  available.
- use_m is the predicate used to actually use the instructions.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-30 15:10:38 -07:00
parent 9944bcc928
commit 09734f2033
4 changed files with 22 additions and 2 deletions

View File

@@ -22,7 +22,8 @@ mod tests {
supports_m = false\n\
supports_a = false\n\
supports_f = false\n\
supports_d = false\n");
supports_d = false\n\
enable_m = true\n");
// Predicates are not part of the Display output.
assert_eq!(f.full_float(), false);
}

View File

@@ -261,7 +261,9 @@ mod tests {
"[shared]\n\
opt_level = \"default\"\n\
is_64bit = false\n\
enable_simd = true\n");
enable_float = true\n\
enable_simd = true\n\
enable_atomics = true\n");
assert_eq!(f.opt_level(), super::OptLevel::Default);
assert_eq!(f.enable_simd(), true);
}