5#ifndef V8_INTERPRETER_BYTECODE_OPERANDS_H_
6#define V8_INTERPRETER_BYTECODE_OPERANDS_H_
13namespace interpreter {
15#define INVALID_OPERAND_TYPE_LIST(V) V(None, OperandTypeInfo::kNone)
17#define REGISTER_INPUT_OPERAND_TYPE_LIST(V) \
18 V(Reg, OperandTypeInfo::kScalableSignedByte) \
19 V(RegList, OperandTypeInfo::kScalableSignedByte) \
20 V(RegPair, OperandTypeInfo::kScalableSignedByte)
22#define REGISTER_OUTPUT_OPERAND_TYPE_LIST(V) \
23 V(RegOut, OperandTypeInfo::kScalableSignedByte) \
24 V(RegOutList, OperandTypeInfo::kScalableSignedByte) \
25 V(RegOutPair, OperandTypeInfo::kScalableSignedByte) \
26 V(RegOutTriple, OperandTypeInfo::kScalableSignedByte)
28#define SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V) \
29 V(Imm, OperandTypeInfo::kScalableSignedByte)
31#define UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V) \
32 V(Idx, OperandTypeInfo::kScalableUnsignedByte) \
33 V(UImm, OperandTypeInfo::kScalableUnsignedByte) \
34 V(RegCount, OperandTypeInfo::kScalableUnsignedByte)
36#define UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(V) \
37 V(Flag8, OperandTypeInfo::kFixedUnsignedByte) \
38 V(Flag16, OperandTypeInfo::kFixedUnsignedShort) \
39 V(IntrinsicId, OperandTypeInfo::kFixedUnsignedByte) \
40 V(RuntimeId, OperandTypeInfo::kFixedUnsignedShort) \
41 V(NativeContextIndex, OperandTypeInfo::kFixedUnsignedByte)
44#define NON_REGISTER_OPERAND_TYPE_LIST(V) \
45 INVALID_OPERAND_TYPE_LIST(V) \
46 UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(V) \
47 UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V) \
48 SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V)
51#define REGISTER_OPERAND_TYPE_LIST(V) \
52 REGISTER_INPUT_OPERAND_TYPE_LIST(V) \
53 REGISTER_OUTPUT_OPERAND_TYPE_LIST(V) \
54 V(RegInOut, OperandTypeInfo::kScalableSignedByte)
58#define OPERAND_TYPE_LIST(V) \
59 NON_REGISTER_OPERAND_TYPE_LIST(V) \
60 REGISTER_OPERAND_TYPE_LIST(V)
64#define OPERAND_SCALE_LIST(V) \
70#define DECLARE_OPERAND_SCALE(Name, Scale) k##Name = Scale,
72#undef DECLARE_OPERAND_SCALE
89#define OPERAND_TYPE_INFO_LIST(V) \
90 V(None, false, false, OperandSize::kNone) \
91 V(ScalableSignedByte, true, false, OperandSize::kByte) \
92 V(ScalableUnsignedByte, true, true, OperandSize::kByte) \
93 V(FixedUnsignedByte, false, true, OperandSize::kByte) \
94 V(FixedUnsignedShort, false, true, OperandSize::kShort)
97#define DECLARE_OPERAND_TYPE_INFO(Name, ...) k##Name,
99#undef DECLARE_OPERAND_TYPE_INFO
104#define DECLARE_OPERAND_TYPE(Name, _) k##Name,
106#undef DECLARE_OPERAND_TYPE
107#define COUNT_OPERAND_TYPES(x, _) +1
111#undef COUNT_OPERAND_TYPES
128 static_cast<int>(rhs));
134 static_cast<int>(rhs));
152#define OPERAND_SCALE_COUNT(...) +1
155#undef OPERAND_SCALE_COUNT
159 int result =
static_cast<int>(operand_scale) >> 1;
160 switch (operand_scale) {
161 case OperandScale::kSingle:
164 case OperandScale::kDouble:
167 case OperandScale::kQuadruple:
174 return static_cast<int>(operand_scale) >> 1;
205 return (implicit_register_use &
222 OperandType::kRegInOut);
228 OperandType::kRegCount);
#define OPERAND_TYPE_LIST(V)
#define OPERAND_SCALE_LIST(V)
#define OPERAND_TYPE_INFO_LIST(V)
#define OPERAND_SCALE_COUNT(...)
static constexpr bool IsScalableSignedByte(OperandType operand_type)
static constexpr bool WritesImplicitRegister(ImplicitRegisterUse implicit_register_use)
static constexpr bool ReadsAccumulator(ImplicitRegisterUse implicit_register_use)
static constexpr bool ClobbersAccumulator(ImplicitRegisterUse implicit_register_use)
static const int kOperandScaleCount
static constexpr bool IsScalableUnsignedByte(OperandType operand_type)
static constexpr bool WritesAccumulator(ImplicitRegisterUse implicit_register_use)
static const int kOperandTypeCount
static constexpr bool WritesOrClobbersAccumulator(ImplicitRegisterUse implicit_register_use)
static constexpr int OperandScaleAsIndex(OperandScale operand_scale)
ZoneVector< RpoNumber > & result
constexpr bool IsInRange(T value, U lower_limit, U higher_limit)
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
DECLARE_OPERAND_TYPE_INFO(Name,...)
constexpr ImplicitRegisterUse operator|(ImplicitRegisterUse lhs, ImplicitRegisterUse rhs)
COUNT_OPERAND_TYPES(x, _)
DECLARE_OPERAND_TYPE(Name, _)
constexpr ImplicitRegisterUse operator&(ImplicitRegisterUse lhs, ImplicitRegisterUse rhs)
@ kReadAndClobberAccumulator
@ kReadAccumulatorWriteShortStar
DECLARE_OPERAND_SCALE(Name, Scale)
#define DCHECK_EQ(v1, v2)
#define V8_EXPORT_PRIVATE