summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/querymatrix.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-01-26 14:19:30 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2015-01-28 03:42:41 -0800
commitd6eb572905e39c36168b8f5da240af961f9dde0a (patch)
tree3df45d16bae88d53e170a687fe113e27154316c1 /src/mesa/main/querymatrix.c
parent5e8468e6dadb06da061ad51e2c40e85bc1c6c3e4 (diff)
downloadexternal_mesa3d-d6eb572905e39c36168b8f5da240af961f9dde0a.zip
external_mesa3d-d6eb572905e39c36168b8f5da240af961f9dde0a.tar.gz
external_mesa3d-d6eb572905e39c36168b8f5da240af961f9dde0a.tar.bz2
util: Move the alternate fpclassify implementation to util
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/querymatrix.c')
-rw-r--r--src/mesa/main/querymatrix.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c
index ef85175..d2d643b 100644
--- a/src/mesa/main/querymatrix.c
+++ b/src/mesa/main/querymatrix.c
@@ -17,6 +17,7 @@
#include "glheader.h"
#include "querymatrix.h"
#include "main/get.h"
+#include "util/macros.h"
/**
@@ -37,56 +38,6 @@
#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16))
#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0))
-#if defined(fpclassify)
-/* ISO C99 says that fpclassify is a macro. Assume that any implementation
- * of fpclassify, whether it's in a C99 compiler or not, will be a macro.
- */
-#elif defined(_MSC_VER)
-/* Not required on VS2013 and above. */
-/* Oddly, the fpclassify() function doesn't exist in such a form
- * on MSVC. This is an implementation using slightly different
- * lower-level Windows functions.
- */
-#include <float.h>
-
-enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
-fpclassify(double x)
-{
- switch(_fpclass(x)) {
- case _FPCLASS_SNAN: /* signaling NaN */
- case _FPCLASS_QNAN: /* quiet NaN */
- return FP_NAN;
- case _FPCLASS_NINF: /* negative infinity */
- case _FPCLASS_PINF: /* positive infinity */
- return FP_INFINITE;
- case _FPCLASS_NN: /* negative normal */
- case _FPCLASS_PN: /* positive normal */
- return FP_NORMAL;
- case _FPCLASS_ND: /* negative denormalized */
- case _FPCLASS_PD: /* positive denormalized */
- return FP_SUBNORMAL;
- case _FPCLASS_NZ: /* negative zero */
- case _FPCLASS_PZ: /* positive zero */
- return FP_ZERO;
- default:
- /* Should never get here; but if we do, this will guarantee
- * that the pattern is not treated like a number.
- */
- return FP_NAN;
- }
-}
-
-#else
-
-enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
-fpclassify(double x)
-{
- /* XXX do something better someday */
- return FP_NORMAL;
-}
-
-#endif
-
GLbitfield GLAPIENTRY _mesa_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
{
GLfloat matrix[16];