Skip to content

Commit 7f04137

Browse files
Delete unused, non-exported xmath machinery (#2798)
1 parent ee43e70 commit 7f04137

File tree

5 files changed

+0
-112
lines changed

5 files changed

+0
-112
lines changed

stl/src/xdtest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double* px) { // categorize *
2121
}
2222
}
2323

24-
unsigned short* _Plsw(double* px) { // get pointer to lsw
25-
return &reinterpret_cast<_Dval*>(px)->_Sh[_Dg];
26-
}
27-
2824
unsigned short* _Pmsw(double* px) { // get pointer to msw
2925
return &reinterpret_cast<_Dval*>(px)->_Sh[_D0];
3026
}

stl/src/xfdtest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float* px) { // categorize *
1919
}
2020
}
2121

22-
unsigned short* _FPlsw(float* px) { // get pointer to lsw
23-
return &reinterpret_cast<_Fval*>(px)->_Sh[_Fg];
24-
}
25-
2622
unsigned short* _FPmsw(float* px) { // get pointer to msw
2723
return &reinterpret_cast<_Fval*>(px)->_Sh[_F0];
2824
}

stl/src/xldtest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LDtest(long double* px) { // catego
1111
return _Dtest(reinterpret_cast<double*>(px));
1212
}
1313

14-
unsigned short* _LPlsw(long double* px) { // get pointer to lsw
15-
return &reinterpret_cast<_Lval*>(px)->_Sh[_L3];
16-
}
17-
1814
unsigned short* _LPmsw(long double* px) { // get pointer to msw
1915
return &reinterpret_cast<_Lval*>(px)->_Sh[_L0];
2016
}

stl/src/xmath.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// macros for _Feraise argument
1212
#define _FE_DIVBYZERO 0x04
13-
#define _FE_INEXACT 0x20
1413
#define _FE_INVALID 0x01
1514
#define _FE_OVERFLOW 0x08
1615
#define _FE_UNDERFLOW 0x10
@@ -42,9 +41,6 @@
4241
#define FSIGN(x) (reinterpret_cast<_Fval*>(&(x))->_Sh[_F0] & _FSIGN)
4342
#define LSIGN(x) (reinterpret_cast<_Lval*>(&(x))->_Sh[_L0] & _LSIGN)
4443

45-
#define _Fg _F1 // least-significant 16-bit word
46-
#define _Dg _D3
47-
4844
// return values for _Stopfx/_Stoflt
4945
#define FL_ERR 0
5046
#define FL_DEC 1
@@ -72,7 +68,6 @@ union _Dval { // pun floating type as integer array
7268
double _Val;
7369
};
7470

75-
unsigned short* _Plsw(double*);
7671
unsigned short* _Pmsw(double*);
7772

7873
short _Dint(double*, short);
@@ -93,19 +88,15 @@ double* _Xp_addh(double*, int, double);
9388
double* _Xp_mulh(double*, int, double);
9489
double* _Xp_movx(double*, int, const double*);
9590
double* _Xp_addx(double*, int, const double*, int);
96-
double* _Xp_subx(double*, int, const double*, int);
9791
double* _Xp_ldexpx(double*, int, int);
9892
double* _Xp_mulx(double*, int, const double*, int, double*);
99-
double* _Xp_invx(double*, int, double*);
100-
double* _Xp_sqrtx(double*, int, double*);
10193

10294
// float declarations
10395
union _Fval { // pun floating type as integer array
10496
unsigned short _Sh[8];
10597
float _Val;
10698
};
10799

108-
unsigned short* _FPlsw(float*);
109100
unsigned short* _FPmsw(float*);
110101

111102
short _FDint(float*, short);
@@ -126,19 +117,15 @@ float* _FXp_addh(float*, int, float);
126117
float* _FXp_mulh(float*, int, float);
127118
float* _FXp_movx(float*, int, const float*);
128119
float* _FXp_addx(float*, int, const float*, int);
129-
float* _FXp_subx(float*, int, const float*, int);
130120
float* _FXp_ldexpx(float*, int, int);
131121
float* _FXp_mulx(float*, int, const float*, int, float*);
132-
float* _FXp_invx(float*, int, float*);
133-
float* _FXp_sqrtx(float*, int, float*);
134122

135123
// long double declarations
136124
union _Lval { // pun floating type as integer array
137125
unsigned short _Sh[8];
138126
long double _Val;
139127
};
140128

141-
unsigned short* _LPlsw(long double*);
142129
unsigned short* _LPmsw(long double*);
143130

144131
short _LDint(long double*, short);
@@ -158,11 +145,8 @@ long double* _LXp_addh(long double*, int, long double);
158145
long double* _LXp_mulh(long double*, int, long double);
159146
long double* _LXp_movx(long double*, int, const long double*);
160147
long double* _LXp_addx(long double*, int, const long double*, int);
161-
long double* _LXp_subx(long double*, int, const long double*, int);
162148
long double* _LXp_ldexpx(long double*, int, int);
163149
long double* _LXp_mulx(long double*, int, const long double*, int, long double*);
164-
long double* _LXp_invx(long double*, int, long double*);
165-
long double* _LXp_sqrtx(long double*, int, long double*);
166150

167151
_END_EXTERN_C_UNLESS_PURE
168152

stl/src/xxxprec.hpp

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,6 @@ FTYPE* FNAME(Xp_addx)(FTYPE* p, int n, const FTYPE* q, int m) { // add an extend
310310
return p;
311311
}
312312

313-
FTYPE* FNAME(Xp_subx)(FTYPE* p, int n, const FTYPE* q, int m) { // subtract an extended precision value
314-
int k;
315-
316-
for (k = 0; k < m && q[k] != FLIT(0.0); ++k) {
317-
FNAME(Xp_addh)(p, n, -q[k]);
318-
}
319-
320-
return p;
321-
}
322-
323313
FTYPE* FNAME(Xp_ldexpx)(FTYPE* p, int n, int m) { // scale an extended precision value
324314
int k;
325315
for (k = 0; k < n; ++k) {
@@ -354,80 +344,6 @@ FTYPE* FNAME(Xp_mulx)(FTYPE* p, int n, const FTYPE* q, int m, FTYPE* ptemp2) {
354344
return p;
355345
}
356346

357-
FTYPE* FNAME(Xp_invx)(FTYPE* p, int n, FTYPE* ptemp4) { // invert an extended precision value (needs 4 * n temp)
358-
short errx;
359-
360-
if (n != 0) {
361-
if (0 <= (errx = FNAME(Dtest)(&p[0]))) { // not finite, return special value
362-
if (errx == _INFCODE) {
363-
p[0] = FLIT(0.0); // 1/Inf == 0
364-
} else if (errx == 0) {
365-
p[0] = FCONST(Inf); // 1/0 == Inf
366-
}
367-
// else 1/NaN == NaN
368-
} else { // p[0] is finite nonzero, invert it
369-
FTYPE* pac = ptemp4;
370-
FTYPE* py = ptemp4 + n;
371-
FTYPE* ptemp2 = py + n;
372-
FTYPE x0 = p[0];
373-
int k;
374-
375-
FNAME(Xp_movx)(py, n, p);
376-
FNAME(Xp_mulh)(py, n, -FLIT(1.0)); // py = -x
377-
378-
if (1 < n) {
379-
x0 += p[1];
380-
}
381-
382-
FNAME(Xp_setw)(p, n, FLIT(1.0) / x0); // p = y
383-
for (k = 1; k < n; k <<= 1) { // iterate to double previous precision of 1/x
384-
FNAME(Xp_movx)(pac, n, p);
385-
FNAME(Xp_mulx)(pac, n, py, n, ptemp2);
386-
FNAME(Xp_addh)(pac, n, FLIT(1.0)); // 1 - x * y
387-
FNAME(Xp_mulx)(pac, n, p, n, ptemp2); // y * (1 - x * y)
388-
FNAME(Xp_addx)(p, n, pac, n); // y += y * (1 - x * y)
389-
}
390-
}
391-
}
392-
393-
return p;
394-
}
395-
396-
FTYPE* FNAME(Xp_sqrtx)(FTYPE* p, int n, FTYPE* ptemp4) {
397-
// find square root of an extended precision value (needs 4 * n temp)
398-
if (n != 0) {
399-
if (0 <= FNAME(Dtest)(&p[0]) || p[0] < FLIT(0.0)) { // not finite nonnegative, return special value
400-
if (p[0] < FLIT(0.0)) { // sqrt(negative), report domain error
401-
_Feraise(_FE_INVALID);
402-
p[0] = FCONST(Nan);
403-
}
404-
} else { // worth iterating, compute x * sqrt(1/x)
405-
FTYPE* pac = ptemp4;
406-
FTYPE* py = ptemp4 + n;
407-
FTYPE* ptemp2 = py + n;
408-
FTYPE x0 = p[0];
409-
int k;
410-
411-
if (1 < n) {
412-
x0 += p[1];
413-
}
414-
415-
FNAME(Xp_setw)(py, n, static_cast<FTYPE>(FLIT(1.0) / FFUN(sqrt)(x0))); // py = y
416-
for (k = 2; k < n; k <<= 1) { // iterate to double previous precision of sqrt(1/x)
417-
FNAME(Xp_movx)(pac, n, py);
418-
FNAME(Xp_mulh)(pac, n, -FLIT(0.5));
419-
FNAME(Xp_mulx)(pac, n, p, n, ptemp2);
420-
FNAME(Xp_mulx)(pac, n, py, n, ptemp2);
421-
FNAME(Xp_addh)(pac, n, FLIT(1.5)); // 3/2 - x * y * y / 2
422-
FNAME(Xp_mulx)(py, n, pac, n, ptemp2); // y *= 3/2 - x * y * y / 2
423-
}
424-
425-
FNAME(Xp_mulx)(p, n, py, n, ptemp2); // x * sqrt(1/x)
426-
}
427-
}
428-
429-
return p;
430-
}
431347
#if !defined(MRTDLL)
432348
_END_EXTERN_C
433349
#endif // !defined(MRTDLL)

0 commit comments

Comments
 (0)