mips: extend mips_features with a check for FPU

Extend mips_features with "hard-float" query to which mips_features will
respond whether or not the platform is meant to have a floating point unit.
The query is not a runtime check, but a built-time check.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14570 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/tests/mips_features.c b/tests/mips_features.c
index 1aef820..d0e01e5 100644
--- a/tests/mips_features.c
+++ b/tests/mips_features.c
@@ -47,7 +47,17 @@
 static int go(char *feature)
 {
    int cpuinfo;
-   if (strcmp(feature, "mips32-dsp") == 0) {
+   if (strcmp(feature, "hard-float") == 0) {
+#if defined(__mips_hard_float)
+      /* This is not a runtime detection.
+         If mips_features is built as hard-float, the assumption is that
+         the target MIPS platform has a floating-point unit. */
+      return FEATURE_PRESENT;
+#else
+      return FEATURE_NOT_PRESENT;
+#endif
+   }
+   else if (strcmp(feature, "mips32-dsp") == 0) {
       const char *dsp = "dsp";
       cpuinfo = mipsCPUInfo(dsp);
       if (cpuinfo == 1) {