| 1744 | // Read 4 UC into a u32. Truncates UC if not char. |
| 1745 | template <typename UC> |
| 1746 | fastfloat_really_inline FASTFLOAT_CONSTEXPR20 uint32_t |
| 1747 | read4_to_u32(UC const *chars) { |
| 1748 | if (cpp20_and_in_constexpr() || !std::is_same<UC, char>::value) { |
| 1749 | uint32_t val = 0; |
| 1750 | for (int i = 0; i < 4; ++i) { |
| 1751 | val |= uint32_t(uint8_t(*chars)) << (i * 8); |
| 1752 | ++chars; |
| 1753 | } |
| 1754 | return val; |
| 1755 | } |
| 1756 | uint32_t val; |
| 1757 | ::memcpy(&val, chars, sizeof(uint32_t)); |
| 1758 | #if FASTFLOAT_IS_BIG_ENDIAN == 1 |
| 1759 | val = byteswap_32(val); |
| 1760 | #endif |
| 1761 | return val; |
| 1762 | } |
| 1763 | #ifdef FASTFLOAT_SSE2 |
| 1764 | |
| 1765 | fastfloat_really_inline uint64_t simd_read8_to_u64(__m128i const data) { |
no test coverage detected