|
From: <sv...@va...> - 2014-09-27 05:18:28
|
Author: petarj
Date: Sat Sep 27 06:18:21 2014
New Revision: 14570
Log:
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.
Modified:
trunk/tests/mips_features.c
Modified: trunk/tests/mips_features.c
==============================================================================
--- trunk/tests/mips_features.c (original)
+++ trunk/tests/mips_features.c Sat Sep 27 06:18:21 2014
@@ -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) {
|