include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
-class SPV_ArithmeticOp<string mnemonic, Type type,
+class SPV_ArithmeticBinaryOp<string mnemonic, Type type,
list<OpTrait> traits = []> :
// Operands type same as result type.
SPV_BinaryOp<mnemonic, type, type,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultType])>;
-class SPV_UnaryArithmeticOp<string mnemonic, Type type,
+class SPV_ArithmeticUnaryOp<string mnemonic, Type type,
list<OpTrait> traits = []> :
// Operand type same as result type.
SPV_UnaryOp<mnemonic, type, type,
// -----
-def SPV_FAddOp : SPV_ArithmeticOp<"FAdd", SPV_Float, [Commutative]> {
+def SPV_FAddOp : SPV_ArithmeticBinaryOp<"FAdd", SPV_Float, [Commutative]> {
let summary = "Floating-point addition of Operand 1 and Operand 2.";
let description = [{
// -----
-def SPV_FDivOp : SPV_ArithmeticOp<"FDiv", SPV_Float, []> {
+def SPV_FDivOp : SPV_ArithmeticBinaryOp<"FDiv", SPV_Float, []> {
let summary = "Floating-point division of Operand 1 divided by Operand 2.";
let description = [{
// -----
-def SPV_FModOp : SPV_ArithmeticOp<"FMod", SPV_Float, []> {
+def SPV_FModOp : SPV_ArithmeticBinaryOp<"FMod", SPV_Float, []> {
let summary = [{
The floating-point remainder whose sign matches the sign of Operand 2.
}];
// -----
-def SPV_FMulOp : SPV_ArithmeticOp<"FMul", SPV_Float, [Commutative]> {
+def SPV_FMulOp : SPV_ArithmeticBinaryOp<"FMul", SPV_Float, [Commutative]> {
let summary = "Floating-point multiplication of Operand 1 and Operand 2.";
let description = [{
// -----
-def SPV_FNegateOp : SPV_UnaryArithmeticOp<"FNegate", SPV_Float, []> {
+def SPV_FNegateOp : SPV_ArithmeticUnaryOp<"FNegate", SPV_Float, []> {
let summary = "Floating-point subtract of Operand from zero.";
let description = [{
// -----
-def SPV_FRemOp : SPV_ArithmeticOp<"FRem", SPV_Float, []> {
+def SPV_FRemOp : SPV_ArithmeticBinaryOp<"FRem", SPV_Float, []> {
let summary = [{
The floating-point remainder whose sign matches the sign of Operand 1.
}];
// -----
-def SPV_FSubOp : SPV_ArithmeticOp<"FSub", SPV_Float, []> {
+def SPV_FSubOp : SPV_ArithmeticBinaryOp<"FSub", SPV_Float, []> {
let summary = "Floating-point subtraction of Operand 2 from Operand 1.";
let description = [{
// -----
-def SPV_IAddOp : SPV_ArithmeticOp<"IAdd", SPV_Integer, [Commutative]> {
+def SPV_IAddOp : SPV_ArithmeticBinaryOp<"IAdd", SPV_Integer, [Commutative]> {
let summary = "Integer addition of Operand 1 and Operand 2.";
let description = [{
// -----
-def SPV_IMulOp : SPV_ArithmeticOp<"IMul", SPV_Integer, [Commutative]> {
+def SPV_IMulOp : SPV_ArithmeticBinaryOp<"IMul", SPV_Integer, [Commutative]> {
let summary = "Integer multiplication of Operand 1 and Operand 2.";
let description = [{
// -----
-def SPV_ISubOp : SPV_ArithmeticOp<"ISub", SPV_Integer, []> {
+def SPV_ISubOp : SPV_ArithmeticBinaryOp<"ISub", SPV_Integer, []> {
let summary = "Integer subtraction of Operand 2 from Operand 1.";
let description = [{
// -----
-def SPV_SDivOp : SPV_ArithmeticOp<"SDiv", SPV_Integer, []> {
+def SPV_SDivOp : SPV_ArithmeticBinaryOp<"SDiv", SPV_Integer, []> {
let summary = "Signed-integer division of Operand 1 divided by Operand 2.";
let description = [{
// -----
-def SPV_SModOp : SPV_ArithmeticOp<"SMod", SPV_Integer, []> {
+def SPV_SModOp : SPV_ArithmeticBinaryOp<"SMod", SPV_Integer, []> {
let summary = [{
Signed remainder operation for the remainder whose sign matches the sign
of Operand 2.
// -----
-def SPV_SRemOp : SPV_ArithmeticOp<"SRem", SPV_Integer, []> {
+def SPV_SRemOp : SPV_ArithmeticBinaryOp<"SRem", SPV_Integer, []> {
let summary = [{
Signed remainder operation for the remainder whose sign matches the sign
of Operand 1.
// -----
-def SPV_UDivOp : SPV_ArithmeticOp<"UDiv", SPV_Integer, []> {
+def SPV_UDivOp : SPV_ArithmeticBinaryOp<"UDiv", SPV_Integer, []> {
let summary = "Unsigned-integer division of Operand 1 divided by Operand 2.";
let description = [{
// -----
-def SPV_UModOp : SPV_ArithmeticOp<"UMod", SPV_Integer> {
+def SPV_UModOp : SPV_ArithmeticBinaryOp<"UMod", SPV_Integer> {
let summary = "Unsigned modulo operation of Operand 1 modulo Operand 2.";
let description = [{