Update upstream source from tag 'upstream/0.0_git20200514.4dfe081'
Update to upstream version '0.0~git20200514.4dfe081'
with Debian dir 02790d4d498859a46dd9b890cd224003d4a2bfb7
Mo Zhou
3 years ago
7 | 7 | #include <stdint.h> |
8 | 8 | #endif |
9 | 9 | |
10 | #if defined(__INTEL_COMPILER) | |
11 | #include <immintrin.h> | |
12 | #endif | |
13 | ||
14 | #if defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | |
15 | #include <intrin.h> | |
16 | #endif | |
17 | ||
10 | 18 | |
11 | 19 | static inline float fp32_from_bits(uint32_t w) { |
12 | 20 | #if defined(__OPENCL_VERSION__) |
15 | 23 | return __uint_as_float((unsigned int) w); |
16 | 24 | #elif defined(__INTEL_COMPILER) |
17 | 25 | return _castu32_f32(w); |
26 | #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | |
27 | return _CopyFloatFromInt32((__int32) w); | |
18 | 28 | #else |
19 | 29 | union { |
20 | 30 | uint32_t as_bits; |
31 | 41 | return (uint32_t) __float_as_uint(f); |
32 | 42 | #elif defined(__INTEL_COMPILER) |
33 | 43 | return _castf32_u32(f); |
44 | #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | |
45 | return (uint32_t) _CopyInt32FromFloat(f); | |
34 | 46 | #else |
35 | 47 | union { |
36 | 48 | float as_value; |
47 | 59 | return __longlong_as_double((long long) w); |
48 | 60 | #elif defined(__INTEL_COMPILER) |
49 | 61 | return _castu64_f64(w); |
62 | #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | |
63 | return _CopyDoubleFromInt64((__int64) w); | |
50 | 64 | #else |
51 | 65 | union { |
52 | 66 | uint64_t as_bits; |
63 | 77 | return (uint64_t) __double_as_longlong(f); |
64 | 78 | #elif defined(__INTEL_COMPILER) |
65 | 79 | return _castf64_u64(f); |
80 | #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) | |
81 | return (uint64_t) _CopyInt64FromDouble(f); | |
66 | 82 | #else |
67 | 83 | union { |
68 | 84 | double as_value; |