//===- GroupOps.cpp - MLIR SPIR-V Group Ops ------------------------------===// // // 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 // //===----------------------------------------------------------------------===// // // Defines the group operations in the SPIR-V dialect. // //===----------------------------------------------------------------------===// #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" #include "mlir/Dialect/SPIRV/IR/TargetAndABI.h" #include "SPIRVOpUtils.h" #include "SPIRVParsingUtils.h" usingnamespacemlir::spirv::AttrNames; namespace mlir::spirv { template <typename OpTy> static ParseResult parseGroupNonUniformArithmeticOp(OpAsmParser &parser, OperationState &state) { … } template <typename GroupNonUniformArithmeticOpTy> static void printGroupNonUniformArithmeticOp(Operation *groupOp, OpAsmPrinter &printer) { … } template <typename OpTy> static LogicalResult verifyGroupNonUniformArithmeticOp(Operation *groupOp) { … } //===----------------------------------------------------------------------===// // spirv.GroupBroadcast //===----------------------------------------------------------------------===// LogicalResult GroupBroadcastOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBallotOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBallotOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBallotFindLSBOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBallotFindLSBOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBallotFindLSBOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBallotFindMSBOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBroadcast //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBroadcastOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformShuffle* //===----------------------------------------------------------------------===// template <typename OpTy> static LogicalResult verifyGroupNonUniformShuffleOp(OpTy op) { … } LogicalResult GroupNonUniformShuffleOp::verify() { … } LogicalResult GroupNonUniformShuffleDownOp::verify() { … } LogicalResult GroupNonUniformShuffleUpOp::verify() { … } LogicalResult GroupNonUniformShuffleXorOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformElectOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformElectOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformFAddOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformFAddOp::verify() { … } ParseResult GroupNonUniformFAddOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformFAddOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformFMaxOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformFMaxOp::verify() { … } ParseResult GroupNonUniformFMaxOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformFMaxOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformFMinOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformFMinOp::verify() { … } ParseResult GroupNonUniformFMinOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformFMinOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformFMulOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformFMulOp::verify() { … } ParseResult GroupNonUniformFMulOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformFMulOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformIAddOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformIAddOp::verify() { … } ParseResult GroupNonUniformIAddOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformIAddOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformIMulOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformIMulOp::verify() { … } ParseResult GroupNonUniformIMulOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformIMulOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformSMaxOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformSMaxOp::verify() { … } ParseResult GroupNonUniformSMaxOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformSMaxOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformSMinOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformSMinOp::verify() { … } ParseResult GroupNonUniformSMinOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformSMinOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformUMaxOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformUMaxOp::verify() { … } ParseResult GroupNonUniformUMaxOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformUMaxOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformUMinOp //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformUMinOp::verify() { … } ParseResult GroupNonUniformUMinOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformUMinOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBitwiseAnd //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBitwiseAndOp::verify() { … } ParseResult GroupNonUniformBitwiseAndOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformBitwiseAndOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBitwiseOr //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBitwiseOrOp::verify() { … } ParseResult GroupNonUniformBitwiseOrOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformBitwiseOrOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformBitwiseXor //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformBitwiseXorOp::verify() { … } ParseResult GroupNonUniformBitwiseXorOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformBitwiseXorOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformLogicalAnd //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformLogicalAndOp::verify() { … } ParseResult GroupNonUniformLogicalAndOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformLogicalAndOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformLogicalOr //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformLogicalOrOp::verify() { … } ParseResult GroupNonUniformLogicalOrOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformLogicalOrOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // spirv.GroupNonUniformLogicalXor //===----------------------------------------------------------------------===// LogicalResult GroupNonUniformLogicalXorOp::verify() { … } ParseResult GroupNonUniformLogicalXorOp::parse(OpAsmParser &parser, OperationState &result) { … } void GroupNonUniformLogicalXorOp::print(OpAsmPrinter &p) { … } //===----------------------------------------------------------------------===// // Group op verification //===----------------------------------------------------------------------===// template <typename Op> static LogicalResult verifyGroupOp(Op op) { … } LogicalResult GroupIAddOp::verify() { … } LogicalResult GroupFAddOp::verify() { … } LogicalResult GroupFMinOp::verify() { … } LogicalResult GroupUMinOp::verify() { … } LogicalResult GroupSMinOp::verify() { … } LogicalResult GroupFMaxOp::verify() { … } LogicalResult GroupUMaxOp::verify() { … } LogicalResult GroupSMaxOp::verify() { … } LogicalResult GroupIMulKHROp::verify() { … } LogicalResult GroupFMulKHROp::verify() { … } } // namespace mlir::spirv