62 unsigned int mantissa: 23;
64 unsigned int sign : 1;
69 unsigned int mantissa1 : 7;
71 unsigned int sign : 1;
72 unsigned int mantissa2 : 16;
75#define VAX_SNG_BIAS 0x81
76#define IEEE_SNG_BIAS 0x7f
78static struct sgl_limits {
80 struct ieee_single ieee;
82 {{ 0x7f, 0xff, 0x0, 0xffff },
84 {{ 0x0, 0x0, 0x0, 0x0 },
100 struct ieee_single is;
101 struct vax_single
vs, *vsp;
102 struct sgl_limits *lim;
105 switch (xdrs->
x_op) {
111 vs = *((
struct vax_single *)fp);
112 for (
i = 0, lim = sgl_limits;
113 i <
sizeof(sgl_limits)/
sizeof(
struct sgl_limits);
115 if ((
vs.mantissa2 == lim->s.mantissa2) &&
116 (
vs.exp == lim->s.exp) &&
117 (
vs.mantissa1 == lim->s.mantissa1)) {
122 is.exp =
vs.exp - VAX_SNG_BIAS + IEEE_SNG_BIAS;
123 is.mantissa = (
vs.mantissa1 << 16) |
vs.mantissa2;
133 vsp = (
struct vax_single *)fp;
136 for (
i = 0, lim = sgl_limits;
137 i <
sizeof(sgl_limits)/
sizeof(
struct sgl_limits);
139 if ((is.exp == lim->ieee.exp) &&
140 (is.mantissa == lim->ieee.mantissa)) {
145 vsp->exp = is.exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
146 vsp->mantissa2 = is.mantissa;
147 vsp->mantissa1 = (is.mantissa >> 16);
163 unsigned int mantissa1 : 20;
164 unsigned int exp : 11;
165 unsigned int sign : 1;
166 unsigned int mantissa2 : 32;
171 unsigned int mantissa1 : 7;
172 unsigned int exp : 8;
173 unsigned int sign : 1;
174 unsigned int mantissa2 : 16;
175 unsigned int mantissa3 : 16;
176 unsigned int mantissa4 : 16;
179#define VAX_DBL_BIAS 0x81
180#define IEEE_DBL_BIAS 0x3ff
181#define MASK(nbits) ((1 << nbits) - 1)
183static struct dbl_limits {
187 {{ 0x7f, 0xff, 0x0, 0xffff, 0xffff, 0xffff },
188 { 0x0, 0x7ff, 0x0, 0x0 }},
189 {{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
190 { 0x0, 0x0, 0x0, 0x0 }}
207 struct vax_double vd;
208 struct dbl_limits *lim;
212 switch (xdrs->
x_op) {
217#if BYTE_ORDER == BIG_ENDIAN
230 vd = *((
struct vax_double *)dp);
231 for (
i = 0, lim = dbl_limits;
232 i <
sizeof(dbl_limits)/
sizeof(
struct dbl_limits);
234 if ((vd.mantissa4 == lim->d.mantissa4) &&
235 (vd.mantissa3 == lim->d.mantissa3) &&
236 (vd.mantissa2 == lim->d.mantissa2) &&
237 (vd.mantissa1 == lim->d.mantissa1) &&
238 (vd.exp == lim->d.exp)) {
243 id.exp = vd.exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
244 id.mantissa1 = (vd.mantissa1 << 13) | (vd.mantissa2 >> 3);
245 id.mantissa2 = ((vd.mantissa2 &
MASK(3)) << 29) |
246 (vd.mantissa3 << 13) |
247 ((vd.mantissa4 >> 3) &
MASK(13));
257#if BYTE_ORDER == BIG_ENDIAN
273 for (
i = 0, lim = dbl_limits;
274 i <
sizeof(dbl_limits)/
sizeof(
struct dbl_limits);
276 if ((
id.mantissa2 == lim->ieee.mantissa2) &&
277 (
id.mantissa1 == lim->ieee.mantissa1) &&
278 (
id.
exp == lim->ieee.exp)) {
283 vd.exp =
id.exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
284 vd.mantissa1 = (
id.mantissa1 >> 13);
285 vd.mantissa2 = ((
id.mantissa1 &
MASK(13)) << 3) |
286 (
id.mantissa2 >> 29);
287 vd.mantissa3 = (
id.mantissa2 >> 13);
288 vd.mantissa4 = (
id.mantissa2 << 3);
291 *dp = *((
double *)&vd);
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define XDR_PUTINT32(xdrs, int32p)
#define XDR_GETINT32(xdrs, int32p)
bool_t xdr_double(XDR *xdrs, double *dp)
bool_t xdr_float(XDR *xdrs, float *fp)