You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
rocksdb/third-party/folly/folly/portability/Asm.h

28 lines
712 B

// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#pragma once
#include <folly/Portability.h>
#include <cstdint>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace folly {
inline void asm_volatile_pause() {
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
::_mm_pause();
#elif defined(__i386__) || FOLLY_X64
asm volatile("pause");
#elif FOLLY_AARCH64 || defined(__arm__)
asm volatile("yield");
#elif FOLLY_PPC64
asm volatile("or 27,27,27");
#endif
}
} // namespace folly