/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|*                                                                            *|
|* Enum Utility Declarations                                                  *|
|*                                                                            *|
|* Automatically generated file, do not edit!                                 *|
|* From: XeVMOps.td                                                           *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

namespace mlir::xevm {

// Address spaces
enum class AddrSpace : uint32_t {
  PRIVATE = 0,
  GLOBAL = 1,
  CONSTANT = 2,
  SHARED = 3,
  GENERIC = 4,
};

::std::optional<AddrSpace> symbolizeAddrSpace(uint32_t);
::llvm::StringRef stringifyAddrSpace(AddrSpace);
::std::optional<AddrSpace> symbolizeAddrSpace(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForAddrSpace() {
  return 4;
}


inline ::llvm::StringRef stringifyEnum(AddrSpace enumValue) {
  return stringifyAddrSpace(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<AddrSpace> symbolizeEnum<AddrSpace>(::llvm::StringRef str) {
  return symbolizeAddrSpace(str);
}

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<mlir::xevm::AddrSpace, mlir::xevm::AddrSpace> {
  template <typename ParserT>
  static FailureOr<mlir::xevm::AddrSpace> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for Address spaces");

    // Symbolize the keyword.
    if (::std::optional<mlir::xevm::AddrSpace> attr = mlir::xevm::symbolizeEnum<mlir::xevm::AddrSpace>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [private, global, constant, shared, generic] for Address spaces, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<mlir::xevm::AddrSpace>, std::optional<mlir::xevm::AddrSpace>> {
  template <typename ParserT>
  static FailureOr<std::optional<mlir::xevm::AddrSpace>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"private", "global", "constant", "shared", "generic"})))
      return std::optional<mlir::xevm::AddrSpace>{};

    // Symbolize the keyword.
    if (::std::optional<mlir::xevm::AddrSpace> attr = mlir::xevm::symbolizeEnum<mlir::xevm::AddrSpace>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [private, global, constant, shared, generic] for Address spaces, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, mlir::xevm::AddrSpace value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<mlir::xevm::AddrSpace> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const mlir::xevm::AddrSpace &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const mlir::xevm::AddrSpace &lhs, const mlir::xevm::AddrSpace &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// XeVM element type
enum class ElemType : uint32_t {
  BF16 = 8,
  F16 = 9,
  S8 = 10,
  U8 = 11,
  S4 = 12,
  U4 = 13,
  TF32 = 14,
  F32 = 15,
  S32 = 16,
  E2M1 = 17,
  BF8 = 18,
  F8 = 19,
};

::std::optional<ElemType> symbolizeElemType(uint32_t);
::llvm::StringRef stringifyElemType(ElemType);
::std::optional<ElemType> symbolizeElemType(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForElemType() {
  return 19;
}


inline ::llvm::StringRef stringifyEnum(ElemType enumValue) {
  return stringifyElemType(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<ElemType> symbolizeEnum<ElemType>(::llvm::StringRef str) {
  return symbolizeElemType(str);
}

class ElemTypeAttr : public ::mlir::IntegerAttr {
public:
  using ValueType = ElemType;
  using ::mlir::IntegerAttr::IntegerAttr;
  static bool classof(::mlir::Attribute attr);
  static ElemTypeAttr get(::mlir::MLIRContext *context, ElemType val);
  ElemType getValue() const;
};

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::ElemType, ::mlir::xevm::ElemType> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::ElemType> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for XeVM element type");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ElemType> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ElemType>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [bf16, f16, s8, u8, s4, u4, tf32, f32, s32, e2m1, bf8, f8] for XeVM element type, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::ElemType>, std::optional<::mlir::xevm::ElemType>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::ElemType>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf16", "f16", "s8", "u8", "s4", "u4", "tf32", "f32", "s32", "e2m1", "bf8", "f8"})))
      return std::optional<::mlir::xevm::ElemType>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ElemType> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ElemType>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [bf16, f16, s8, u8, s4, u4, tf32, f32, s32, e2m1, bf8, f8] for XeVM element type, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ElemType value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::ElemType> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::ElemType &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::ElemType &lhs, const ::mlir::xevm::ElemType &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// Destination element type for xevm.extf
enum class ExtfDstElemTypes : uint32_t {
  F16 = 9,
  BF16 = 8,
};

::std::optional<ExtfDstElemTypes> symbolizeExtfDstElemTypes(uint32_t);
::llvm::StringRef stringifyExtfDstElemTypes(ExtfDstElemTypes);
::std::optional<ExtfDstElemTypes> symbolizeExtfDstElemTypes(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForExtfDstElemTypes() {
  return 9;
}


inline ::llvm::StringRef stringifyEnum(ExtfDstElemTypes enumValue) {
  return stringifyExtfDstElemTypes(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<ExtfDstElemTypes> symbolizeEnum<ExtfDstElemTypes>(::llvm::StringRef str) {
  return symbolizeExtfDstElemTypes(str);
}

class ExtfDstElemTypesAttr : public ::mlir::IntegerAttr {
public:
  using ValueType = ExtfDstElemTypes;
  using ::mlir::IntegerAttr::IntegerAttr;
  static bool classof(::mlir::Attribute attr);
  static ExtfDstElemTypesAttr get(::mlir::MLIRContext *context, ExtfDstElemTypes val);
  ExtfDstElemTypes getValue() const;
};

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::ExtfDstElemTypes, ::mlir::xevm::ExtfDstElemTypes> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::ExtfDstElemTypes> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for Destination element type for xevm.extf");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ExtfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfDstElemTypes>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [f16, bf16] for Destination element type for xevm.extf, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::ExtfDstElemTypes>, std::optional<::mlir::xevm::ExtfDstElemTypes>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::ExtfDstElemTypes>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"f16", "bf16"})))
      return std::optional<::mlir::xevm::ExtfDstElemTypes>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ExtfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfDstElemTypes>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [f16, bf16] for Destination element type for xevm.extf, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ExtfDstElemTypes value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::ExtfDstElemTypes> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::ExtfDstElemTypes &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::ExtfDstElemTypes &lhs, const ::mlir::xevm::ExtfDstElemTypes &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// Source element type for xevm.extf
enum class ExtfSrcElemTypes : uint32_t {
  BF8 = 18,
  F8 = 19,
  E2M1 = 17,
};

::std::optional<ExtfSrcElemTypes> symbolizeExtfSrcElemTypes(uint32_t);
::llvm::StringRef stringifyExtfSrcElemTypes(ExtfSrcElemTypes);
::std::optional<ExtfSrcElemTypes> symbolizeExtfSrcElemTypes(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForExtfSrcElemTypes() {
  return 19;
}


inline ::llvm::StringRef stringifyEnum(ExtfSrcElemTypes enumValue) {
  return stringifyExtfSrcElemTypes(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<ExtfSrcElemTypes> symbolizeEnum<ExtfSrcElemTypes>(::llvm::StringRef str) {
  return symbolizeExtfSrcElemTypes(str);
}

class ExtfSrcElemTypesAttr : public ::mlir::IntegerAttr {
public:
  using ValueType = ExtfSrcElemTypes;
  using ::mlir::IntegerAttr::IntegerAttr;
  static bool classof(::mlir::Attribute attr);
  static ExtfSrcElemTypesAttr get(::mlir::MLIRContext *context, ExtfSrcElemTypes val);
  ExtfSrcElemTypes getValue() const;
};

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::ExtfSrcElemTypes, ::mlir::xevm::ExtfSrcElemTypes> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::ExtfSrcElemTypes> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for Source element type for xevm.extf");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ExtfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfSrcElemTypes>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Source element type for xevm.extf, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::ExtfSrcElemTypes>, std::optional<::mlir::xevm::ExtfSrcElemTypes>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::ExtfSrcElemTypes>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf8", "f8", "e2m1"})))
      return std::optional<::mlir::xevm::ExtfSrcElemTypes>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::ExtfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfSrcElemTypes>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Source element type for xevm.extf, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ExtfSrcElemTypes value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::ExtfSrcElemTypes> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::ExtfSrcElemTypes &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::ExtfSrcElemTypes &lhs, const ::mlir::xevm::ExtfSrcElemTypes &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// XeVM load ops cache control
enum class LoadCacheControl : uint32_t {
  USE_DEFAULT = 0,
  L1UC_L2UC_L3UC = 1,
  L1UC_L2UC_L3C = 2,
  L1UC_L2C_L3UC = 3,
  L1UC_L2C_L3C = 4,
  L1C_L2UC_L3UC = 5,
  L1C_L2UC_L3C = 6,
  L1C_L2C_L3UC = 7,
  L1C_L2C_L3C = 8,
  L1S_L2UC_L3UC = 9,
  L1S_L2UC_L3C = 10,
  L1S_L2C_L3UC = 11,
  L1S_L2C_L3C = 12,
  INVALIDATE_READ = 13,
};

::std::optional<LoadCacheControl> symbolizeLoadCacheControl(uint32_t);
::llvm::StringRef stringifyLoadCacheControl(LoadCacheControl);
::std::optional<LoadCacheControl> symbolizeLoadCacheControl(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForLoadCacheControl() {
  return 13;
}


inline ::llvm::StringRef stringifyEnum(LoadCacheControl enumValue) {
  return stringifyLoadCacheControl(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<LoadCacheControl> symbolizeEnum<LoadCacheControl>(::llvm::StringRef str) {
  return symbolizeLoadCacheControl(str);
}

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::LoadCacheControl, ::mlir::xevm::LoadCacheControl> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::LoadCacheControl> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for XeVM load ops cache control");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::LoadCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::LoadCacheControl>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3c, L1uc_L2c_L3uc, L1uc_L2c_L3c, L1c_L2uc_L3uc, L1c_L2uc_L3c, L1c_L2c_L3uc, L1c_L2c_L3c, L1s_L2uc_L3uc, L1s_L2uc_L3c, L1s_L2c_L3uc, L1s_L2c_L3c, ir] for XeVM load ops cache control, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::LoadCacheControl>, std::optional<::mlir::xevm::LoadCacheControl>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::LoadCacheControl>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"Use_Default", "L1uc_L2uc_L3uc", "L1uc_L2uc_L3c", "L1uc_L2c_L3uc", "L1uc_L2c_L3c", "L1c_L2uc_L3uc", "L1c_L2uc_L3c", "L1c_L2c_L3uc", "L1c_L2c_L3c", "L1s_L2uc_L3uc", "L1s_L2uc_L3c", "L1s_L2c_L3uc", "L1s_L2c_L3c", "ir"})))
      return std::optional<::mlir::xevm::LoadCacheControl>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::LoadCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::LoadCacheControl>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3c, L1uc_L2c_L3uc, L1uc_L2c_L3c, L1c_L2uc_L3uc, L1c_L2uc_L3c, L1c_L2c_L3uc, L1c_L2c_L3c, L1s_L2uc_L3uc, L1s_L2uc_L3c, L1s_L2c_L3uc, L1s_L2c_L3c, ir] for XeVM load ops cache control, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::LoadCacheControl value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::LoadCacheControl> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::LoadCacheControl &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::LoadCacheControl &lhs, const ::mlir::xevm::LoadCacheControl &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// XeVM memory scope
enum class MemScope : uint32_t {
  LANE = 0,
  SUBGROUP = 1,
  WORKGROUP = 2,
  CLUSTER = 3,
  DEVICE = 4,
  SYSTEM = 5,
};

::std::optional<MemScope> symbolizeMemScope(uint32_t);
::llvm::StringRef stringifyMemScope(MemScope);
::std::optional<MemScope> symbolizeMemScope(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForMemScope() {
  return 5;
}


inline ::llvm::StringRef stringifyEnum(MemScope enumValue) {
  return stringifyMemScope(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<MemScope> symbolizeEnum<MemScope>(::llvm::StringRef str) {
  return symbolizeMemScope(str);
}

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::MemScope, ::mlir::xevm::MemScope> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::MemScope> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for XeVM memory scope");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::MemScope> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::MemScope>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [lane, subgroup, workgroup, cluster, device, system] for XeVM memory scope, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::MemScope>, std::optional<::mlir::xevm::MemScope>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::MemScope>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"lane", "subgroup", "workgroup", "cluster", "device", "system"})))
      return std::optional<::mlir::xevm::MemScope>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::MemScope> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::MemScope>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [lane, subgroup, workgroup, cluster, device, system] for XeVM memory scope, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::MemScope value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::MemScope> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::MemScope &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::MemScope &lhs, const ::mlir::xevm::MemScope &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// XeVM store ops cache control
enum class StoreCacheControl : uint32_t {
  USE_DEFAULT = 0,
  L1UC_L2UC_L3UC = 1,
  L1UC_L2UC_L3WB = 2,
  L1UC_L2WB_L3UC = 3,
  L1UC_L2WB_L3WB = 4,
  L1WT_L2UC_L3UC = 5,
  L1WT_L2UC_L3WB = 6,
  L1WT_L2WB_L3UC = 7,
  L1WT_L2WB_L3WB = 8,
  L1S_L2UC_L3UC = 9,
  L1S_L2UC_L3WB = 10,
  L1S_L2WB_L3UC = 11,
  L1S_L2WB_L3WB = 12,
  L1WB_L2UC_L3UC = 13,
  L1WB_L2WB_L3UC = 14,
  L1WB_L2UC_L3WB = 15,
};

::std::optional<StoreCacheControl> symbolizeStoreCacheControl(uint32_t);
::llvm::StringRef stringifyStoreCacheControl(StoreCacheControl);
::std::optional<StoreCacheControl> symbolizeStoreCacheControl(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForStoreCacheControl() {
  return 15;
}


inline ::llvm::StringRef stringifyEnum(StoreCacheControl enumValue) {
  return stringifyStoreCacheControl(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<StoreCacheControl> symbolizeEnum<StoreCacheControl>(::llvm::StringRef str) {
  return symbolizeStoreCacheControl(str);
}

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::StoreCacheControl, ::mlir::xevm::StoreCacheControl> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::StoreCacheControl> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for XeVM store ops cache control");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::StoreCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::StoreCacheControl>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3wb, L1uc_L2wb_L3uc, L1uc_L2wb_L3wb, L1wt_L2uc_L3uc, L1wt_L2uc_L3wb, L1wt_L2wb_L3uc, L1wt_L2wb_L3wb, L1s_L2uc_L3uc, L1s_L2uc_L3wb, L1s_L2wb_L3uc, L1s_L2wb_L3wb, L1wb_L2uc_L3uc, L1wb_L2wb_L3uc, L1wb_L2uc_L3wb] for XeVM store ops cache control, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::StoreCacheControl>, std::optional<::mlir::xevm::StoreCacheControl>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::StoreCacheControl>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"Use_Default", "L1uc_L2uc_L3uc", "L1uc_L2uc_L3wb", "L1uc_L2wb_L3uc", "L1uc_L2wb_L3wb", "L1wt_L2uc_L3uc", "L1wt_L2uc_L3wb", "L1wt_L2wb_L3uc", "L1wt_L2wb_L3wb", "L1s_L2uc_L3uc", "L1s_L2uc_L3wb", "L1s_L2wb_L3uc", "L1s_L2wb_L3wb", "L1wb_L2uc_L3uc", "L1wb_L2wb_L3uc", "L1wb_L2uc_L3wb"})))
      return std::optional<::mlir::xevm::StoreCacheControl>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::StoreCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::StoreCacheControl>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3wb, L1uc_L2wb_L3uc, L1uc_L2wb_L3wb, L1wt_L2uc_L3uc, L1wt_L2uc_L3wb, L1wt_L2wb_L3uc, L1wt_L2wb_L3wb, L1s_L2uc_L3uc, L1s_L2uc_L3wb, L1s_L2wb_L3uc, L1s_L2wb_L3wb, L1wb_L2uc_L3uc, L1wb_L2wb_L3uc, L1wb_L2uc_L3wb] for XeVM store ops cache control, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::StoreCacheControl value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::StoreCacheControl> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::StoreCacheControl &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::StoreCacheControl &lhs, const ::mlir::xevm::StoreCacheControl &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// Destination element type for xevm.truncf
enum class TruncfDstElemTypes : uint32_t {
  BF8 = 18,
  F8 = 19,
  E2M1 = 17,
};

::std::optional<TruncfDstElemTypes> symbolizeTruncfDstElemTypes(uint32_t);
::llvm::StringRef stringifyTruncfDstElemTypes(TruncfDstElemTypes);
::std::optional<TruncfDstElemTypes> symbolizeTruncfDstElemTypes(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForTruncfDstElemTypes() {
  return 19;
}


inline ::llvm::StringRef stringifyEnum(TruncfDstElemTypes enumValue) {
  return stringifyTruncfDstElemTypes(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<TruncfDstElemTypes> symbolizeEnum<TruncfDstElemTypes>(::llvm::StringRef str) {
  return symbolizeTruncfDstElemTypes(str);
}

class TruncfDstElemTypesAttr : public ::mlir::IntegerAttr {
public:
  using ValueType = TruncfDstElemTypes;
  using ::mlir::IntegerAttr::IntegerAttr;
  static bool classof(::mlir::Attribute attr);
  static TruncfDstElemTypesAttr get(::mlir::MLIRContext *context, TruncfDstElemTypes val);
  TruncfDstElemTypes getValue() const;
};

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::TruncfDstElemTypes, ::mlir::xevm::TruncfDstElemTypes> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::TruncfDstElemTypes> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for Destination element type for xevm.truncf");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::TruncfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfDstElemTypes>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Destination element type for xevm.truncf, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::TruncfDstElemTypes>, std::optional<::mlir::xevm::TruncfDstElemTypes>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::TruncfDstElemTypes>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf8", "f8", "e2m1"})))
      return std::optional<::mlir::xevm::TruncfDstElemTypes>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::TruncfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfDstElemTypes>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Destination element type for xevm.truncf, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::TruncfDstElemTypes value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::TruncfDstElemTypes> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::TruncfDstElemTypes &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::TruncfDstElemTypes &lhs, const ::mlir::xevm::TruncfDstElemTypes &rhs) {
    return lhs == rhs;
  }
};
}

namespace mlir::xevm {

// Source element type for xevm.truncf
enum class TruncfSrcElemTypes : uint32_t {
  F16 = 9,
  BF16 = 8,
};

::std::optional<TruncfSrcElemTypes> symbolizeTruncfSrcElemTypes(uint32_t);
::llvm::StringRef stringifyTruncfSrcElemTypes(TruncfSrcElemTypes);
::std::optional<TruncfSrcElemTypes> symbolizeTruncfSrcElemTypes(::llvm::StringRef);
inline constexpr unsigned getMaxEnumValForTruncfSrcElemTypes() {
  return 9;
}


inline ::llvm::StringRef stringifyEnum(TruncfSrcElemTypes enumValue) {
  return stringifyTruncfSrcElemTypes(enumValue);
}

template <typename EnumType>
::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);

template <>
inline ::std::optional<TruncfSrcElemTypes> symbolizeEnum<TruncfSrcElemTypes>(::llvm::StringRef str) {
  return symbolizeTruncfSrcElemTypes(str);
}

class TruncfSrcElemTypesAttr : public ::mlir::IntegerAttr {
public:
  using ValueType = TruncfSrcElemTypes;
  using ::mlir::IntegerAttr::IntegerAttr;
  static bool classof(::mlir::Attribute attr);
  static TruncfSrcElemTypesAttr get(::mlir::MLIRContext *context, TruncfSrcElemTypes val);
  TruncfSrcElemTypes getValue() const;
};

} // namespace mlir::xevm

namespace mlir {
template <typename T, typename>
struct FieldParser;

template<>
struct FieldParser<::mlir::xevm::TruncfSrcElemTypes, ::mlir::xevm::TruncfSrcElemTypes> {
  template <typename ParserT>
  static FailureOr<::mlir::xevm::TruncfSrcElemTypes> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
      return parser.emitError(loc, "expected keyword for Source element type for xevm.truncf");

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::TruncfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfSrcElemTypes>(enumKeyword))
      return *attr;
    return parser.emitError(loc, "expected one of [f16, bf16] for Source element type for xevm.truncf, got: ") << enumKeyword;
  }
};

/// Support for std::optional, useful in attribute/type definition where the enum is
/// used as:
///
///    let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value);
template<>
struct FieldParser<std::optional<::mlir::xevm::TruncfSrcElemTypes>, std::optional<::mlir::xevm::TruncfSrcElemTypes>> {
  template <typename ParserT>
  static FailureOr<std::optional<::mlir::xevm::TruncfSrcElemTypes>> parse(ParserT &parser) {
    // Parse the keyword/string containing the enum.
    std::string enumKeyword;
    auto loc = parser.getCurrentLocation();
    if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"f16", "bf16"})))
      return std::optional<::mlir::xevm::TruncfSrcElemTypes>{};

    // Symbolize the keyword.
    if (::std::optional<::mlir::xevm::TruncfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfSrcElemTypes>(enumKeyword))
      return attr;
    return parser.emitError(loc, "expected one of [f16, bf16] for Source element type for xevm.truncf, got: ") << enumKeyword;
  }
};
} // namespace mlir

namespace llvm {
inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::TruncfSrcElemTypes value) {
  auto valueStr = stringifyEnum(value);
  return p << valueStr;
}
} // namespace llvm

namespace llvm {
template<> struct DenseMapInfo<::mlir::xevm::TruncfSrcElemTypes> {
  using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;

  static unsigned getHashValue(const ::mlir::xevm::TruncfSrcElemTypes &val) {
    return StorageInfo::getHashValue(static_cast<uint32_t>(val));
  }

  static bool isEqual(const ::mlir::xevm::TruncfSrcElemTypes &lhs, const ::mlir::xevm::TruncfSrcElemTypes &rhs) {
    return lhs == rhs;
  }
};
}

