Lines Matching defs:value
73 // Returns the absolute value of its argument.
75 typename = typename std::enable_if<std::is_signed<T>::value>::type>
77 // This is a branch-free implementation of the absolute value function and is
113 if (std::is_signed<T>::value) {
124 CHECK(std::is_unsigned<T>::value);
134 if (std::is_signed<T>::value) {
145 CHECK(std::is_unsigned<T>::value);
160 static_assert(std::is_integral<T>::value, "only integral types");
176 std::is_integral<Narrow>::value && std::is_integral<Wide>::value,
178 static_assert(std::is_signed<Narrow>::value == std::is_signed<Wide>::value,
191 std::is_integral<Narrow>::value && std::is_integral<Wide>::value,
193 static_assert(std::is_signed<Narrow>::value == std::is_signed<Wide>::value,
202 static_assert(std::is_unsigned<T>::value, "Only for unsiged types");
306 void set(T* value) {
307 DCHECK(pointer_ == nullptr && value != nullptr);
308 pointer_ = value;
311 SetOncePointer& operator=(T* value) {
312 set(value);
327 STATIC_ASSERT(std::is_unsigned<lchar>::value);
328 STATIC_ASSERT(std::is_unsigned<rchar>::value);
353 STATIC_ASSERT(std::is_unsigned<lchar>::value);
354 STATIC_ASSERT(std::is_unsigned<rchar>::value);
587 static inline uint16_t ByteReverse16(uint16_t value) {
589 return __builtin_bswap16(value);
591 return value << 8 | (value >> 8 & 0x00FF);
595 static inline uint32_t ByteReverse32(uint32_t value) {
597 return __builtin_bswap32(value);
599 return value << 24 | ((value << 8) & 0x00FF0000) |
600 ((value >> 8) & 0x0000FF00) | ((value >> 24) & 0x00000FF);
604 static inline uint64_t ByteReverse64(uint64_t value) {
606 return __builtin_bswap64(value);
608 size_t bits_of_v = sizeof(value) * kBitsPerByte;
609 return value << (bits_of_v - 8) |
610 ((value << (bits_of_v - 24)) & 0x00FF000000000000) |
611 ((value << (bits_of_v - 40)) & 0x0000FF0000000000) |
612 ((value << (bits_of_v - 56)) & 0x000000FF00000000) |
613 ((value >> (bits_of_v - 56)) & 0x00000000FF000000) |
614 ((value >> (bits_of_v - 40)) & 0x0000000000FF0000) |
615 ((value >> (bits_of_v - 24)) & 0x000000000000FF00) |
616 ((value >> (bits_of_v - 8)) & 0x00000000000000FF);
621 static inline V ByteReverse(V value) {
622 size_t size_of_v = sizeof(value);
625 return value;
627 return static_cast<V>(ByteReverse16(static_cast<uint16_t>(value)));
629 return static_cast<V>(ByteReverse32(static_cast<uint32_t>(value)));
631 return static_cast<V>(ByteReverse64(static_cast<uint64_t>(value)));
641 T FpOpWorkaround(T input, T value) {
642 if (/*if -*/ std::signbit(input) && value == 0.0 &&
643 /*if +*/ !std::signbit(value)) {
646 return value;