Codebase list fp16 / a53544d
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
1 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
77 #include <stdint.h>
88 #endif
99
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
1018
1119 static inline float fp32_from_bits(uint32_t w) {
1220 #if defined(__OPENCL_VERSION__)
1523 return __uint_as_float((unsigned int) w);
1624 #elif defined(__INTEL_COMPILER)
1725 return _castu32_f32(w);
26 #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
27 return _CopyFloatFromInt32((__int32) w);
1828 #else
1929 union {
2030 uint32_t as_bits;
3141 return (uint32_t) __float_as_uint(f);
3242 #elif defined(__INTEL_COMPILER)
3343 return _castf32_u32(f);
44 #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
45 return (uint32_t) _CopyInt32FromFloat(f);
3446 #else
3547 union {
3648 float as_value;
4759 return __longlong_as_double((long long) w);
4860 #elif defined(__INTEL_COMPILER)
4961 return _castu64_f64(w);
62 #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
63 return _CopyDoubleFromInt64((__int64) w);
5064 #else
5165 union {
5266 uint64_t as_bits;
6377 return (uint64_t) __double_as_longlong(f);
6478 #elif defined(__INTEL_COMPILER)
6579 return _castf64_u64(f);
80 #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
81 return (uint64_t) _CopyInt64FromDouble(f);
6682 #else
6783 union {
6884 double as_value;