| 85 | const TaskStatistics EMPTY_STAT = { 0, 0, 0 }; |
| 86 | |
| 87 | AtomicInteger128::Value AtomicInteger128::load() const { |
| 88 | #if __x86_64__ || __ARM_NEON |
| 89 | // Supress compiler warning. |
| 90 | (void)_mutex; |
| 91 | #endif // __x86_64__ || __ARM_NEON |
| 92 | |
| 93 | #if __x86_64__ || __ARM_NEON |
| 94 | #ifdef __x86_64__ |
| 95 | __m128i value = _mm_load_si128(reinterpret_cast<const __m128i*>(&_value)); |
| 96 | #else // __ARM_NEON |
| 97 | int64x2_t value = vld1q_s64(reinterpret_cast<const int64_t*>(&_value)); |
| 98 | #endif // __x86_64__ |
| 99 | return {value[0], value[1]}; |
| 100 | #else // __x86_64__ || __ARM_NEON |
| 101 | // RISC-V and other architectures use mutex fallback |
| 102 | BAIDU_SCOPED_LOCK(const_cast<FastPthreadMutex&>(_mutex)); |
| 103 | return _value; |
| 104 | #endif // __x86_64__ || __ARM_NEON |
| 105 | } |
| 106 | |
| 107 | void AtomicInteger128::store(Value value) { |
| 108 | #if __x86_64__ |
no outgoing calls