From: Petar Jovanovic Date: Sat, 27 Sep 2014 05:18:21 +0000 (+0000) Subject: mips: extend mips_features with a check for FPU X-Git-Tag: svn/VALGRIND_3_11_0~964 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d04098575ed07281048052d806ee01f5e48b8a78;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/tests/mips_features.c b/tests/mips_features.c index 1aef820bdd..d0e01e5fdc 100644 --- a/tests/mips_features.c +++ b/tests/mips_features.c @@ -47,7 +47,17 @@ static int mipsCPUInfo(const char *search_string) { 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) {