|
Added
Link Here
|
| 1 |
--- stress-cpu.c.orig 2015-06-02 19:36:12 UTC |
| 2 |
+++ stress-cpu.c |
| 3 |
@@ -54,10 +54,15 @@ |
| 4 |
#endif |
| 5 |
|
| 6 |
#if defined(__FreeBSD__) |
| 7 |
+#include <sys/param.h> |
| 8 |
#define ccosl ccos |
| 9 |
#define csinl csin |
| 10 |
#define cpow pow |
| 11 |
#define powl pow |
| 12 |
+#define logl log |
| 13 |
+#define expl exp |
| 14 |
+#define coshl cosh |
| 15 |
+#define sinhl sinh |
| 16 |
#endif |
| 17 |
|
| 18 |
/* |
| 19 |
@@ -392,6 +397,7 @@ static void HOT OPTIMIZE3 stress_cpu_phi |
| 20 |
pr_fail(stderr, "%s: Golden Ratio phi not accurate enough\n", name); |
| 21 |
} |
| 22 |
|
| 23 |
+#if __FreeBSD_version >= 900000 |
| 24 |
/* |
| 25 |
* fft_partial() |
| 26 |
* partial Fast Fourier Transform |
| 27 |
@@ -432,6 +438,7 @@ static void HOT stress_cpu_fft(const cha |
| 28 |
memcpy(tmp, buf, sizeof(double complex) * FFT_SIZE); |
| 29 |
fft_partial(buf, tmp, FFT_SIZE, 1); |
| 30 |
} |
| 31 |
+#endif /* __FreeBSD_version >= 900000 */ |
| 32 |
|
| 33 |
/* |
| 34 |
* stress_cpu_euler() |
| 35 |
@@ -846,6 +853,7 @@ stress_cpu_fp(_Decimal64, decimal64, sin |
| 36 |
stress_cpu_fp(_Decimal128, decimal128, sinl, cosl) |
| 37 |
#endif |
| 38 |
|
| 39 |
+#if defined(__STDC_IEC_559_COMPLEX__) |
| 40 |
/* |
| 41 |
* Generic complex stressor macro |
| 42 |
*/ |
| 43 |
@@ -869,6 +877,7 @@ static void HOT OPTIMIZE3 stress_cpu_ ## |
| 44 |
stress_cpu_complex(complex float, complex_float, csinf, ccosf) |
| 45 |
stress_cpu_complex(complex double, complex_double, csin, ccos) |
| 46 |
stress_cpu_complex(complex long double, complex_long_double, csinl, ccosl) |
| 47 |
+#endif /* __STDC_IEC_559_COMPLEX__ */ |
| 48 |
|
| 49 |
#define int_float_ops(_ftype, flt_a, flt_b, flt_c, flt_d, \ |
| 50 |
_sin, _cos, int_a, int_b, _c1, _c2, _c3) \ |
| 51 |
@@ -1651,10 +1660,10 @@ static uint8_t HOT OPTIMIZE3 hamming84(c |
| 52 |
* G[] is reversed to turn G[3-j] into G[j] to save a subtraction |
| 53 |
*/ |
| 54 |
static const uint8_t G[] = { |
| 55 |
- 0b11110001, |
| 56 |
- 0b11010010, |
| 57 |
- 0b10110100, |
| 58 |
- 0b01111000, |
| 59 |
+ 0xF1, |
| 60 |
+ 0xD2, |
| 61 |
+ 0xB4, |
| 62 |
+ 0x78, |
| 63 |
}; |
| 64 |
|
| 65 |
register uint8_t code = 0; |
| 66 |
@@ -1921,9 +1930,11 @@ static stress_cpu_stressor_info_t cpu_me |
| 67 |
{ "ackermann", stress_cpu_ackermann }, |
| 68 |
{ "bitops", stress_cpu_bitops }, |
| 69 |
{ "callfunc", stress_cpu_callfunc }, |
| 70 |
+#if defined(__STDC_IEC_559_COMPLEX__) |
| 71 |
{ "cdouble", stress_cpu_complex_double }, |
| 72 |
{ "cfloat", stress_cpu_complex_float }, |
| 73 |
{ "clongdouble", stress_cpu_complex_long_double }, |
| 74 |
+#endif /* __STDC_IEC_559_COMPLEX__ */ |
| 75 |
{ "correlate", stress_cpu_correlate }, |
| 76 |
{ "crc16", stress_cpu_crc16 }, |
| 77 |
#if defined(STRESS_FLOAT_DECIMAL) |
| 78 |
@@ -1936,7 +1947,9 @@ static stress_cpu_stressor_info_t cpu_me |
| 79 |
{ "double", stress_cpu_double }, |
| 80 |
{ "euler", stress_cpu_euler }, |
| 81 |
{ "explog", stress_cpu_explog }, |
| 82 |
+#if __FreeBSD_version >= 900000 |
| 83 |
{ "fft", stress_cpu_fft }, |
| 84 |
+#endif /* __FreeBSD_version >= 900000 */ |
| 85 |
{ "fibonacci", stress_cpu_fibonacci }, |
| 86 |
{ "float", stress_cpu_float }, |
| 87 |
{ "fnv1a", stress_cpu_fnv1a }, |