5#ifndef V8_WASM_BASELINE_LIFTOFF_REGISTER_H_
6#define V8_WASM_BASELINE_LIFTOFF_REGISTER_H_
42 "kGpRegPair equals kNoReg if unused");
44 "kFpRegPair equals kNoReg if unused");
58 constexpr size_t kNumValueKinds =
static_cast<size_t>(kTop);
59 constexpr auto kRegClasses =
141 "encoding for gp pair and fp pair collides");
149 std::conditional<needed_bits <= 16, uint16_t, uint32_t>::type>
::type;
152 "chosen type is big enough");
157 "chosen type is small enough");
171#if defined(V8_TARGET_ARCH_IA32)
305 static_assert(
sizeof(int) >=
sizeof(
storage_t));
306 return static_cast<int>(
code_);
317 return code_ == other.code_;
321 if (other.is_pair())
return *
this == other.low() || *
this == other.high();
322 return *
this == other;
338 return os <<
reg.
gp();
340 return os <<
reg.
fp();
352 std::conditional<use_u32, uint32_t, uint64_t>::type>
::type;
369 template <
typename... Regs>
372 std::conjunction_v<std::disjunction<
373 std::is_same<Register, Regs>, std::is_same<DoubleRegister, Regs>,
374 std::is_same<LiftoffRegister, Regs>>...>)
494 inline Iterator
begin()
const;
495 inline Iterator
end()
const;
502 template <storage_t bits>
504 static_assert(bits == (bits & (
kGpMask |
kFpMask)),
"illegal reg list");
552 return kRegLists[rc];
557 for (
bool first =
true; !reglist.
is_empty(); first =
false) {
560 os << (first ?
"" :
", ") <<
reg;
constexpr RegisterT last() const
constexpr bool has(RegisterT reg) const
static constexpr RegListBase FromBits()
constexpr storage_t bits() const
static constexpr DwVfpRegister from_code(int8_t code)
constexpr int8_t code() const
static constexpr Register from_code(int code)
bool operator==(const Iterator &other) const =default
LiftoffRegList remaining_
Iterator(LiftoffRegList remaining)
LiftoffRegister operator*()
constexpr DoubleRegister set(DoubleRegister reg)
constexpr Register set(Register reg)
LiftoffRegister GetLastRegSet() const
constexpr DoubleRegister clear(DoubleRegister reg)
bool has(Register reg) const
static constexpr uint64_t kEvenFpSetMask
static constexpr storage_t kFpMask
constexpr LiftoffRegister clear(LiftoffRegister reg)
constexpr bool operator==(const LiftoffRegList &) const =default
LiftoffRegList MaskOut(const LiftoffRegList mask) const
constexpr LiftoffRegList(storage_t bits)
constexpr bool HasAdjacentFpRegsSet() const
static constexpr LiftoffRegList FromBits(storage_t bits)
std::conditional< use_u16, uint16_t, std::conditional< use_u32, uint32_t, uint64_t >::type >::type storage_t
constexpr LiftoffRegList & operator|=(const LiftoffRegList other)
static constexpr bool use_u32
bool has(DoubleRegister reg) const
constexpr LiftoffRegister set(LiftoffRegister reg)
constexpr LiftoffRegList(Regs... regs)
static constexpr uint64_t kOddFpSetMask
constexpr LiftoffRegList()=default
bool has(LiftoffRegister reg) const
DoubleRegList GetFpList()
constexpr bool is_empty() const
constexpr LiftoffRegList GetAdjacentFpRegsSet() const
constexpr unsigned GetNumRegsSet() const
constexpr LiftoffRegList & operator&=(const LiftoffRegList other)
LiftoffRegister GetFirstRegSet() const
static constexpr storage_t kGpMask
static constexpr LiftoffRegList FromBits()
constexpr LiftoffRegList SpreadSetBitsToAdjacentFpRegs() const
constexpr LiftoffRegList operator&(const LiftoffRegList other) const
static constexpr bool use_u16
constexpr LiftoffRegList operator|(const LiftoffRegList other) const
constexpr Register clear(Register reg)
bool operator==(const LiftoffRegister other) const
DoubleRegister high_fp() const
constexpr DoubleRegister fp() const
static LiftoffRegister from_liftoff_code(int code)
static LiftoffRegister ForFpPair(DoubleRegister low)
bool overlaps(const LiftoffRegister other) const
static LiftoffRegister from_code(RegClass rc, int code)
constexpr bool is_gp() const
LiftoffRegister high() const
constexpr bool is_fp() const
constexpr RegClass reg_class() const
static constexpr int needed_bits
constexpr bool is_gp_pair() const
static LiftoffRegister from_external_code(RegClass rc, ValueKind kind, int code)
static LiftoffRegister ForPair(Register low, Register high)
constexpr bool is_fp_pair() const
std::conditional< needed_bits<=8, uint8_t, std::conditional< needed_bits<=16, uint16_t, uint32_t >::type >::type storage_t
LiftoffRegister low() const
DoubleRegister low_fp() const
constexpr LiftoffRegister(storage_t code)
constexpr int liftoff_code() const
constexpr bool is_pair() const
constexpr LiftoffRegister(Register reg)
constexpr LiftoffRegister(DoubleRegister reg)
constexpr Register gp() const
constexpr unsigned CountLeadingZeros(T value)
constexpr unsigned CountTrailingZeros(T value)
constexpr unsigned CountPopulation(T value)
constexpr auto make_array(Function f)
static constexpr RegClass reg_class_for(ValueKind kind)
static constexpr int kBitsPerLiftoffRegCode
static constexpr int kMaxFpRegCode
static constexpr bool needs_gp_reg_pair(ValueKind kind)
static constexpr int kBitsPerFpRegCode
static constexpr bool needs_fp_reg_pair(ValueKind kind)
constexpr DoubleRegList kLiftoffAssemblerFpCacheRegs
static constexpr int kAfterMaxLiftoffRegCode
constexpr RegList kLiftoffAssemblerGpCacheRegs
static constexpr bool kNeedS128RegPair
static constexpr int kMaxGpRegCode
static constexpr int kBitsPerGpRegCode
static constexpr LiftoffRegList GetCacheRegList(RegClass rc)
static constexpr LiftoffRegList kGpCacheRegList
std::ostream & operator<<(std::ostream &os, LiftoffVarState slot)
static constexpr LiftoffRegList kFpCacheRegList
static constexpr int kAfterMaxLiftoffFpRegCode
static constexpr int kAfterMaxLiftoffGpRegCode
static constexpr bool kNeedI64RegPair
static constexpr int kBitsPerRegPair
constexpr AliasingKind kFPAliasing
void Print(Tagged< Object > obj)
constexpr int kSystemPointerSize
#define DCHECK_NE(v1, v2)
#define CONSTEXPR_UNREACHABLE()
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define ASSERT_TRIVIALLY_COPYABLE(T)