llvm/lldb/source/Plugins/Process/Utility/InstructionUtils.h

//===-- InstructionUtils.h --------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_INSTRUCTIONUTILS_H
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_INSTRUCTIONUTILS_H

#include <cassert>
#include <cstdint>

// Common utilities for manipulating instruction bit fields.

namespace lldb_private {

// Return the bit field(s) from the most significant bit (msbit) to the
// least significant bit (lsbit) of a 64-bit unsigned value.
static inline uint64_t Bits64(const uint64_t bits, const uint32_t msbit,
                              const uint32_t lsbit) {}

// Return the bit field(s) from the most significant bit (msbit) to the
// least significant bit (lsbit) of a 32-bit unsigned value.
static inline uint32_t Bits32(const uint32_t bits, const uint32_t msbit,
                              const uint32_t lsbit) {}

// Return the bit value from the 'bit' position of a 32-bit unsigned value.
static inline uint32_t Bit32(const uint32_t bits, const uint32_t bit) {}

static inline uint64_t Bit64(const uint64_t bits, const uint32_t bit) {}

// Set the bit field(s) from the most significant bit (msbit) to the
// least significant bit (lsbit) of a 32-bit unsigned value to 'val'.
static inline void SetBits32(uint32_t &bits, const uint32_t msbit,
                             const uint32_t lsbit, const uint32_t val) {}

// Set the 'bit' position of a 32-bit unsigned value to 'val'.
static inline void SetBit32(uint32_t &bits, const uint32_t bit,
                            const uint32_t val) {}

// Rotate a 32-bit unsigned value right by the specified amount.
static inline uint32_t Rotr32(uint32_t bits, uint32_t amt) {}

// Rotate a 32-bit unsigned value left by the specified amount.
static inline uint32_t Rotl32(uint32_t bits, uint32_t amt) {}

// Create a mask that starts at bit zero and includes "bit"
static inline uint64_t MaskUpToBit(const uint64_t bit) {}

// Return an integer result equal to the number of bits of x that are ones.
static inline uint32_t BitCount(uint64_t x) {}

static inline bool BitIsSet(const uint64_t value, const uint64_t bit) {}

static inline bool BitIsClear(const uint64_t value, const uint64_t bit) {}

static inline uint64_t UnsignedBits(const uint64_t value, const uint64_t msbit,
                                    const uint64_t lsbit) {}

static inline int64_t SignedBits(const uint64_t value, const uint64_t msbit,
                                 const uint64_t lsbit) {}

} // namespace lldb_private

#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_INSTRUCTIONUTILS_H