Reland "[mlir][spirv] Change td def/class prefix from SPV to SPIRV"

This reverts commit ce82530cd0.

Undo accidental Vulkan/SPIR-V name changes.
Tested with `ninja check-mlir check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner`.
This commit is contained in:
Jakub Kuderski 2022-09-26 13:53:58 -04:00
parent bc13437b15
commit 2d62833048
30 changed files with 2803 additions and 2799 deletions

View File

@ -18,35 +18,35 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
include "mlir/Interfaces/InferTypeOpInterface.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
class SPV_ArithmeticBinaryOp<string mnemonic, Type type,
list<Trait> traits = []> :
class SPIRV_ArithmeticBinaryOp<string mnemonic, Type type,
list<Trait> traits = []> :
// Operands type same as result type.
SPV_BinaryOp<mnemonic, type, type,
SPIRV_BinaryOp<mnemonic, type, type,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultType])> {
// In addition to normal types arithmetic instructions can support cooperative
// matrix.
let arguments = (ins
SPV_ScalarOrVectorOrCoopMatrixOf<type>:$operand1,
SPV_ScalarOrVectorOrCoopMatrixOf<type>:$operand2
SPIRV_ScalarOrVectorOrCoopMatrixOf<type>:$operand1,
SPIRV_ScalarOrVectorOrCoopMatrixOf<type>:$operand2
);
let results = (outs
SPV_ScalarOrVectorOrCoopMatrixOf<type>:$result
SPIRV_ScalarOrVectorOrCoopMatrixOf<type>:$result
);
let assemblyFormat = "operands attr-dict `:` type($result)";
}
class SPV_ArithmeticUnaryOp<string mnemonic, Type type,
list<Trait> traits = []> :
class SPIRV_ArithmeticUnaryOp<string mnemonic, Type type,
list<Trait> traits = []> :
// Operand type same as result type.
SPV_UnaryOp<mnemonic, type, type,
SPIRV_UnaryOp<mnemonic, type, type,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultType])>;
// -----
def SPV_FAddOp : SPV_ArithmeticBinaryOp<"FAdd", SPV_Float, [Commutative]> {
def SPIRV_FAddOp : SPIRV_ArithmeticBinaryOp<"FAdd", SPIRV_Float, [Commutative]> {
let summary = "Floating-point addition of Operand 1 and Operand 2.";
let description = [{
@ -75,7 +75,7 @@ def SPV_FAddOp : SPV_ArithmeticBinaryOp<"FAdd", SPV_Float, [Commutative]> {
// -----
def SPV_FDivOp : SPV_ArithmeticBinaryOp<"FDiv", SPV_Float, []> {
def SPIRV_FDivOp : SPIRV_ArithmeticBinaryOp<"FDiv", SPIRV_Float, []> {
let summary = "Floating-point division of Operand 1 divided by Operand 2.";
let description = [{
@ -106,7 +106,7 @@ def SPV_FDivOp : SPV_ArithmeticBinaryOp<"FDiv", SPV_Float, []> {
// -----
def SPV_FModOp : SPV_ArithmeticBinaryOp<"FMod", SPV_Float, []> {
def SPIRV_FModOp : SPIRV_ArithmeticBinaryOp<"FMod", SPIRV_Float, []> {
let summary = [{
The floating-point remainder whose sign matches the sign of Operand 2.
}];
@ -140,7 +140,7 @@ def SPV_FModOp : SPV_ArithmeticBinaryOp<"FMod", SPV_Float, []> {
// -----
def SPV_FMulOp : SPV_ArithmeticBinaryOp<"FMul", SPV_Float, [Commutative]> {
def SPIRV_FMulOp : SPIRV_ArithmeticBinaryOp<"FMul", SPIRV_Float, [Commutative]> {
let summary = "Floating-point multiplication of Operand 1 and Operand 2.";
let description = [{
@ -171,7 +171,7 @@ def SPV_FMulOp : SPV_ArithmeticBinaryOp<"FMul", SPV_Float, [Commutative]> {
// -----
def SPV_FNegateOp : SPV_ArithmeticUnaryOp<"FNegate", SPV_Float, []> {
def SPIRV_FNegateOp : SPIRV_ArithmeticUnaryOp<"FNegate", SPIRV_Float, []> {
let summary = [{
Inverts the sign bit of Operand. (Note, however, that OpFNegate is still
considered a floating-point instruction, and so is subject to the
@ -205,7 +205,7 @@ def SPV_FNegateOp : SPV_ArithmeticUnaryOp<"FNegate", SPV_Float, []> {
// -----
def SPV_FRemOp : SPV_ArithmeticBinaryOp<"FRem", SPV_Float, []> {
def SPIRV_FRemOp : SPIRV_ArithmeticBinaryOp<"FRem", SPIRV_Float, []> {
let summary = [{
The floating-point remainder whose sign matches the sign of Operand 1.
}];
@ -240,7 +240,7 @@ def SPV_FRemOp : SPV_ArithmeticBinaryOp<"FRem", SPV_Float, []> {
// -----
def SPV_FSubOp : SPV_ArithmeticBinaryOp<"FSub", SPV_Float, []> {
def SPIRV_FSubOp : SPIRV_ArithmeticBinaryOp<"FSub", SPIRV_Float, []> {
let summary = "Floating-point subtraction of Operand 2 from Operand 1.";
let description = [{
@ -270,8 +270,8 @@ def SPV_FSubOp : SPV_ArithmeticBinaryOp<"FSub", SPV_Float, []> {
// -----
def SPV_IAddOp : SPV_ArithmeticBinaryOp<"IAdd",
SPV_Integer,
def SPIRV_IAddOp : SPIRV_ArithmeticBinaryOp<"IAdd",
SPIRV_Integer,
[Commutative, UsableInSpecConstantOp]> {
let summary = "Integer addition of Operand 1 and Operand 2.";
@ -310,8 +310,8 @@ def SPV_IAddOp : SPV_ArithmeticBinaryOp<"IAdd",
// -----
def SPV_IAddCarryOp : SPV_BinaryOp<"IAddCarry",
SPV_AnyStruct, SPV_Integer,
def SPIRV_IAddCarryOp : SPIRV_BinaryOp<"IAddCarry",
SPIRV_AnyStruct, SPIRV_Integer,
[Commutative, NoSideEffect]> {
let summary = [{
Integer addition of Operand 1 and Operand 2, including the carry.
@ -346,12 +346,12 @@ def SPV_IAddCarryOp : SPV_BinaryOp<"IAddCarry",
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Integer>:$operand1,
SPV_ScalarOrVectorOf<SPV_Integer>:$operand2
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$operand1,
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$operand2
);
let results = (outs
SPV_AnyStruct:$result
SPIRV_AnyStruct:$result
);
let builders = [
@ -367,8 +367,8 @@ def SPV_IAddCarryOp : SPV_BinaryOp<"IAddCarry",
// -----
def SPV_IMulOp : SPV_ArithmeticBinaryOp<"IMul",
SPV_Integer,
def SPIRV_IMulOp : SPIRV_ArithmeticBinaryOp<"IMul",
SPIRV_Integer,
[Commutative, UsableInSpecConstantOp]> {
let summary = "Integer multiplication of Operand 1 and Operand 2.";
@ -407,8 +407,8 @@ def SPV_IMulOp : SPV_ArithmeticBinaryOp<"IMul",
// -----
def SPV_ISubOp : SPV_ArithmeticBinaryOp<"ISub",
SPV_Integer,
def SPIRV_ISubOp : SPIRV_ArithmeticBinaryOp<"ISub",
SPIRV_Integer,
[UsableInSpecConstantOp]> {
let summary = "Integer subtraction of Operand 2 from Operand 1.";
@ -447,7 +447,7 @@ def SPV_ISubOp : SPV_ArithmeticBinaryOp<"ISub",
// -----
def SPV_ISubBorrowOp : SPV_BinaryOp<"ISubBorrow", SPV_AnyStruct, SPV_Integer,
def SPIRV_ISubBorrowOp : SPIRV_BinaryOp<"ISubBorrow", SPIRV_AnyStruct, SPIRV_Integer,
[NoSideEffect]> {
let summary = [{
Result is the unsigned integer subtraction of Operand 2 from Operand 1,
@ -485,12 +485,12 @@ def SPV_ISubBorrowOp : SPV_BinaryOp<"ISubBorrow", SPV_AnyStruct, SPV_Integer,
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Integer>:$operand1,
SPV_ScalarOrVectorOf<SPV_Integer>:$operand2
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$operand1,
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$operand2
);
let results = (outs
SPV_AnyStruct:$result
SPIRV_AnyStruct:$result
);
let builders = [
@ -506,8 +506,8 @@ def SPV_ISubBorrowOp : SPV_BinaryOp<"ISubBorrow", SPV_AnyStruct, SPV_Integer,
// -----
def SPV_SDivOp : SPV_ArithmeticBinaryOp<"SDiv",
SPV_Integer,
def SPIRV_SDivOp : SPIRV_ArithmeticBinaryOp<"SDiv",
SPIRV_Integer,
[UsableInSpecConstantOp]> {
let summary = "Signed-integer division of Operand 1 divided by Operand 2.";
@ -541,8 +541,8 @@ def SPV_SDivOp : SPV_ArithmeticBinaryOp<"SDiv",
// -----
def SPV_SModOp : SPV_ArithmeticBinaryOp<"SMod",
SPV_Integer,
def SPIRV_SModOp : SPIRV_ArithmeticBinaryOp<"SMod",
SPIRV_Integer,
[UsableInSpecConstantOp]> {
let summary = [{
Signed remainder operation for the remainder whose sign matches the sign
@ -580,8 +580,8 @@ def SPV_SModOp : SPV_ArithmeticBinaryOp<"SMod",
// -----
def SPV_SNegateOp : SPV_ArithmeticUnaryOp<"SNegate",
SPV_Integer,
def SPIRV_SNegateOp : SPIRV_ArithmeticUnaryOp<"SNegate",
SPIRV_Integer,
[UsableInSpecConstantOp]> {
let summary = "Signed-integer subtract of Operand from zero.";
@ -607,8 +607,8 @@ def SPV_SNegateOp : SPV_ArithmeticUnaryOp<"SNegate",
// -----
def SPV_SRemOp : SPV_ArithmeticBinaryOp<"SRem",
SPV_Integer,
def SPIRV_SRemOp : SPIRV_ArithmeticBinaryOp<"SRem",
SPIRV_Integer,
[UsableInSpecConstantOp]> {
let summary = [{
Signed remainder operation for the remainder whose sign matches the sign
@ -646,8 +646,8 @@ def SPV_SRemOp : SPV_ArithmeticBinaryOp<"SRem",
// -----
def SPV_UDivOp : SPV_ArithmeticBinaryOp<"UDiv",
SPV_Integer,
def SPIRV_UDivOp : SPIRV_ArithmeticBinaryOp<"UDiv",
SPIRV_Integer,
[UnsignedOp, UsableInSpecConstantOp]> {
let summary = "Unsigned-integer division of Operand 1 divided by Operand 2.";
@ -680,7 +680,7 @@ def SPV_UDivOp : SPV_ArithmeticBinaryOp<"UDiv",
// -----
def SPV_VectorTimesScalarOp : SPV_Op<"VectorTimesScalar", [NoSideEffect]> {
def SPIRV_VectorTimesScalarOp : SPIRV_Op<"VectorTimesScalar", [NoSideEffect]> {
let summary = "Scale a floating-point vector.";
let description = [{
@ -701,12 +701,12 @@ def SPV_VectorTimesScalarOp : SPV_Op<"VectorTimesScalar", [NoSideEffect]> {
}];
let arguments = (ins
VectorOfLengthAndType<[2, 3, 4], [SPV_Float]>:$vector,
SPV_Float:$scalar
VectorOfLengthAndType<[2, 3, 4], [SPIRV_Float]>:$vector,
SPIRV_Float:$scalar
);
let results = (outs
VectorOfLengthAndType<[2, 3, 4], [SPV_Float]>:$result
VectorOfLengthAndType<[2, 3, 4], [SPIRV_Float]>:$result
);
let assemblyFormat = "operands attr-dict `:` `(` type(operands) `)` `->` type($result)";
@ -714,8 +714,8 @@ def SPV_VectorTimesScalarOp : SPV_Op<"VectorTimesScalar", [NoSideEffect]> {
// -----
def SPV_UModOp : SPV_ArithmeticBinaryOp<"UMod",
SPV_Integer,
def SPIRV_UModOp : SPIRV_ArithmeticBinaryOp<"UMod",
SPIRV_Integer,
[UnsignedOp, UsableInSpecConstantOp]> {
let summary = "Unsigned modulo operation of Operand 1 modulo Operand 2.";

View File

@ -14,30 +14,30 @@
#ifndef MLIR_DIALECT_SPIRV_IR_ATOMIC_OPS
#define MLIR_DIALECT_SPIRV_IR_ATOMIC_OPS
class SPV_AtomicUpdateOp<string mnemonic, list<Trait> traits = []> :
SPV_Op<mnemonic, traits> {
class SPIRV_AtomicUpdateOp<string mnemonic, list<Trait> traits = []> :
SPIRV_Op<mnemonic, traits> {
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$semantics
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$semantics
);
let results = (outs
SPV_Integer:$result
SPIRV_Integer:$result
);
}
class SPV_AtomicUpdateWithValueOp<string mnemonic, list<Trait> traits = []> :
SPV_Op<mnemonic, traits> {
class SPIRV_AtomicUpdateWithValueOp<string mnemonic, list<Trait> traits = []> :
SPIRV_Op<mnemonic, traits> {
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$semantics,
SPV_Integer:$value
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$semantics,
SPIRV_Integer:$value
);
let results = (outs
SPV_Integer:$result
SPIRV_Integer:$result
);
let builders = [
@ -49,7 +49,7 @@ class SPV_AtomicUpdateWithValueOp<string mnemonic, list<Trait> traits = []> :
// -----
def SPV_AtomicAndOp : SPV_AtomicUpdateWithValueOp<"AtomicAnd", []> {
def SPIRV_AtomicAndOp : SPIRV_AtomicUpdateWithValueOp<"AtomicAnd", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -94,7 +94,7 @@ def SPV_AtomicAndOp : SPV_AtomicUpdateWithValueOp<"AtomicAnd", []> {
// -----
def SPV_AtomicCompareExchangeOp : SPV_Op<"AtomicCompareExchange", []> {
def SPIRV_AtomicCompareExchangeOp : SPIRV_Op<"AtomicCompareExchange", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -146,22 +146,22 @@ def SPV_AtomicCompareExchangeOp : SPV_Op<"AtomicCompareExchange", []> {
}];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$equal_semantics,
SPV_MemorySemanticsAttr:$unequal_semantics,
SPV_Integer:$value,
SPV_Integer:$comparator
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$equal_semantics,
SPIRV_MemorySemanticsAttr:$unequal_semantics,
SPIRV_Integer:$value,
SPIRV_Integer:$comparator
);
let results = (outs
SPV_Integer:$result
SPIRV_Integer:$result
);
}
// -----
def SPV_AtomicCompareExchangeWeakOp : SPV_Op<"AtomicCompareExchangeWeak", []> {
def SPIRV_AtomicCompareExchangeWeakOp : SPIRV_Op<"AtomicCompareExchangeWeak", []> {
let summary = "Deprecated (use OpAtomicCompareExchange).";
let description = [{
@ -188,29 +188,29 @@ def SPV_AtomicCompareExchangeWeakOp : SPV_Op<"AtomicCompareExchangeWeak", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_3>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_3>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$equal_semantics,
SPV_MemorySemanticsAttr:$unequal_semantics,
SPV_Integer:$value,
SPV_Integer:$comparator
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$equal_semantics,
SPIRV_MemorySemanticsAttr:$unequal_semantics,
SPIRV_Integer:$value,
SPIRV_Integer:$comparator
);
let results = (outs
SPV_Integer:$result
SPIRV_Integer:$result
);
}
// -----
def SPV_AtomicExchangeOp : SPV_Op<"AtomicExchange", []> {
def SPIRV_AtomicExchangeOp : SPIRV_Op<"AtomicExchange", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -249,20 +249,20 @@ def SPV_AtomicExchangeOp : SPV_Op<"AtomicExchange", []> {
}];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$semantics,
SPV_Numerical:$value
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$semantics,
SPIRV_Numerical:$value
);
let results = (outs
SPV_Numerical:$result
SPIRV_Numerical:$result
);
}
// -----
def SPV_EXTAtomicFAddOp : SPV_ExtVendorOp<"AtomicFAdd", []> {
def SPIRV_EXTAtomicFAddOp : SPIRV_ExtVendorOp<"AtomicFAdd", []> {
let summary = "TBD";
let description = [{
@ -303,27 +303,27 @@ def SPV_EXTAtomicFAddOp : SPV_ExtVendorOp<"AtomicFAdd", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_EXT_shader_atomic_float_add]>,
Capability<[SPV_C_AtomicFloat16AddEXT, SPV_C_AtomicFloat32AddEXT, SPV_C_AtomicFloat64AddEXT]>
Capability<[SPIRV_C_AtomicFloat16AddEXT, SPIRV_C_AtomicFloat32AddEXT, SPIRV_C_AtomicFloat64AddEXT]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$semantics,
SPV_Float:$value
SPIRV_AnyPtr:$pointer,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$semantics,
SPIRV_Float:$value
);
let results = (outs
SPV_Float:$result
SPIRV_Float:$result
);
}
// -----
def SPV_AtomicIAddOp : SPV_AtomicUpdateWithValueOp<"AtomicIAdd", []> {
def SPIRV_AtomicIAddOp : SPIRV_AtomicUpdateWithValueOp<"AtomicIAdd", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -364,7 +364,7 @@ def SPV_AtomicIAddOp : SPV_AtomicUpdateWithValueOp<"AtomicIAdd", []> {
// -----
def SPV_AtomicIDecrementOp : SPV_AtomicUpdateOp<"AtomicIDecrement", []> {
def SPIRV_AtomicIDecrementOp : SPIRV_AtomicUpdateOp<"AtomicIDecrement", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -404,7 +404,7 @@ def SPV_AtomicIDecrementOp : SPV_AtomicUpdateOp<"AtomicIDecrement", []> {
// -----
def SPV_AtomicIIncrementOp : SPV_AtomicUpdateOp<"AtomicIIncrement", []> {
def SPIRV_AtomicIIncrementOp : SPIRV_AtomicUpdateOp<"AtomicIIncrement", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -443,7 +443,7 @@ def SPV_AtomicIIncrementOp : SPV_AtomicUpdateOp<"AtomicIIncrement", []> {
// -----
def SPV_AtomicISubOp : SPV_AtomicUpdateWithValueOp<"AtomicISub", []> {
def SPIRV_AtomicISubOp : SPIRV_AtomicUpdateWithValueOp<"AtomicISub", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -485,7 +485,7 @@ def SPV_AtomicISubOp : SPV_AtomicUpdateWithValueOp<"AtomicISub", []> {
// -----
def SPV_AtomicOrOp : SPV_AtomicUpdateWithValueOp<"AtomicOr", []> {
def SPIRV_AtomicOrOp : SPIRV_AtomicUpdateWithValueOp<"AtomicOr", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -526,7 +526,7 @@ def SPV_AtomicOrOp : SPV_AtomicUpdateWithValueOp<"AtomicOr", []> {
// -----
def SPV_AtomicSMaxOp : SPV_AtomicUpdateWithValueOp<"AtomicSMax", []> {
def SPIRV_AtomicSMaxOp : SPIRV_AtomicUpdateWithValueOp<"AtomicSMax", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -568,7 +568,7 @@ def SPV_AtomicSMaxOp : SPV_AtomicUpdateWithValueOp<"AtomicSMax", []> {
// -----
def SPV_AtomicSMinOp : SPV_AtomicUpdateWithValueOp<"AtomicSMin", []> {
def SPIRV_AtomicSMinOp : SPIRV_AtomicUpdateWithValueOp<"AtomicSMin", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -610,7 +610,7 @@ def SPV_AtomicSMinOp : SPV_AtomicUpdateWithValueOp<"AtomicSMin", []> {
// -----
def SPV_AtomicUMaxOp : SPV_AtomicUpdateWithValueOp<"AtomicUMax", [UnsignedOp]> {
def SPIRV_AtomicUMaxOp : SPIRV_AtomicUpdateWithValueOp<"AtomicUMax", [UnsignedOp]> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -652,7 +652,7 @@ def SPV_AtomicUMaxOp : SPV_AtomicUpdateWithValueOp<"AtomicUMax", [UnsignedOp]> {
// -----
def SPV_AtomicUMinOp : SPV_AtomicUpdateWithValueOp<"AtomicUMin", [UnsignedOp]> {
def SPIRV_AtomicUMinOp : SPIRV_AtomicUpdateWithValueOp<"AtomicUMin", [UnsignedOp]> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
@ -694,7 +694,7 @@ def SPV_AtomicUMinOp : SPV_AtomicUpdateWithValueOp<"AtomicUMin", [UnsignedOp]> {
// -----
def SPV_AtomicXorOp : SPV_AtomicUpdateWithValueOp<"AtomicXor", []> {
def SPIRV_AtomicXorOp : SPIRV_AtomicUpdateWithValueOp<"AtomicXor", []> {
let summary = [{
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:

View File

@ -23,7 +23,7 @@
include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
class SPV_Attr<string attrName, string attrMnemonic>
class SPIRV_Attr<string attrName, string attrMnemonic>
: AttrDef<SPIRV_Dialect, attrName> {
let mnemonic = attrMnemonic;
}
@ -31,22 +31,22 @@ class SPV_Attr<string attrName, string attrMnemonic>
// For entry functions, this attribute specifies information related to entry
// points in the generated SPIR-V module:
// 1) WorkGroup Size.
def SPV_EntryPointABIAttr : SPV_Attr<"EntryPointABI", "entry_point_abi"> {
def SPIRV_EntryPointABIAttr : SPIRV_Attr<"EntryPointABI", "entry_point_abi"> {
let parameters = (ins OptionalParameter<"DenseIntElementsAttr">:$local_size);
let assemblyFormat = "`<` struct(params) `>`";
}
def SPV_ExtensionArrayAttr : TypedArrayAttrBase<
SPV_ExtensionAttr, "SPIR-V extension array attribute">;
def SPIRV_ExtensionArrayAttr : TypedArrayAttrBase<
SPIRV_ExtensionAttr, "SPIR-V extension array attribute">;
def SPV_CapabilityArrayAttr : TypedArrayAttrBase<
SPV_CapabilityAttr, "SPIR-V capability array attribute">;
def SPIRV_CapabilityArrayAttr : TypedArrayAttrBase<
SPIRV_CapabilityAttr, "SPIR-V capability array attribute">;
// Description of cooperative matrix operations supported on the
// target. Represents `VkCooperativeMatrixPropertiesNV`. See
// https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCooperativeMatrixPropertiesNV.html
def SPV_CooperativeMatrixPropertiesNVAttr :
SPV_Attr<"CooperativeMatrixPropertiesNV", "coop_matrix_props"> {
def SPIRV_CooperativeMatrixPropertiesNVAttr :
SPIRV_Attr<"CooperativeMatrixPropertiesNV", "coop_matrix_props"> {
let parameters = (ins
"int":$m_size,
"int":$n_size,
@ -60,14 +60,14 @@ def SPV_CooperativeMatrixPropertiesNVAttr :
let assemblyFormat = "`<` struct(params) `>`";
}
def SPV_CooperativeMatrixPropertiesNVArrayAttr :
TypedArrayAttrBase<SPV_CooperativeMatrixPropertiesNVAttr,
def SPIRV_CooperativeMatrixPropertiesNVArrayAttr :
TypedArrayAttrBase<SPIRV_CooperativeMatrixPropertiesNVAttr,
"CooperativeMatrixPropertiesNV array attribute">;
// Description of the supported joint matrix operations. See
// https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
def SPV_JointMatrixPropertiesINTELAttr :
SPV_Attr<"JointMatrixPropertiesINTEL", "joint_matrix_props"> {
def SPIRV_JointMatrixPropertiesINTELAttr :
SPIRV_Attr<"JointMatrixPropertiesINTEL", "joint_matrix_props"> {
let parameters = (ins
"int":$m_size,
"int":$n_size,
@ -81,8 +81,8 @@ def SPV_JointMatrixPropertiesINTELAttr :
let assemblyFormat = "`<` struct(params) `>`";
}
def SPV_JointMatrixPropertiesINTELArrayAttr :
TypedArrayAttrBase<SPV_JointMatrixPropertiesINTELAttr,
def SPIRV_JointMatrixPropertiesINTELArrayAttr :
TypedArrayAttrBase<SPIRV_JointMatrixPropertiesINTELAttr,
"JointMatrixPropertiesINTEL array attribute">;
// This attribute specifies the limits for various resources on the target
@ -93,7 +93,7 @@ def SPV_JointMatrixPropertiesINTELArrayAttr :
// The following ones are those affecting SPIR-V CodeGen. Their default value
// are the from Vulkan limit requirements:
// https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-minmax
def SPV_ResourceLimitsAttr : SPV_Attr<"ResourceLimits", "resource_limits"> {
def SPIRV_ResourceLimitsAttr : SPIRV_Attr<"ResourceLimits", "resource_limits"> {
let parameters = (ins
// The maximum total storage size, in bytes, available for variables
// declared with the Workgroup storage class.

View File

@ -18,7 +18,7 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
// -----
def SPV_ControlBarrierOp : SPV_Op<"ControlBarrier", []> {
def SPIRV_ControlBarrierOp : SPIRV_Op<"ControlBarrier", []> {
let summary = [{
Wait for other invocations of this module to reach the current point of
execution.
@ -70,9 +70,9 @@ def SPV_ControlBarrierOp : SPV_Op<"ControlBarrier", []> {
}];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$memory_semantics
SPIRV_ScopeAttr:$execution_scope,
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$memory_semantics
);
let results = (outs);
@ -84,7 +84,7 @@ def SPV_ControlBarrierOp : SPV_Op<"ControlBarrier", []> {
// -----
def SPV_MemoryBarrierOp : SPV_Op<"MemoryBarrier", []> {
def SPIRV_MemoryBarrierOp : SPIRV_Op<"MemoryBarrier", []> {
let summary = "Control the order that memory accesses are observed.";
let description = [{
@ -121,8 +121,8 @@ def SPV_MemoryBarrierOp : SPV_Op<"MemoryBarrier", []> {
}];
let arguments = (ins
SPV_ScopeAttr:$memory_scope,
SPV_MemorySemanticsAttr:$memory_semantics
SPIRV_ScopeAttr:$memory_scope,
SPIRV_MemorySemanticsAttr:$memory_semantics
);
let results = (outs);

File diff suppressed because it is too large Load Diff

View File

@ -17,25 +17,25 @@
include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
class SPV_BitBinaryOp<string mnemonic, list<Trait> traits = []> :
// All the operands type used in bit instructions are SPV_Integer.
SPV_BinaryOp<mnemonic, SPV_Integer, SPV_Integer,
class SPIRV_BitBinaryOp<string mnemonic, list<Trait> traits = []> :
// All the operands type used in bit instructions are SPIRV_Integer.
SPIRV_BinaryOp<mnemonic, SPIRV_Integer, SPIRV_Integer,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultType])> {
[NoSideEffect, SameOperandsAndResultType])> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
class SPV_BitFieldExtractOp<string mnemonic, list<Trait> traits = []> :
SPV_Op<mnemonic, !listconcat(traits,
class SPIRV_BitFieldExtractOp<string mnemonic, list<Trait> traits = []> :
SPIRV_Op<mnemonic, !listconcat(traits,
[NoSideEffect, AllTypesMatch<["base", "result"]>])> {
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Integer>:$base,
SPV_Integer:$offset,
SPV_Integer:$count
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$base,
SPIRV_Integer:$offset,
SPIRV_Integer:$count
);
let results = (outs
SPV_ScalarOrVectorOf<SPV_Integer>:$result
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$result
);
let hasVerifier = 0;
@ -45,13 +45,13 @@ class SPV_BitFieldExtractOp<string mnemonic, list<Trait> traits = []> :
}];
}
class SPV_BitUnaryOp<string mnemonic, list<Trait> traits = []> :
SPV_UnaryOp<mnemonic, SPV_Integer, SPV_Integer,
class SPIRV_BitUnaryOp<string mnemonic, list<Trait> traits = []> :
SPIRV_UnaryOp<mnemonic, SPIRV_Integer, SPIRV_Integer,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultType])>;
class SPV_ShiftOp<string mnemonic, list<Trait> traits = []> :
SPV_BinaryOp<mnemonic, SPV_Integer, SPV_Integer,
class SPIRV_ShiftOp<string mnemonic, list<Trait> traits = []> :
SPIRV_BinaryOp<mnemonic, SPIRV_Integer, SPIRV_Integer,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultShape,
AllTypesMatch<["operand1", "result"]>])> {
@ -63,7 +63,7 @@ class SPV_ShiftOp<string mnemonic, list<Trait> traits = []> :
// -----
def SPV_BitCountOp : SPV_BitUnaryOp<"BitCount", []> {
def SPIRV_BitCountOp : SPIRV_BitUnaryOp<"BitCount", []> {
let summary = "Count the number of set bits in an object.";
let description = [{
@ -100,7 +100,7 @@ def SPV_BitCountOp : SPV_BitUnaryOp<"BitCount", []> {
// -----
def SPV_BitFieldInsertOp : SPV_Op<"BitFieldInsert",
def SPIRV_BitFieldInsertOp : SPIRV_Op<"BitFieldInsert",
[NoSideEffect, AllTypesMatch<["base", "insert", "result"]>]> {
let summary = [{
Make a copy of an object, with a modified bit field that comes from
@ -149,21 +149,21 @@ def SPV_BitFieldInsertOp : SPV_Op<"BitFieldInsert",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_BitInstructions, SPV_C_Shader]>
Capability<[SPIRV_C_BitInstructions, SPIRV_C_Shader]>
];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Integer>:$base,
SPV_ScalarOrVectorOf<SPV_Integer>:$insert,
SPV_Integer:$offset,
SPV_Integer:$count
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$base,
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$insert,
SPIRV_Integer:$offset,
SPIRV_Integer:$count
);
let results = (outs
SPV_ScalarOrVectorOf<SPV_Integer>:$result
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$result
);
let hasVerifier = 0;
@ -175,7 +175,7 @@ def SPV_BitFieldInsertOp : SPV_Op<"BitFieldInsert",
// -----
def SPV_BitFieldSExtractOp : SPV_BitFieldExtractOp<"BitFieldSExtract",
def SPIRV_BitFieldSExtractOp : SPIRV_BitFieldExtractOp<"BitFieldSExtract",
[SignedOp]> {
let summary = "Extract a bit field from an object, with sign extension.";
@ -221,16 +221,16 @@ def SPV_BitFieldSExtractOp : SPV_BitFieldExtractOp<"BitFieldSExtract",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_BitInstructions, SPV_C_Shader]>
Capability<[SPIRV_C_BitInstructions, SPIRV_C_Shader]>
];
}
// -----
def SPV_BitFieldUExtractOp : SPV_BitFieldExtractOp<"BitFieldUExtract",
def SPIRV_BitFieldUExtractOp : SPIRV_BitFieldExtractOp<"BitFieldUExtract",
[UnsignedOp]> {
let summary = "Extract a bit field from an object, without sign extension.";
@ -258,16 +258,16 @@ def SPV_BitFieldUExtractOp : SPV_BitFieldExtractOp<"BitFieldUExtract",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_BitInstructions, SPV_C_Shader]>
Capability<[SPIRV_C_BitInstructions, SPIRV_C_Shader]>
];
}
// -----
def SPV_BitReverseOp : SPV_BitUnaryOp<"BitReverse", []> {
def SPIRV_BitReverseOp : SPIRV_BitUnaryOp<"BitReverse", []> {
let summary = "Reverse the bits in an object.";
let description = [{
@ -298,16 +298,16 @@ def SPV_BitReverseOp : SPV_BitUnaryOp<"BitReverse", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_BitInstructions, SPV_C_Shader]>
Capability<[SPIRV_C_BitInstructions, SPIRV_C_Shader]>
];
}
// -----
def SPV_BitwiseAndOp : SPV_BitBinaryOp<"BitwiseAnd",
def SPIRV_BitwiseAndOp : SPIRV_BitBinaryOp<"BitwiseAnd",
[Commutative, UsableInSpecConstantOp]> {
let summary = [{
Result is 1 if both Operand 1 and Operand 2 are 1. Result is 0 if either
@ -342,7 +342,7 @@ def SPV_BitwiseAndOp : SPV_BitBinaryOp<"BitwiseAnd",
// -----
def SPV_BitwiseOrOp : SPV_BitBinaryOp<"BitwiseOr",
def SPIRV_BitwiseOrOp : SPIRV_BitBinaryOp<"BitwiseOr",
[Commutative, UsableInSpecConstantOp]> {
let summary = [{
Result is 1 if either Operand 1 or Operand 2 is 1. Result is 0 if both
@ -377,7 +377,7 @@ def SPV_BitwiseOrOp : SPV_BitBinaryOp<"BitwiseOr",
// -----
def SPV_BitwiseXorOp : SPV_BitBinaryOp<"BitwiseXor",
def SPIRV_BitwiseXorOp : SPIRV_BitBinaryOp<"BitwiseXor",
[Commutative, UsableInSpecConstantOp]> {
let summary = [{
Result is 1 if exactly one of Operand 1 or Operand 2 is 1. Result is 0
@ -412,7 +412,7 @@ def SPV_BitwiseXorOp : SPV_BitBinaryOp<"BitwiseXor",
// -----
def SPV_ShiftLeftLogicalOp : SPV_ShiftOp<"ShiftLeftLogical",
def SPIRV_ShiftLeftLogicalOp : SPIRV_ShiftOp<"ShiftLeftLogical",
[UsableInSpecConstantOp]> {
let summary = [{
Shift the bits in Base left by the number of bits specified in Shift.
@ -457,7 +457,7 @@ def SPV_ShiftLeftLogicalOp : SPV_ShiftOp<"ShiftLeftLogical",
// -----
def SPV_ShiftRightArithmeticOp : SPV_ShiftOp<"ShiftRightArithmetic",
def SPIRV_ShiftRightArithmeticOp : SPIRV_ShiftOp<"ShiftRightArithmetic",
[UsableInSpecConstantOp]> {
let summary = [{
Shift the bits in Base right by the number of bits specified in Shift.
@ -499,7 +499,7 @@ def SPV_ShiftRightArithmeticOp : SPV_ShiftOp<"ShiftRightArithmetic",
// -----
def SPV_ShiftRightLogicalOp : SPV_ShiftOp<"ShiftRightLogical",
def SPIRV_ShiftRightLogicalOp : SPIRV_ShiftOp<"ShiftRightLogical",
[UsableInSpecConstantOp]> {
let summary = [{
Shift the bits in Base right by the number of bits specified in Shift.
@ -542,7 +542,7 @@ def SPV_ShiftRightLogicalOp : SPV_ShiftOp<"ShiftRightLogical",
// -----
def SPV_NotOp : SPV_BitUnaryOp<"Not", [UsableInSpecConstantOp]> {
def SPIRV_NotOp : SPIRV_BitUnaryOp<"Not", [UsableInSpecConstantOp]> {
let summary = "Complement the bits of Operand.";
let description = [{

View File

@ -20,28 +20,28 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
//===----------------------------------------------------------------------===//
// Base class for all OpenCL ops.
class SPV_CLOp<string mnemonic, int opcode, list<Trait> traits = []> :
SPV_ExtInstOp<mnemonic, "CL", "OpenCL.std", opcode, traits> {
class SPIRV_CLOp<string mnemonic, int opcode, list<Trait> traits = []> :
SPIRV_ExtInstOp<mnemonic, "CL", "OpenCL.std", opcode, traits> {
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
}
// Base class for OpenCL unary ops.
class SPV_CLUnaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
class SPIRV_CLUnaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPIRV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<operandType>:$operand
SPIRV_ScalarOrVectorOf<operandType>:$operand
);
let results = (outs
SPV_ScalarOrVectorOf<resultType>:$result
SPIRV_ScalarOrVectorOf<resultType>:$result
);
let assemblyFormat = "$operand `:` type($operand) attr-dict";
@ -51,23 +51,23 @@ class SPV_CLUnaryOp<string mnemonic, int opcode, Type resultType,
// Base class for OpenCL Unary arithmetic ops where return type matches
// the operand type.
class SPV_CLUnaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_CLUnaryOp<mnemonic, opcode, type, type,
class SPIRV_CLUnaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPIRV_CLUnaryOp<mnemonic, opcode, type, type,
traits # [SameOperandsAndResultType]>;
// Base class for OpenCL binary ops.
class SPV_CLBinaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
class SPIRV_CLBinaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPIRV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<operandType>:$lhs,
SPV_ScalarOrVectorOf<operandType>:$rhs
SPIRV_ScalarOrVectorOf<operandType>:$lhs,
SPIRV_ScalarOrVectorOf<operandType>:$rhs
);
let results = (outs
SPV_ScalarOrVectorOf<resultType>:$result
SPIRV_ScalarOrVectorOf<resultType>:$result
);
let hasVerifier = 0;
@ -75,26 +75,26 @@ class SPV_CLBinaryOp<string mnemonic, int opcode, Type resultType,
// Base class for OpenCL Binary arithmetic ops where operand types and
// return type matches.
class SPV_CLBinaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_CLBinaryOp<mnemonic, opcode, type, type,
class SPIRV_CLBinaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPIRV_CLBinaryOp<mnemonic, opcode, type, type,
traits # [SameOperandsAndResultType]> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
// Base class for OpenCL binary ops.
class SPV_CLTernaryOp<string mnemonic, int opcode, Type resultType,
class SPIRV_CLTernaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
SPIRV_CLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<operandType>:$x,
SPV_ScalarOrVectorOf<operandType>:$y,
SPV_ScalarOrVectorOf<operandType>:$z
SPIRV_ScalarOrVectorOf<operandType>:$x,
SPIRV_ScalarOrVectorOf<operandType>:$y,
SPIRV_ScalarOrVectorOf<operandType>:$z
);
let results = (outs
SPV_ScalarOrVectorOf<resultType>:$result
SPIRV_ScalarOrVectorOf<resultType>:$result
);
let hasVerifier = 0;
@ -102,9 +102,9 @@ class SPV_CLTernaryOp<string mnemonic, int opcode, Type resultType,
// Base class for OpenCL Ternary arithmetic ops where operand types and
// return type matches.
class SPV_CLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_CLTernaryOp<mnemonic, opcode, type, type,
class SPIRV_CLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPIRV_CLTernaryOp<mnemonic, opcode, type, type,
traits # [SameOperandsAndResultType]> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
@ -113,7 +113,7 @@ class SPV_CLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
// -----
def SPV_CLCeilOp : SPV_CLUnaryArithmeticOp<"ceil", 12, SPV_Float> {
def SPIRV_CLCeilOp : SPIRV_CLUnaryArithmeticOp<"ceil", 12, SPIRV_Float> {
let summary = [{
Round x to integral value using the round to positive infinity rounding
mode.
@ -146,7 +146,7 @@ def SPV_CLCeilOp : SPV_CLUnaryArithmeticOp<"ceil", 12, SPV_Float> {
// -----
def SPV_CLCosOp : SPV_CLUnaryArithmeticOp<"cos", 14, SPV_Float> {
def SPIRV_CLCosOp : SPIRV_CLUnaryArithmeticOp<"cos", 14, SPIRV_Float> {
let summary = "Compute the cosine of x radians.";
let description = [{
@ -176,7 +176,7 @@ def SPV_CLCosOp : SPV_CLUnaryArithmeticOp<"cos", 14, SPV_Float> {
// -----
def SPV_CLErfOp : SPV_CLUnaryArithmeticOp<"erf", 18, SPV_Float> {
def SPIRV_CLErfOp : SPIRV_CLUnaryArithmeticOp<"erf", 18, SPIRV_Float> {
let summary = [{
Error function of x encountered in integrating the normal distribution.
}];
@ -208,7 +208,7 @@ def SPV_CLErfOp : SPV_CLUnaryArithmeticOp<"erf", 18, SPV_Float> {
// -----
def SPV_CLExpOp : SPV_CLUnaryArithmeticOp<"exp", 19, SPV_Float> {
def SPIRV_CLExpOp : SPIRV_CLUnaryArithmeticOp<"exp", 19, SPIRV_Float> {
let summary = "Exponentiation of Operand 1";
let description = [{
@ -238,7 +238,7 @@ def SPV_CLExpOp : SPV_CLUnaryArithmeticOp<"exp", 19, SPV_Float> {
// -----
def SPV_CLFAbsOp : SPV_CLUnaryArithmeticOp<"fabs", 23, SPV_Float> {
def SPIRV_CLFAbsOp : SPIRV_CLUnaryArithmeticOp<"fabs", 23, SPIRV_Float> {
let summary = "Absolute value of operand";
let description = [{
@ -268,7 +268,7 @@ def SPV_CLFAbsOp : SPV_CLUnaryArithmeticOp<"fabs", 23, SPV_Float> {
// -----
def SPV_CLFloorOp : SPV_CLUnaryArithmeticOp<"floor", 25, SPV_Float> {
def SPIRV_CLFloorOp : SPIRV_CLUnaryArithmeticOp<"floor", 25, SPIRV_Float> {
let summary = [{
Round x to the integral value using the round to negative infinity
rounding mode.
@ -301,7 +301,7 @@ def SPV_CLFloorOp : SPV_CLUnaryArithmeticOp<"floor", 25, SPV_Float> {
// -----
def SPV_CLFmaOp : SPV_CLTernaryArithmeticOp<"fma", 26, SPV_Float> {
def SPIRV_CLFmaOp : SPIRV_CLTernaryArithmeticOp<"fma", 26, SPIRV_Float> {
let summary = [{
Compute the correctly rounded floating-point representation of the sum
of c with the infinitely precise product of a and b. Rounding of
@ -332,17 +332,17 @@ def SPV_CLFmaOp : SPV_CLTernaryArithmeticOp<"fma", 26, SPV_Float> {
// -----
def SPV_CLFMaxOp : SPV_CLBinaryArithmeticOp<"fmax", 27, SPV_Float> {
def SPIRV_CLFMaxOp : SPIRV_CLBinaryArithmeticOp<"fmax", 27, SPIRV_Float> {
let summary = "Return maximum of two floating-point operands";
let description = [{
Returns y if x < y, otherwise it returns x. If one argument is a NaN,
Fmax returns the other argument. If both arguments are NaNs, Fmax returns a NaN.
Result Type, x and y must be floating-point or vector(2,3,4,8,16)
Result Type, x and y must be floating-point or vector(2,3,4,8,16)
of floating-point values.
All of the operands, including the Result Type operand,
All of the operands, including the Result Type operand,
must be of the same type.
<!-- End of AutoGen section -->
@ -363,11 +363,11 @@ def SPV_CLFMaxOp : SPV_CLBinaryArithmeticOp<"fmax", 27, SPV_Float> {
// -----
def SPV_CLFMinOp : SPV_CLBinaryArithmeticOp<"fmin", 28, SPV_Float> {
def SPIRV_CLFMinOp : SPIRV_CLBinaryArithmeticOp<"fmin", 28, SPIRV_Float> {
let summary = "Return minimum of two floating-point operands";
let description = [{
Returns y if y < x, otherwise it returns x. If one argument is a NaN, Fmin returns the other argument.
Returns y if y < x, otherwise it returns x. If one argument is a NaN, Fmin returns the other argument.
If both arguments are NaNs, Fmin returns a NaN.
Result Type,x and y must be floating-point or vector(2,3,4,8,16) of floating-point values.
@ -393,7 +393,7 @@ def SPV_CLFMinOp : SPV_CLBinaryArithmeticOp<"fmin", 28, SPV_Float> {
// -----
def SPV_CLLogOp : SPV_CLUnaryArithmeticOp<"log", 37, SPV_Float> {
def SPIRV_CLLogOp : SPIRV_CLUnaryArithmeticOp<"log", 37, SPIRV_Float> {
let summary = "Compute the natural logarithm of x.";
let description = [{
@ -423,7 +423,7 @@ def SPV_CLLogOp : SPV_CLUnaryArithmeticOp<"log", 37, SPV_Float> {
// -----
def SPV_CLPowOp : SPV_CLBinaryArithmeticOp<"pow", 48, SPV_Float> {
def SPIRV_CLPowOp : SPIRV_CLBinaryArithmeticOp<"pow", 48, SPIRV_Float> {
let summary = "Compute x to the power y.";
let description = [{
@ -454,7 +454,7 @@ def SPV_CLPowOp : SPV_CLBinaryArithmeticOp<"pow", 48, SPV_Float> {
// -----
def SPV_CLRoundOp : SPV_CLUnaryArithmeticOp<"round", 55, SPV_Float> {
def SPIRV_CLRoundOp : SPIRV_CLUnaryArithmeticOp<"round", 55, SPIRV_Float> {
let summary = [{
Return the integral value nearest to x rounding halfway cases away from
zero, regardless of the current rounding direction.
@ -486,7 +486,7 @@ def SPV_CLRoundOp : SPV_CLUnaryArithmeticOp<"round", 55, SPV_Float> {
// -----
def SPV_CLRsqrtOp : SPV_CLUnaryArithmeticOp<"rsqrt", 56, SPV_Float> {
def SPIRV_CLRsqrtOp : SPIRV_CLUnaryArithmeticOp<"rsqrt", 56, SPIRV_Float> {
let summary = "Compute inverse square root of x.";
let description = [{
@ -516,7 +516,7 @@ def SPV_CLRsqrtOp : SPV_CLUnaryArithmeticOp<"rsqrt", 56, SPV_Float> {
// -----
def SPV_CLSinOp : SPV_CLUnaryArithmeticOp<"sin", 57, SPV_Float> {
def SPIRV_CLSinOp : SPIRV_CLUnaryArithmeticOp<"sin", 57, SPIRV_Float> {
let summary = "Compute sine of x radians.";
let description = [{
@ -546,7 +546,7 @@ def SPV_CLSinOp : SPV_CLUnaryArithmeticOp<"sin", 57, SPV_Float> {
// -----
def SPV_CLSqrtOp : SPV_CLUnaryArithmeticOp<"sqrt", 61, SPV_Float> {
def SPIRV_CLSqrtOp : SPIRV_CLUnaryArithmeticOp<"sqrt", 61, SPIRV_Float> {
let summary = "Compute square root of x.";
let description = [{
@ -576,7 +576,7 @@ def SPV_CLSqrtOp : SPV_CLUnaryArithmeticOp<"sqrt", 61, SPV_Float> {
// -----
def SPV_CLTanhOp : SPV_CLUnaryArithmeticOp<"tanh", 63, SPV_Float> {
def SPIRV_CLTanhOp : SPIRV_CLUnaryArithmeticOp<"tanh", 63, SPIRV_Float> {
let summary = "Compute hyperbolic tangent of x radians.";
let description = [{
@ -606,7 +606,7 @@ def SPV_CLTanhOp : SPV_CLUnaryArithmeticOp<"tanh", 63, SPV_Float> {
// -----
def SPV_CLSAbsOp : SPV_CLUnaryArithmeticOp<"s_abs", 141, SPV_Integer> {
def SPIRV_CLSAbsOp : SPIRV_CLUnaryArithmeticOp<"s_abs", 141, SPIRV_Integer> {
let summary = "Absolute value of operand";
let description = [{
@ -636,7 +636,7 @@ def SPV_CLSAbsOp : SPV_CLUnaryArithmeticOp<"s_abs", 141, SPV_Integer> {
// -----
def SPV_CLSMaxOp : SPV_CLBinaryArithmeticOp<"s_max", 156, SPV_Integer> {
def SPIRV_CLSMaxOp : SPIRV_CLBinaryArithmeticOp<"s_max", 156, SPIRV_Integer> {
let summary = "Return maximum of two signed integer operands";
let description = [{
@ -663,7 +663,7 @@ def SPV_CLSMaxOp : SPV_CLBinaryArithmeticOp<"s_max", 156, SPV_Integer> {
// -----
def SPV_CLUMaxOp : SPV_CLBinaryArithmeticOp<"u_max", 157, SPV_Integer> {
def SPIRV_CLUMaxOp : SPIRV_CLBinaryArithmeticOp<"u_max", 157, SPIRV_Integer> {
let summary = "Return maximum of two unsigned integer operands";
let description = [{
@ -688,7 +688,7 @@ def SPV_CLUMaxOp : SPV_CLBinaryArithmeticOp<"u_max", 157, SPV_Integer> {
}];
}
def SPV_CLSMinOp : SPV_CLBinaryArithmeticOp<"s_min", 158, SPV_Integer> {
def SPIRV_CLSMinOp : SPIRV_CLBinaryArithmeticOp<"s_min", 158, SPIRV_Integer> {
let summary = "Return minimum of two signed integer operands";
let description = [{
@ -715,7 +715,7 @@ def SPV_CLSMinOp : SPV_CLBinaryArithmeticOp<"s_min", 158, SPV_Integer> {
// -----
def SPV_CLUMinOp : SPV_CLBinaryArithmeticOp<"u_min", 159, SPV_Integer> {
def SPIRV_CLUMinOp : SPIRV_CLBinaryArithmeticOp<"u_min", 159, SPIRV_Integer> {
let summary = "Return minimum of two unsigned integer operands";
let description = [{

View File

@ -17,17 +17,17 @@
include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
class SPV_CastOp<string mnemonic, Type resultType, Type operandType,
list<Trait> traits = []> :
SPV_Op<mnemonic,
class SPIRV_CastOp<string mnemonic, Type resultType, Type operandType,
list<Trait> traits = []> :
SPIRV_Op<mnemonic,
!listconcat(traits,
[NoSideEffect, SameOperandsAndResultShape])> {
let arguments = (ins
SPV_ScalarOrVectorOrCoopMatrixOf<operandType>:$operand
SPIRV_ScalarOrVectorOrCoopMatrixOf<operandType>:$operand
);
let results = (outs
SPV_ScalarOrVectorOrCoopMatrixOf<resultType>:$result
SPIRV_ScalarOrVectorOrCoopMatrixOf<resultType>:$result
);
let assemblyFormat = [{
$operand attr-dict `:` type($operand) `to` type($result)
@ -36,7 +36,7 @@ class SPV_CastOp<string mnemonic, Type resultType, Type operandType,
// -----
def SPV_BitcastOp : SPV_Op<"Bitcast", [NoSideEffect]> {
def SPIRV_BitcastOp : SPIRV_Op<"Bitcast", [NoSideEffect]> {
let summary = "Bit pattern-preserving type conversion.";
let description = [{
@ -78,11 +78,11 @@ def SPV_BitcastOp : SPV_Op<"Bitcast", [NoSideEffect]> {
}];
let arguments = (ins
SPV_ScalarOrVectorOrPtr:$operand
SPIRV_ScalarOrVectorOrPtr:$operand
);
let results = (outs
SPV_ScalarOrVectorOrPtr:$result
SPIRV_ScalarOrVectorOrPtr:$result
);
let assemblyFormat = [{
@ -93,7 +93,7 @@ def SPV_BitcastOp : SPV_Op<"Bitcast", [NoSideEffect]> {
// -----
def SPV_ConvertFToSOp : SPV_CastOp<"ConvertFToS", SPV_Integer, SPV_Float, []> {
def SPIRV_ConvertFToSOp : SPIRV_CastOp<"ConvertFToS", SPIRV_Integer, SPIRV_Float, []> {
let summary = [{
Convert value numerically from floating point to signed integer, with
round toward 0.0.
@ -125,7 +125,7 @@ def SPV_ConvertFToSOp : SPV_CastOp<"ConvertFToS", SPV_Integer, SPV_Float, []> {
// -----
def SPV_ConvertFToUOp : SPV_CastOp<"ConvertFToU", SPV_Integer, SPV_Float, []> {
def SPIRV_ConvertFToUOp : SPIRV_CastOp<"ConvertFToU", SPIRV_Integer, SPIRV_Float, []> {
let summary = [{
Convert value numerically from floating point to unsigned integer, with
round toward 0.0.
@ -158,9 +158,9 @@ def SPV_ConvertFToUOp : SPV_CastOp<"ConvertFToU", SPV_Integer, SPV_Float, []> {
// -----
def SPV_ConvertSToFOp : SPV_CastOp<"ConvertSToF",
SPV_Float,
SPV_Integer,
def SPIRV_ConvertSToFOp : SPIRV_CastOp<"ConvertSToF",
SPIRV_Float,
SPIRV_Integer,
[SignedOp]> {
let summary = [{
Convert value numerically from signed integer to floating point.
@ -192,9 +192,9 @@ def SPV_ConvertSToFOp : SPV_CastOp<"ConvertSToF",
// -----
def SPV_ConvertUToFOp : SPV_CastOp<"ConvertUToF",
SPV_Float,
SPV_Integer,
def SPIRV_ConvertUToFOp : SPIRV_CastOp<"ConvertUToF",
SPIRV_Float,
SPIRV_Integer,
[UnsignedOp]> {
let summary = [{
Convert value numerically from unsigned integer to floating point.
@ -226,9 +226,9 @@ def SPV_ConvertUToFOp : SPV_CastOp<"ConvertUToF",
// -----
def SPV_FConvertOp : SPV_CastOp<"FConvert",
SPV_Float,
SPV_Float,
def SPIRV_FConvertOp : SPIRV_CastOp<"FConvert",
SPIRV_Float,
SPIRV_Float,
[UsableInSpecConstantOp]> {
let summary = [{
Convert value numerically from one floating-point width to another
@ -262,9 +262,9 @@ def SPV_FConvertOp : SPV_CastOp<"FConvert",
// -----
def SPV_SConvertOp : SPV_CastOp<"SConvert",
SPV_Integer,
SPV_Integer,
def SPIRV_SConvertOp : SPIRV_CastOp<"SConvert",
SPIRV_Integer,
SPIRV_Integer,
[UsableInSpecConstantOp, SignedOp]> {
let summary = [{
Convert signed width. This is either a truncate or a sign extend.
@ -297,9 +297,9 @@ def SPV_SConvertOp : SPV_CastOp<"SConvert",
// -----
def SPV_UConvertOp : SPV_CastOp<"UConvert",
SPV_Integer,
SPV_Integer,
def SPIRV_UConvertOp : SPIRV_CastOp<"UConvert",
SPIRV_Integer,
SPIRV_Integer,
[UnsignedOp, UsableInSpecConstantOp]> {
let summary = [{
Convert unsigned width. This is either a truncate or a zero extend.
@ -332,7 +332,7 @@ def SPV_UConvertOp : SPV_CastOp<"UConvert",
}
// -----
def SPV_PtrCastToGenericOp : SPV_Op<"PtrCastToGeneric", [NoSideEffect]> {
def SPIRV_PtrCastToGenericOp : SPIRV_Op<"PtrCastToGeneric", [NoSideEffect]> {
let summary = "Convert a pointers Storage Class to Generic.";
let description = [{
@ -348,24 +348,24 @@ def SPV_PtrCastToGenericOp : SPV_Op<"PtrCastToGeneric", [NoSideEffect]> {
#### Example:
```mlir
%1 = spirv.PtrCastToGenericOp %0 : !spirv.ptr<f32, CrossWorkGroup> to
%1 = spirv.PtrCastToGenericOp %0 : !spirv.ptr<f32, CrossWorkGroup> to
!spirv.ptr<f32, Generic>
```
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
let arguments = (ins
SPV_AnyPtr:$pointer
SPIRV_AnyPtr:$pointer
);
let results = (outs
SPV_AnyPtr:$result
SPIRV_AnyPtr:$result
);
let assemblyFormat = [{
@ -375,7 +375,7 @@ def SPV_PtrCastToGenericOp : SPV_Op<"PtrCastToGeneric", [NoSideEffect]> {
// -----
def SPV_GenericCastToPtrOp : SPV_Op<"GenericCastToPtr", [NoSideEffect]> {
def SPIRV_GenericCastToPtrOp : SPIRV_Op<"GenericCastToPtr", [NoSideEffect]> {
let summary = "Convert a pointers Storage Class to a non-Generic class.";
let description = [{
@ -397,18 +397,18 @@ def SPV_GenericCastToPtrOp : SPV_Op<"GenericCastToPtr", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
let arguments = (ins
SPV_AnyPtr:$pointer
SPIRV_AnyPtr:$pointer
);
let results = (outs
SPV_AnyPtr:$result
SPIRV_AnyPtr:$result
);
let assemblyFormat = [{
@ -418,7 +418,7 @@ def SPV_GenericCastToPtrOp : SPV_Op<"GenericCastToPtr", [NoSideEffect]> {
// -----
def SPV_GenericCastToPtrExplicitOp : SPV_Op<"GenericCastToPtrExplicit", [NoSideEffect]> {
def SPIRV_GenericCastToPtrExplicitOp : SPIRV_Op<"GenericCastToPtrExplicit", [NoSideEffect]> {
let summary = [{
Attempts to explicitly convert Pointer to Storage storage-class pointer
value.
@ -450,18 +450,18 @@ def SPV_GenericCastToPtrExplicitOp : SPV_Op<"GenericCastToPtrExplicit", [NoSideE
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
let arguments = (ins
SPV_AnyPtr:$pointer
SPIRV_AnyPtr:$pointer
);
let results = (outs
SPV_AnyPtr:$result
SPIRV_AnyPtr:$result
);
let assemblyFormat = [{

View File

@ -19,7 +19,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
// -----
def SPV_CompositeConstructOp : SPV_Op<"CompositeConstruct", [NoSideEffect]> {
def SPIRV_CompositeConstructOp : SPIRV_Op<"CompositeConstruct", [NoSideEffect]> {
let summary = [{
Construct a new composite object from a set of constituent objects.
}];
@ -58,11 +58,11 @@ def SPV_CompositeConstructOp : SPV_Op<"CompositeConstruct", [NoSideEffect]> {
}];
let arguments = (ins
Variadic<SPV_Type>:$constituents
Variadic<SPIRV_Type>:$constituents
);
let results = (outs
SPV_Composite:$result
SPIRV_Composite:$result
);
let assemblyFormat = [{
@ -72,8 +72,8 @@ def SPV_CompositeConstructOp : SPV_Op<"CompositeConstruct", [NoSideEffect]> {
// -----
def SPV_CompositeExtractOp : SPV_Op<"CompositeExtract",
[NoSideEffect, UsableInSpecConstantOp]> {
def SPIRV_CompositeExtractOp : SPIRV_Op<"CompositeExtract",
[NoSideEffect, UsableInSpecConstantOp]> {
let summary = "Extract a part of a composite object.";
let description = [{
@ -106,12 +106,12 @@ def SPV_CompositeExtractOp : SPV_Op<"CompositeExtract",
}];
let arguments = (ins
SPV_Composite:$composite,
SPIRV_Composite:$composite,
I32ArrayAttr:$indices
);
let results = (outs
SPV_Type:$component
SPIRV_Type:$component
);
let builders = [
@ -123,8 +123,8 @@ def SPV_CompositeExtractOp : SPV_Op<"CompositeExtract",
// -----
def SPV_CompositeInsertOp : SPV_Op<"CompositeInsert",
[NoSideEffect, UsableInSpecConstantOp]> {
def SPIRV_CompositeInsertOp : SPIRV_Op<"CompositeInsert",
[NoSideEffect, UsableInSpecConstantOp]> {
let summary = [{
Make a copy of a composite object, while modifying one part of it.
}];
@ -158,13 +158,13 @@ def SPV_CompositeInsertOp : SPV_Op<"CompositeInsert",
}];
let arguments = (ins
SPV_Type:$object,
SPV_Composite:$composite,
SPIRV_Type:$object,
SPIRV_Composite:$composite,
I32ArrayAttr:$indices
);
let results = (outs
SPV_Composite:$result
SPIRV_Composite:$result
);
let builders = [
@ -175,7 +175,7 @@ def SPV_CompositeInsertOp : SPV_Op<"CompositeInsert",
// -----
def SPV_VectorExtractDynamicOp : SPV_Op<"VectorExtractDynamic", [
def SPIRV_VectorExtractDynamicOp : SPIRV_Op<"VectorExtractDynamic", [
NoSideEffect,
TypesMatchWith<"type of 'result' matches element type of 'vector'",
"vector", "result",
@ -206,12 +206,12 @@ def SPV_VectorExtractDynamicOp : SPV_Op<"VectorExtractDynamic", [
}];
let arguments = (ins
SPV_Vector:$vector,
SPV_Integer:$index
SPIRV_Vector:$vector,
SPIRV_Integer:$index
);
let results = (outs
SPV_Scalar:$result
SPIRV_Scalar:$result
);
let hasVerifier = 0;
@ -223,7 +223,7 @@ def SPV_VectorExtractDynamicOp : SPV_Op<"VectorExtractDynamic", [
// -----
def SPV_VectorInsertDynamicOp : SPV_Op<"VectorInsertDynamic", [
def SPIRV_VectorInsertDynamicOp : SPIRV_Op<"VectorInsertDynamic", [
NoSideEffect,
TypesMatchWith<
"type of 'component' matches element type of 'vector'",
@ -269,13 +269,13 @@ def SPV_VectorInsertDynamicOp : SPV_Op<"VectorInsertDynamic", [
}];
let arguments = (ins
SPV_Vector:$vector,
SPV_Scalar:$component,
SPV_Integer:$index
SPIRV_Vector:$vector,
SPIRV_Scalar:$component,
SPIRV_Integer:$index
);
let results = (outs
SPV_Vector:$result
SPIRV_Vector:$result
);
let hasVerifier = 0;
@ -287,7 +287,7 @@ def SPV_VectorInsertDynamicOp : SPV_Op<"VectorInsertDynamic", [
// -----
def SPV_VectorShuffleOp : SPV_Op<"VectorShuffle", [
def SPIRV_VectorShuffleOp : SPIRV_Op<"VectorShuffle", [
NoSideEffect, AllElementTypesMatch<["vector1", "vector2", "result"]>]> {
let summary = [{
Select arbitrary components from two vectors to make a new vector.
@ -330,13 +330,13 @@ def SPV_VectorShuffleOp : SPV_Op<"VectorShuffle", [
}];
let arguments = (ins
SPV_Vector:$vector1,
SPV_Vector:$vector2,
SPIRV_Vector:$vector1,
SPIRV_Vector:$vector2,
I32ArrayAttr:$components
);
let results = (outs
SPV_Vector:$result
SPIRV_Vector:$result
);
let assemblyFormat = [{

View File

@ -21,7 +21,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
// -----
def SPV_BranchOp : SPV_Op<"Branch", [
def SPIRV_BranchOp : SPIRV_Op<"Branch", [
DeclareOpInterfaceMethods<BranchOpInterface>, InFunctionScope, NoSideEffect,
Terminator]> {
let summary = "Unconditional branch to target block.";
@ -45,7 +45,7 @@ def SPV_BranchOp : SPV_Op<"Branch", [
```
}];
let arguments = (ins Variadic<SPV_Type>:$targetOperands);
let arguments = (ins Variadic<SPIRV_Type>:$targetOperands);
let results = (outs);
@ -77,7 +77,7 @@ def SPV_BranchOp : SPV_Op<"Branch", [
// -----
def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [
def SPIRV_BranchConditionalOp : SPIRV_Op<"BranchConditional", [
AttrSizedOperandSegments, DeclareOpInterfaceMethods<BranchOpInterface>,
InFunctionScope, NoSideEffect, Terminator]> {
let summary = [{
@ -119,9 +119,9 @@ def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [
}];
let arguments = (ins
SPV_Bool:$condition,
Variadic<SPV_Type>:$trueTargetOperands,
Variadic<SPV_Type>:$falseTargetOperands,
SPIRV_Bool:$condition,
Variadic<SPIRV_Type>:$trueTargetOperands,
Variadic<SPIRV_Type>:$falseTargetOperands,
OptionalAttr<I32ArrayAttr>:$branch_weights
);
@ -194,7 +194,7 @@ def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [
// -----
def SPV_FunctionCallOp : SPV_Op<"FunctionCall", [
def SPIRV_FunctionCallOp : SPIRV_Op<"FunctionCall", [
InFunctionScope, DeclareOpInterfaceMethods<CallOpInterface>]> {
let summary = "Call a function.";
@ -229,11 +229,11 @@ def SPV_FunctionCallOp : SPV_Op<"FunctionCall", [
let arguments = (ins
FlatSymbolRefAttr:$callee,
Variadic<SPV_Type>:$arguments
Variadic<SPIRV_Type>:$arguments
);
let results = (outs
Optional<SPV_Type>:$return_value
Optional<SPIRV_Type>:$return_value
);
let autogenSerialization = 0;
@ -246,7 +246,7 @@ def SPV_FunctionCallOp : SPV_Op<"FunctionCall", [
// -----
def SPV_LoopOp : SPV_Op<"mlir.loop", [InFunctionScope]> {
def SPIRV_LoopOp : SPIRV_Op<"mlir.loop", [InFunctionScope]> {
let summary = "Define a structured loop.";
let description = [{
@ -276,7 +276,7 @@ def SPV_LoopOp : SPV_Op<"mlir.loop", [InFunctionScope]> {
}];
let arguments = (ins
SPV_LoopControlAttr:$loop_control
SPIRV_LoopControlAttr:$loop_control
);
let results = (outs);
@ -313,7 +313,7 @@ def SPV_LoopOp : SPV_Op<"mlir.loop", [InFunctionScope]> {
// -----
def SPV_MergeOp : SPV_Op<"mlir.merge", [NoSideEffect, Terminator]> {
def SPIRV_MergeOp : SPIRV_Op<"mlir.merge", [NoSideEffect, Terminator]> {
let summary = "A special terminator for merging a structured selection/loop.";
let description = [{
@ -337,7 +337,7 @@ def SPV_MergeOp : SPV_Op<"mlir.merge", [NoSideEffect, Terminator]> {
// -----
def SPV_ReturnOp : SPV_Op<"Return", [InFunctionScope, NoSideEffect,
def SPIRV_ReturnOp : SPIRV_Op<"Return", [InFunctionScope, NoSideEffect,
Terminator]> {
let summary = "Return with no value from a function with void return type.";
@ -360,7 +360,7 @@ def SPV_ReturnOp : SPV_Op<"Return", [InFunctionScope, NoSideEffect,
// -----
def SPV_UnreachableOp : SPV_Op<"Unreachable", [InFunctionScope, Terminator]> {
def SPIRV_UnreachableOp : SPIRV_Op<"Unreachable", [InFunctionScope, Terminator]> {
let summary = "Behavior is undefined if this instruction is executed.";
let description = [{
@ -382,7 +382,7 @@ def SPV_UnreachableOp : SPV_Op<"Unreachable", [InFunctionScope, Terminator]> {
// -----
def SPV_ReturnValueOp : SPV_Op<"ReturnValue", [InFunctionScope, NoSideEffect,
def SPIRV_ReturnValueOp : SPIRV_Op<"ReturnValue", [InFunctionScope, NoSideEffect,
Terminator]> {
let summary = "Return a value from a function.";
@ -407,7 +407,7 @@ def SPV_ReturnValueOp : SPV_Op<"ReturnValue", [InFunctionScope, NoSideEffect,
}];
let arguments = (ins
SPV_Type:$value
SPIRV_Type:$value
);
let results = (outs);
@ -415,7 +415,7 @@ def SPV_ReturnValueOp : SPV_Op<"ReturnValue", [InFunctionScope, NoSideEffect,
let assemblyFormat = "$value attr-dict `:` type($value)";
}
def SPV_SelectionOp : SPV_Op<"mlir.selection", [InFunctionScope]> {
def SPIRV_SelectionOp : SPIRV_Op<"mlir.selection", [InFunctionScope]> {
let summary = "Define a structured selection.";
let description = [{
@ -439,7 +439,7 @@ def SPV_SelectionOp : SPV_Op<"mlir.selection", [InFunctionScope]> {
}];
let arguments = (ins
SPV_SelectionControlAttr:$selection_control
SPIRV_SelectionControlAttr:$selection_control
);
let results = (outs);

View File

@ -15,7 +15,7 @@
// -----
def SPV_NVCooperativeMatrixLengthOp : SPV_NvVendorOp<"CooperativeMatrixLength",
def SPIRV_NVCooperativeMatrixLengthOp : SPIRV_NvVendorOp<"CooperativeMatrixLength",
[NoSideEffect]> {
let summary = "See extension SPV_NV_cooperative_matrix";
@ -42,10 +42,10 @@ def SPV_NVCooperativeMatrixLengthOp : SPV_NvVendorOp<"CooperativeMatrixLength",
let assemblyFormat = "attr-dict `:` $cooperative_matrix_type";
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_NV_cooperative_matrix]>,
Capability<[SPV_C_CooperativeMatrixNV]>
Capability<[SPIRV_C_CooperativeMatrixNV]>
];
let arguments = (ins
@ -53,14 +53,14 @@ def SPV_NVCooperativeMatrixLengthOp : SPV_NvVendorOp<"CooperativeMatrixLength",
);
let results = (outs
SPV_Int32:$result
SPIRV_Int32:$result
);
let hasVerifier = 0;
}
// -----
def SPV_NVCooperativeMatrixLoadOp : SPV_NvVendorOp<"CooperativeMatrixLoad", []> {
def SPIRV_NVCooperativeMatrixLoadOp : SPIRV_NvVendorOp<"CooperativeMatrixLoad", []> {
let summary = "See extension SPV_NV_cooperative_matrix";
let description = [{
@ -116,27 +116,27 @@ def SPV_NVCooperativeMatrixLoadOp : SPV_NvVendorOp<"CooperativeMatrixLoad", []>
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_NV_cooperative_matrix]>,
Capability<[SPV_C_CooperativeMatrixNV]>
Capability<[SPIRV_C_CooperativeMatrixNV]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_Integer:$stride,
SPV_Bool:$columnmajor,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access
SPIRV_AnyPtr:$pointer,
SPIRV_Integer:$stride,
SPIRV_Bool:$columnmajor,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access
);
let results = (outs
SPV_AnyCooperativeMatrix:$result
SPIRV_AnyCooperativeMatrix:$result
);
}
// -----
def SPV_NVCooperativeMatrixMulAddOp : SPV_NvVendorOp<"CooperativeMatrixMulAdd",
def SPIRV_NVCooperativeMatrixMulAddOp : SPIRV_NvVendorOp<"CooperativeMatrixMulAdd",
[NoSideEffect, AllTypesMatch<["c", "result"]>]> {
let summary = "See extension SPV_NV_cooperative_matrix";
@ -191,26 +191,26 @@ def SPV_NVCooperativeMatrixMulAddOp : SPV_NvVendorOp<"CooperativeMatrixMulAdd",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_NV_cooperative_matrix]>,
Capability<[SPV_C_CooperativeMatrixNV]>
Capability<[SPIRV_C_CooperativeMatrixNV]>
];
let arguments = (ins
SPV_AnyCooperativeMatrix:$a,
SPV_AnyCooperativeMatrix:$b,
SPV_AnyCooperativeMatrix:$c
SPIRV_AnyCooperativeMatrix:$a,
SPIRV_AnyCooperativeMatrix:$b,
SPIRV_AnyCooperativeMatrix:$c
);
let results = (outs
SPV_AnyCooperativeMatrix:$result
SPIRV_AnyCooperativeMatrix:$result
);
}
// -----
def SPV_NVCooperativeMatrixStoreOp : SPV_NvVendorOp<"CooperativeMatrixStore", []> {
def SPIRV_NVCooperativeMatrixStoreOp : SPIRV_NvVendorOp<"CooperativeMatrixStore", []> {
let summary = "See extension SPV_NV_cooperative_matrix";
let description = [{
@ -252,18 +252,18 @@ def SPV_NVCooperativeMatrixStoreOp : SPV_NvVendorOp<"CooperativeMatrixStore", []
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_NV_cooperative_matrix]>,
Capability<[SPV_C_CooperativeMatrixNV]>
Capability<[SPIRV_C_CooperativeMatrixNV]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_AnyCooperativeMatrix:$object,
SPV_Integer:$stride,
SPV_Bool:$columnmajor,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access
SPIRV_AnyPtr:$pointer,
SPIRV_AnyCooperativeMatrix:$object,
SPIRV_Integer:$stride,
SPIRV_Bool:$columnmajor,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access
);
let results = (outs);

View File

@ -21,28 +21,28 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
//===----------------------------------------------------------------------===//
// Base class for all OpenGL ops.
class SPV_GLOp<string mnemonic, int opcode, list<Trait> traits = []> :
SPV_ExtInstOp<mnemonic, "GL", "GLSL.std.450", opcode, traits> {
class SPIRV_GLOp<string mnemonic, int opcode, list<Trait> traits = []> :
SPIRV_ExtInstOp<mnemonic, "GL", "GLSL.std.450", opcode, traits> {
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Shader]>
Capability<[SPIRV_C_Shader]>
];
}
// Base class for GL unary ops.
class SPV_GLUnaryOp<string mnemonic, int opcode, Type resultType,
class SPIRV_GLUnaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
SPIRV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<operandType>:$operand
SPIRV_ScalarOrVectorOf<operandType>:$operand
);
let results = (outs
SPV_ScalarOrVectorOf<resultType>:$result
SPIRV_ScalarOrVectorOf<resultType>:$result
);
let hasVerifier = 0;
@ -50,25 +50,25 @@ class SPV_GLUnaryOp<string mnemonic, int opcode, Type resultType,
// Base class for GL Unary arithmetic ops where return type matches
// the operand type.
class SPV_GLUnaryArithmeticOp<string mnemonic, int opcode, Type type,
class SPIRV_GLUnaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_GLUnaryOp<mnemonic, opcode, type, type,
SPIRV_GLUnaryOp<mnemonic, opcode, type, type,
traits # [SameOperandsAndResultType]> {
let assemblyFormat = "$operand `:` type($operand) attr-dict";
}
// Base class for GL binary ops.
class SPV_GLBinaryOp<string mnemonic, int opcode, Type resultType,
class SPIRV_GLBinaryOp<string mnemonic, int opcode, Type resultType,
Type operandType, list<Trait> traits = []> :
SPV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
SPIRV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<operandType>:$lhs,
SPV_ScalarOrVectorOf<operandType>:$rhs
SPIRV_ScalarOrVectorOf<operandType>:$lhs,
SPIRV_ScalarOrVectorOf<operandType>:$rhs
);
let results = (outs
SPV_ScalarOrVectorOf<resultType>:$result
SPIRV_ScalarOrVectorOf<resultType>:$result
);
let hasVerifier = 0;
@ -76,26 +76,26 @@ class SPV_GLBinaryOp<string mnemonic, int opcode, Type resultType,
// Base class for GL Binary arithmetic ops where operand types and
// return type matches.
class SPV_GLBinaryArithmeticOp<string mnemonic, int opcode, Type type,
class SPIRV_GLBinaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_GLBinaryOp<mnemonic, opcode, type, type,
SPIRV_GLBinaryOp<mnemonic, opcode, type, type,
traits # [SameOperandsAndResultType]> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
// Base class for GL ternary ops.
class SPV_GLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
class SPIRV_GLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
list<Trait> traits = []> :
SPV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
SPIRV_GLOp<mnemonic, opcode, !listconcat([NoSideEffect], traits)> {
let arguments = (ins
SPV_ScalarOrVectorOf<type>:$x,
SPV_ScalarOrVectorOf<type>:$y,
SPV_ScalarOrVectorOf<type>:$z
SPIRV_ScalarOrVectorOf<type>:$x,
SPIRV_ScalarOrVectorOf<type>:$y,
SPIRV_ScalarOrVectorOf<type>:$z
);
let results = (outs
SPV_ScalarOrVectorOf<type>:$result
SPIRV_ScalarOrVectorOf<type>:$result
);
let hasCustomAssemblyFormat = 1;
@ -104,7 +104,7 @@ class SPV_GLTernaryArithmeticOp<string mnemonic, int opcode, Type type,
// -----
def SPV_GLFAbsOp : SPV_GLUnaryArithmeticOp<"FAbs", 4, SPV_Float> {
def SPIRV_GLFAbsOp : SPIRV_GLUnaryArithmeticOp<"FAbs", 4, SPIRV_Float> {
let summary = "Absolute value of operand";
let description = [{
@ -134,7 +134,7 @@ def SPV_GLFAbsOp : SPV_GLUnaryArithmeticOp<"FAbs", 4, SPV_Float> {
// -----
def SPV_GLSAbsOp : SPV_GLUnaryArithmeticOp<"SAbs", 5, SPV_Integer> {
def SPIRV_GLSAbsOp : SPIRV_GLUnaryArithmeticOp<"SAbs", 5, SPIRV_Integer> {
let summary = "Absolute value of operand";
let description = [{
@ -163,7 +163,7 @@ def SPV_GLSAbsOp : SPV_GLUnaryArithmeticOp<"SAbs", 5, SPV_Integer> {
// -----
def SPV_GLCeilOp : SPV_GLUnaryArithmeticOp<"Ceil", 9, SPV_Float> {
def SPIRV_GLCeilOp : SPIRV_GLUnaryArithmeticOp<"Ceil", 9, SPIRV_Float> {
let summary = "Rounds up to the next whole number";
let description = [{
@ -194,7 +194,7 @@ def SPV_GLCeilOp : SPV_GLUnaryArithmeticOp<"Ceil", 9, SPV_Float> {
// -----
def SPV_GLCosOp : SPV_GLUnaryArithmeticOp<"Cos", 14, SPV_Float16or32> {
def SPIRV_GLCosOp : SPIRV_GLUnaryArithmeticOp<"Cos", 14, SPIRV_Float16or32> {
let summary = "Cosine of operand in radians";
let description = [{
@ -226,7 +226,7 @@ def SPV_GLCosOp : SPV_GLUnaryArithmeticOp<"Cos", 14, SPV_Float16or32> {
// -----
def SPV_GLSinOp : SPV_GLUnaryArithmeticOp<"Sin", 13, SPV_Float16or32> {
def SPIRV_GLSinOp : SPIRV_GLUnaryArithmeticOp<"Sin", 13, SPIRV_Float16or32> {
let summary = "Sine of operand in radians";
let description = [{
@ -258,7 +258,7 @@ def SPV_GLSinOp : SPV_GLUnaryArithmeticOp<"Sin", 13, SPV_Float16or32> {
// -----
def SPV_GLTanOp : SPV_GLUnaryArithmeticOp<"Tan", 15, SPV_Float16or32> {
def SPIRV_GLTanOp : SPIRV_GLUnaryArithmeticOp<"Tan", 15, SPIRV_Float16or32> {
let summary = "Tangent of operand in radians";
let description = [{
@ -290,7 +290,7 @@ def SPV_GLTanOp : SPV_GLUnaryArithmeticOp<"Tan", 15, SPV_Float16or32> {
// -----
def SPV_GLAsinOp : SPV_GLUnaryArithmeticOp<"Asin", 16, SPV_Float16or32> {
def SPIRV_GLAsinOp : SPIRV_GLUnaryArithmeticOp<"Asin", 16, SPIRV_Float16or32> {
let summary = "Arc Sine of operand in radians";
let description = [{
@ -324,7 +324,7 @@ def SPV_GLAsinOp : SPV_GLUnaryArithmeticOp<"Asin", 16, SPV_Float16or32> {
// -----
def SPV_GLAcosOp : SPV_GLUnaryArithmeticOp<"Acos", 17, SPV_Float16or32> {
def SPIRV_GLAcosOp : SPIRV_GLUnaryArithmeticOp<"Acos", 17, SPIRV_Float16or32> {
let summary = "Arc Cosine of operand in radians";
let description = [{
@ -358,7 +358,7 @@ def SPV_GLAcosOp : SPV_GLUnaryArithmeticOp<"Acos", 17, SPV_Float16or32> {
// -----
def SPV_GLAtanOp : SPV_GLUnaryArithmeticOp<"Atan", 18, SPV_Float16or32> {
def SPIRV_GLAtanOp : SPIRV_GLUnaryArithmeticOp<"Atan", 18, SPIRV_Float16or32> {
let summary = "Arc Tangent of operand in radians";
let description = [{
@ -392,7 +392,7 @@ def SPV_GLAtanOp : SPV_GLUnaryArithmeticOp<"Atan", 18, SPV_Float16or32> {
// -----
def SPV_GLExpOp : SPV_GLUnaryArithmeticOp<"Exp", 27, SPV_Float16or32> {
def SPIRV_GLExpOp : SPIRV_GLUnaryArithmeticOp<"Exp", 27, SPIRV_Float16or32> {
let summary = "Exponentiation of Operand 1";
let description = [{
@ -424,7 +424,7 @@ def SPV_GLExpOp : SPV_GLUnaryArithmeticOp<"Exp", 27, SPV_Float16or32> {
// -----
def SPV_GLFloorOp : SPV_GLUnaryArithmeticOp<"Floor", 8, SPV_Float> {
def SPIRV_GLFloorOp : SPIRV_GLUnaryArithmeticOp<"Floor", 8, SPIRV_Float> {
let summary = "Rounds down to the next whole number";
let description = [{
@ -455,7 +455,7 @@ def SPV_GLFloorOp : SPV_GLUnaryArithmeticOp<"Floor", 8, SPV_Float> {
// -----
def SPV_GLRoundOp: SPV_GLUnaryArithmeticOp<"Round", 1, SPV_Float> {
def SPIRV_GLRoundOp: SPIRV_GLUnaryArithmeticOp<"Round", 1, SPIRV_Float> {
let summary = "Rounds to the whole number";
let description = [{
@ -485,7 +485,7 @@ def SPV_GLRoundOp: SPV_GLUnaryArithmeticOp<"Round", 1, SPV_Float> {
// -----
def SPV_GLInverseSqrtOp : SPV_GLUnaryArithmeticOp<"InverseSqrt", 32, SPV_Float> {
def SPIRV_GLInverseSqrtOp : SPIRV_GLUnaryArithmeticOp<"InverseSqrt", 32, SPIRV_Float> {
let summary = "Reciprocal of sqrt(operand)";
let description = [{
@ -515,7 +515,7 @@ def SPV_GLInverseSqrtOp : SPV_GLUnaryArithmeticOp<"InverseSqrt", 32, SPV_Float>
// -----
def SPV_GLLogOp : SPV_GLUnaryArithmeticOp<"Log", 28, SPV_Float16or32> {
def SPIRV_GLLogOp : SPIRV_GLUnaryArithmeticOp<"Log", 28, SPIRV_Float16or32> {
let summary = "Natural logarithm of the operand";
let description = [{
@ -548,7 +548,7 @@ def SPV_GLLogOp : SPV_GLUnaryArithmeticOp<"Log", 28, SPV_Float16or32> {
// -----
def SPV_GLFMaxOp : SPV_GLBinaryArithmeticOp<"FMax", 40, SPV_Float> {
def SPIRV_GLFMaxOp : SPIRV_GLBinaryArithmeticOp<"FMax", 40, SPIRV_Float> {
let summary = "Return maximum of two floating-point operands";
let description = [{
@ -579,7 +579,7 @@ def SPV_GLFMaxOp : SPV_GLBinaryArithmeticOp<"FMax", 40, SPV_Float> {
// -----
def SPV_GLUMaxOp : SPV_GLBinaryArithmeticOp<"UMax", 41, SPV_Integer> {
def SPIRV_GLUMaxOp : SPIRV_GLBinaryArithmeticOp<"UMax", 41, SPIRV_Integer> {
let summary = "Return maximum of two unsigned integer operands";
let description = [{
@ -609,7 +609,7 @@ def SPV_GLUMaxOp : SPV_GLBinaryArithmeticOp<"UMax", 41, SPV_Integer> {
// -----
def SPV_GLSMaxOp : SPV_GLBinaryArithmeticOp<"SMax", 42, SPV_Integer> {
def SPIRV_GLSMaxOp : SPIRV_GLBinaryArithmeticOp<"SMax", 42, SPIRV_Integer> {
let summary = "Return maximum of two signed integer operands";
let description = [{
@ -639,7 +639,7 @@ def SPV_GLSMaxOp : SPV_GLBinaryArithmeticOp<"SMax", 42, SPV_Integer> {
// -----
def SPV_GLFMinOp : SPV_GLBinaryArithmeticOp<"FMin", 37, SPV_Float> {
def SPIRV_GLFMinOp : SPIRV_GLBinaryArithmeticOp<"FMin", 37, SPIRV_Float> {
let summary = "Return minimum of two floating-point operands";
let description = [{
@ -670,7 +670,7 @@ def SPV_GLFMinOp : SPV_GLBinaryArithmeticOp<"FMin", 37, SPV_Float> {
// -----
def SPV_GLUMinOp : SPV_GLBinaryArithmeticOp<"UMin", 38, SPV_Integer> {
def SPIRV_GLUMinOp : SPIRV_GLBinaryArithmeticOp<"UMin", 38, SPIRV_Integer> {
let summary = "Return minimum of two unsigned integer operands";
let description = [{
@ -700,7 +700,7 @@ def SPV_GLUMinOp : SPV_GLBinaryArithmeticOp<"UMin", 38, SPV_Integer> {
// -----
def SPV_GLSMinOp : SPV_GLBinaryArithmeticOp<"SMin", 39, SPV_Integer> {
def SPIRV_GLSMinOp : SPIRV_GLBinaryArithmeticOp<"SMin", 39, SPIRV_Integer> {
let summary = "Return minimum of two signed integer operands";
let description = [{
@ -730,7 +730,7 @@ def SPV_GLSMinOp : SPV_GLBinaryArithmeticOp<"SMin", 39, SPV_Integer> {
// -----
def SPV_GLPowOp : SPV_GLBinaryArithmeticOp<"Pow", 26, SPV_Float16or32> {
def SPIRV_GLPowOp : SPIRV_GLBinaryArithmeticOp<"Pow", 26, SPIRV_Float16or32> {
let summary = "Return x raised to the y power of two operands";
let description = [{
@ -764,7 +764,7 @@ def SPV_GLPowOp : SPV_GLBinaryArithmeticOp<"Pow", 26, SPV_Float16or32> {
// -----
def SPV_GLFSignOp : SPV_GLUnaryArithmeticOp<"FSign", 6, SPV_Float> {
def SPIRV_GLFSignOp : SPIRV_GLUnaryArithmeticOp<"FSign", 6, SPIRV_Float> {
let summary = "Returns the sign of the operand";
let description = [{
@ -794,7 +794,7 @@ def SPV_GLFSignOp : SPV_GLUnaryArithmeticOp<"FSign", 6, SPV_Float> {
// -----
def SPV_GLSSignOp : SPV_GLUnaryArithmeticOp<"SSign", 7, SPV_Integer> {
def SPIRV_GLSSignOp : SPIRV_GLUnaryArithmeticOp<"SSign", 7, SPIRV_Integer> {
let summary = "Returns the sign of the operand";
let description = [{
@ -823,7 +823,7 @@ def SPV_GLSSignOp : SPV_GLUnaryArithmeticOp<"SSign", 7, SPV_Integer> {
// -----
def SPV_GLSqrtOp : SPV_GLUnaryArithmeticOp<"Sqrt", 31, SPV_Float> {
def SPIRV_GLSqrtOp : SPIRV_GLUnaryArithmeticOp<"Sqrt", 31, SPIRV_Float> {
let summary = "Returns the square root of the operand";
let description = [{
@ -853,7 +853,7 @@ def SPV_GLSqrtOp : SPV_GLUnaryArithmeticOp<"Sqrt", 31, SPV_Float> {
// -----
def SPV_GLSinhOp : SPV_GLUnaryArithmeticOp<"Sinh", 19, SPV_Float16or32> {
def SPIRV_GLSinhOp : SPIRV_GLUnaryArithmeticOp<"Sinh", 19, SPIRV_Float16or32> {
let summary = "Hyperbolic sine of operand in radians";
let description = [{
@ -885,7 +885,7 @@ def SPV_GLSinhOp : SPV_GLUnaryArithmeticOp<"Sinh", 19, SPV_Float16or32> {
// -----
def SPV_GLCoshOp : SPV_GLUnaryArithmeticOp<"Cosh", 20, SPV_Float16or32> {
def SPIRV_GLCoshOp : SPIRV_GLUnaryArithmeticOp<"Cosh", 20, SPIRV_Float16or32> {
let summary = "Hyperbolic cosine of operand in radians";
let description = [{
@ -917,7 +917,7 @@ def SPV_GLCoshOp : SPV_GLUnaryArithmeticOp<"Cosh", 20, SPV_Float16or32> {
// -----
def SPV_GLTanhOp : SPV_GLUnaryArithmeticOp<"Tanh", 21, SPV_Float16or32> {
def SPIRV_GLTanhOp : SPIRV_GLUnaryArithmeticOp<"Tanh", 21, SPIRV_Float16or32> {
let summary = "Hyperbolic tangent of operand in radians";
let description = [{
@ -949,7 +949,7 @@ def SPV_GLTanhOp : SPV_GLUnaryArithmeticOp<"Tanh", 21, SPV_Float16or32> {
// -----
def SPV_GLFClampOp : SPV_GLTernaryArithmeticOp<"FClamp", 43, SPV_Float> {
def SPIRV_GLFClampOp : SPIRV_GLTernaryArithmeticOp<"FClamp", 43, SPIRV_Float> {
let summary = "Clamp x between min and max values.";
let description = [{
@ -979,7 +979,7 @@ def SPV_GLFClampOp : SPV_GLTernaryArithmeticOp<"FClamp", 43, SPV_Float> {
// -----
def SPV_GLUClampOp : SPV_GLTernaryArithmeticOp<"UClamp", 44, SPV_Integer> {
def SPIRV_GLUClampOp : SPIRV_GLTernaryArithmeticOp<"UClamp", 44, SPIRV_Integer> {
let summary = "Clamp x between min and max values.";
let description = [{
@ -1008,7 +1008,7 @@ def SPV_GLUClampOp : SPV_GLTernaryArithmeticOp<"UClamp", 44, SPV_Integer> {
// -----
def SPV_GLSClampOp : SPV_GLTernaryArithmeticOp<"SClamp", 45, SPV_Integer> {
def SPIRV_GLSClampOp : SPIRV_GLTernaryArithmeticOp<"SClamp", 45, SPIRV_Integer> {
let summary = "Clamp x between min and max values.";
let description = [{
@ -1037,7 +1037,7 @@ def SPV_GLSClampOp : SPV_GLTernaryArithmeticOp<"SClamp", 45, SPV_Integer> {
// -----
def SPV_GLFmaOp : SPV_GLTernaryArithmeticOp<"Fma", 50, SPV_Float> {
def SPIRV_GLFmaOp : SPIRV_GLTernaryArithmeticOp<"Fma", 50, SPIRV_Float> {
let summary = "Computes a * b + c.";
let description = [{
@ -1077,7 +1077,7 @@ def SPV_GLFmaOp : SPV_GLTernaryArithmeticOp<"Fma", 50, SPV_Float> {
// ----
def SPV_GLFrexpStructOp : SPV_GLOp<"FrexpStruct", 52, [NoSideEffect]> {
def SPIRV_GLFrexpStructOp : SPIRV_GLOp<"FrexpStruct", 52, [NoSideEffect]> {
let summary = "Splits x into two components such that x = significand * 2^exponent";
let description = [{
@ -1118,11 +1118,11 @@ def SPV_GLFrexpStructOp : SPV_GLOp<"FrexpStruct", 52, [NoSideEffect]> {
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Float>:$operand
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$operand
);
let results = (outs
SPV_AnyStruct:$result
SPIRV_AnyStruct:$result
);
let assemblyFormat = [{
@ -1130,8 +1130,8 @@ def SPV_GLFrexpStructOp : SPV_GLOp<"FrexpStruct", 52, [NoSideEffect]> {
}];
}
def SPV_GLLdexpOp :
SPV_GLOp<"Ldexp", 53, [
def SPIRV_GLLdexpOp :
SPIRV_GLOp<"Ldexp", 53, [
NoSideEffect, AllTypesMatch<["x", "y"]>]> {
let summary = "Builds y such that y = significand * 2^exponent";
@ -1169,12 +1169,12 @@ def SPV_GLLdexpOp :
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Float>:$x,
SPV_ScalarOrVectorOf<SPV_Integer>:$exp
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$x,
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$exp
);
let results = (outs
SPV_ScalarOrVectorOf<SPV_Float>:$y
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$y
);
let assemblyFormat = [{
@ -1182,8 +1182,8 @@ def SPV_GLLdexpOp :
}];
}
def SPV_GLFMixOp :
SPV_GLOp<"FMix", 46, [
def SPIRV_GLFMixOp :
SPIRV_GLOp<"FMix", 46, [
NoSideEffect, AllTypesMatch<["x", "y", "a", "result"]>]> {
let summary = "Builds the linear blend of x and y";
@ -1205,13 +1205,13 @@ def SPV_GLFMixOp :
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Float>:$x,
SPV_ScalarOrVectorOf<SPV_Float>:$y,
SPV_ScalarOrVectorOf<SPV_Float>:$a
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$x,
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$y,
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$a
);
let results = (outs
SPV_ScalarOrVectorOf<SPV_Float>:$result
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$result
);
let assemblyFormat = [{
@ -1221,7 +1221,7 @@ def SPV_GLFMixOp :
let hasVerifier = 0;
}
def SPV_GLFindUMsbOp : SPV_GLUnaryArithmeticOp<"FindUMsb", 75, SPV_Int32> {
def SPIRV_GLFindUMsbOp : SPIRV_GLUnaryArithmeticOp<"FindUMsb", 75, SPIRV_Int32> {
let summary = "Unsigned-integer most-significant bit";
let description = [{

View File

@ -17,8 +17,9 @@
// -----
def SPV_GroupBroadcastOp : SPV_Op<"GroupBroadcast",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
def SPIRV_GroupBroadcastOp : SPIRV_Op<"GroupBroadcast",
[NoSideEffect,
AllTypesMatch<["value", "result"]>]> {
let summary = [{
Broadcast the Value of the invocation identified by the local id LocalId
to the result of all invocations in the group.
@ -69,20 +70,20 @@ def SPV_GroupBroadcastOp : SPV_Op<"GroupBroadcast",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Groups]>
Capability<[SPIRV_C_Groups]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_Type:$value,
SPV_ScalarOrVectorOf<SPV_Integer>:$localid
SPIRV_ScopeAttr:$execution_scope,
SPIRV_Type:$value,
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$localid
);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let assemblyFormat = [{
@ -92,7 +93,7 @@ def SPV_GroupBroadcastOp : SPV_Op<"GroupBroadcast",
// -----
def SPV_KHRSubgroupBallotOp : SPV_KhrVendorOp<"SubgroupBallot", []> {
def SPIRV_KHRSubgroupBallotOp : SPIRV_KhrVendorOp<"SubgroupBallot", []> {
let summary = "See extension SPV_KHR_shader_ballot";
let description = [{
@ -125,18 +126,18 @@ def SPV_KHRSubgroupBallotOp : SPV_KhrVendorOp<"SubgroupBallot", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_KHR_shader_ballot]>,
Capability<[SPV_C_SubgroupBallotKHR]>
Capability<[SPIRV_C_SubgroupBallotKHR]>
];
let arguments = (ins
SPV_Bool:$predicate
SPIRV_Bool:$predicate
);
let results = (outs
SPV_Int32Vec4:$result
SPIRV_Int32Vec4:$result
);
let hasVerifier = 0;
@ -146,7 +147,7 @@ def SPV_KHRSubgroupBallotOp : SPV_KhrVendorOp<"SubgroupBallot", []> {
// -----
def SPV_INTELSubgroupBlockReadOp : SPV_IntelVendorOp<"SubgroupBlockRead", []> {
def SPIRV_INTELSubgroupBlockReadOp : SPIRV_IntelVendorOp<"SubgroupBlockRead", []> {
let summary = "See extension SPV_INTEL_subgroups";
let description = [{
@ -180,24 +181,24 @@ def SPV_INTELSubgroupBlockReadOp : SPV_IntelVendorOp<"SubgroupBlockRead", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_subgroups]>,
Capability<[SPV_C_SubgroupBufferBlockIOINTEL]>
Capability<[SPIRV_C_SubgroupBufferBlockIOINTEL]>
];
let arguments = (ins
SPV_AnyPtr:$ptr
SPIRV_AnyPtr:$ptr
);
let results = (outs
SPV_Type:$value
SPIRV_Type:$value
);
}
// -----
def SPV_INTELSubgroupBlockWriteOp : SPV_IntelVendorOp<"SubgroupBlockWrite", []> {
def SPIRV_INTELSubgroupBlockWriteOp : SPIRV_IntelVendorOp<"SubgroupBlockWrite", []> {
let summary = "See extension SPV_INTEL_subgroups";
let description = [{
@ -230,15 +231,15 @@ def SPV_INTELSubgroupBlockWriteOp : SPV_IntelVendorOp<"SubgroupBlockWrite", []>
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_subgroups]>,
Capability<[SPV_C_SubgroupBufferBlockIOINTEL]>
Capability<[SPIRV_C_SubgroupBufferBlockIOINTEL]>
];
let arguments = (ins
SPV_AnyPtr:$ptr,
SPV_Type:$value
SPIRV_AnyPtr:$ptr,
SPIRV_Type:$value
);
let results = (outs);

View File

@ -19,7 +19,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
// -----
def SPV_ImageDrefGatherOp : SPV_Op<"ImageDrefGather", [NoSideEffect]> {
def SPIRV_ImageDrefGatherOp : SPIRV_Op<"ImageDrefGather", [NoSideEffect]> {
let summary = "Gathers the requested depth-comparison from four texels.";
let description = [{
@ -58,22 +58,22 @@ def SPV_ImageDrefGatherOp : SPV_Op<"ImageDrefGather", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Shader]>
Capability<[SPIRV_C_Shader]>
];
let arguments = (ins
SPV_AnySampledImage:$sampledimage,
SPV_ScalarOrVectorOf<SPV_Float>:$coordinate,
SPV_Float:$dref,
OptionalAttr<SPV_ImageOperandsAttr>:$imageoperands,
Variadic<SPV_Type>:$operand_arguments
SPIRV_AnySampledImage:$sampledimage,
SPIRV_ScalarOrVectorOf<SPIRV_Float>:$coordinate,
SPIRV_Float:$dref,
OptionalAttr<SPIRV_ImageOperandsAttr>:$imageoperands,
Variadic<SPIRV_Type>:$operand_arguments
);
let results = (outs
SPV_Vector:$result
SPIRV_Vector:$result
);
let assemblyFormat = [{$sampledimage `:` type($sampledimage) `,`
@ -86,7 +86,7 @@ def SPV_ImageDrefGatherOp : SPV_Op<"ImageDrefGather", [NoSideEffect]> {
// -----
def SPV_ImageQuerySizeOp : SPV_Op<"ImageQuerySize", [NoSideEffect]> {
def SPIRV_ImageQuerySizeOp : SPIRV_Op<"ImageQuerySize", [NoSideEffect]> {
let summary = "Query the dimensions of Image, with no level of detail.";
let description = [{
@ -124,18 +124,18 @@ def SPV_ImageQuerySizeOp : SPV_Op<"ImageQuerySize", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_ImageQuery, SPV_C_Kernel]>
Capability<[SPIRV_C_ImageQuery, SPIRV_C_Kernel]>
];
let arguments = (ins
SPV_AnyImage:$image
SPIRV_AnyImage:$image
);
let results = (outs
SPV_ScalarOrVectorOf<SPV_Integer>:$result
SPIRV_ScalarOrVectorOf<SPIRV_Integer>:$result
);
let assemblyFormat = "attr-dict $image `:` type($image) `->` type($result)";
@ -143,7 +143,7 @@ def SPV_ImageQuerySizeOp : SPV_Op<"ImageQuerySize", [NoSideEffect]> {
// -----
def SPV_ImageOp : SPV_Op<"Image",
def SPIRV_ImageOp : SPIRV_Op<"Image",
[NoSideEffect,
TypesMatchWith<"type of 'result' matches image type of 'sampledimage'",
"sampledimage", "result",
@ -166,11 +166,11 @@ def SPV_ImageOp : SPV_Op<"Image",
}];
let arguments = (ins
SPV_AnySampledImage:$sampledimage
SPIRV_AnySampledImage:$sampledimage
);
let results = (outs
SPV_AnyImage:$result
SPIRV_AnyImage:$result
);
let assemblyFormat = "attr-dict $sampledimage `:` type($sampledimage)";

View File

@ -15,7 +15,7 @@
// -----
def SPV_INTELJointMatrixWorkItemLengthOp : SPV_IntelVendorOp<"JointMatrixWorkItemLength",
def SPIRV_INTELJointMatrixWorkItemLengthOp : SPIRV_IntelVendorOp<"JointMatrixWorkItemLength",
[NoSideEffect]> {
let summary = "See extension SPV_INTEL_joint_matrix";
@ -42,10 +42,10 @@ def SPV_INTELJointMatrixWorkItemLengthOp : SPV_IntelVendorOp<"JointMatrixWorkIte
let assemblyFormat = "attr-dict `:` $joint_matrix_type";
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_joint_matrix]>,
Capability<[SPV_C_JointMatrixINTEL]>
Capability<[SPIRV_C_JointMatrixINTEL]>
];
let arguments = (ins
@ -53,14 +53,14 @@ def SPV_INTELJointMatrixWorkItemLengthOp : SPV_IntelVendorOp<"JointMatrixWorkIte
);
let results = (outs
SPV_Int32:$result
SPIRV_Int32:$result
);
let hasVerifier = 0;
}
// -----
def SPV_INTELJointMatrixLoadOp : SPV_IntelVendorOp<"JointMatrixLoad", []> {
def SPIRV_INTELJointMatrixLoadOp : SPIRV_IntelVendorOp<"JointMatrixLoad", []> {
let summary = "See extension SPV_INTEL_joint_matrix";
let description = [{
@ -97,29 +97,29 @@ def SPV_INTELJointMatrixLoadOp : SPV_IntelVendorOp<"JointMatrixLoad", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_joint_matrix]>,
Capability<[SPV_C_JointMatrixINTEL]>
Capability<[SPIRV_C_JointMatrixINTEL]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_Integer:$stride,
SPV_MatrixLayoutAttr:$layout,
SPV_ScopeAttr:$scope,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access,
SPIRV_AnyPtr:$pointer,
SPIRV_Integer:$stride,
SPIRV_MatrixLayoutAttr:$layout,
SPIRV_ScopeAttr:$scope,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access,
OptionalAttr<I32Attr>:$alignment
);
let results = (outs
SPV_AnyJointMatrix:$result
SPIRV_AnyJointMatrix:$result
);
}
// -----
def SPV_INTELJointMatrixMadOp : SPV_IntelVendorOp<"JointMatrixMad",
def SPIRV_INTELJointMatrixMadOp : SPIRV_IntelVendorOp<"JointMatrixMad",
[NoSideEffect, AllTypesMatch<["c", "result"]>]> {
let summary = "See extension SPV_INTEL_joint_matrix";
@ -162,27 +162,27 @@ def SPV_INTELJointMatrixMadOp : SPV_IntelVendorOp<"JointMatrixMad",
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_joint_matrix]>,
Capability<[SPV_C_JointMatrixINTEL]>
Capability<[SPIRV_C_JointMatrixINTEL]>
];
let arguments = (ins
SPV_AnyJointMatrix:$a,
SPV_AnyJointMatrix:$b,
SPV_AnyJointMatrix:$c,
SPV_ScopeAttr:$scope
SPIRV_AnyJointMatrix:$a,
SPIRV_AnyJointMatrix:$b,
SPIRV_AnyJointMatrix:$c,
SPIRV_ScopeAttr:$scope
);
let results = (outs
SPV_AnyJointMatrix:$result
SPIRV_AnyJointMatrix:$result
);
}
// -----
def SPV_INTELJointMatrixStoreOp : SPV_IntelVendorOp<"JointMatrixStore", []> {
def SPIRV_INTELJointMatrixStoreOp : SPIRV_IntelVendorOp<"JointMatrixStore", []> {
let summary = "See extension SPV_INTEL_joint_matrix";
let description = [{
@ -224,19 +224,19 @@ def SPV_INTELJointMatrixStoreOp : SPV_IntelVendorOp<"JointMatrixStore", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_INTEL_joint_matrix]>,
Capability<[SPV_C_JointMatrixINTEL]>
Capability<[SPIRV_C_JointMatrixINTEL]>
];
let arguments = (ins
SPV_AnyPtr:$pointer,
SPV_AnyJointMatrix:$object,
SPV_Integer:$stride,
SPV_MatrixLayoutAttr:$layout,
SPV_ScopeAttr:$scope,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access,
SPIRV_AnyPtr:$pointer,
SPIRV_AnyJointMatrix:$object,
SPIRV_Integer:$stride,
SPIRV_MatrixLayoutAttr:$layout,
SPIRV_ScopeAttr:$scope,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access,
OptionalAttr<I32Attr>:$alignment
);

View File

@ -17,10 +17,10 @@
include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
class SPV_LogicalBinaryOp<string mnemonic, Type operandsType,
list<Trait> traits = []> :
// Result type is SPV_Bool.
SPV_BinaryOp<mnemonic, SPV_Bool, operandsType,
class SPIRV_LogicalBinaryOp<string mnemonic, Type operandsType,
list<Trait> traits = []> :
// Result type is SPIRV_Bool.
SPIRV_BinaryOp<mnemonic, SPIRV_Bool, operandsType,
!listconcat(traits, [
NoSideEffect, SameTypeOperands,
SameOperandsAndResultShape,
@ -37,10 +37,10 @@ class SPV_LogicalBinaryOp<string mnemonic, Type operandsType,
];
}
class SPV_LogicalUnaryOp<string mnemonic, Type operandType,
class SPIRV_LogicalUnaryOp<string mnemonic, Type operandType,
list<Trait> traits = []> :
// Result type is SPV_Bool.
SPV_UnaryOp<mnemonic, SPV_Bool, operandType,
// Result type is SPIRV_Bool.
SPIRV_UnaryOp<mnemonic, SPIRV_Bool, operandType,
!listconcat(traits, [
NoSideEffect, SameTypeOperands, SameOperandsAndResultShape,
TypesMatchWith<"type of result to correspond to the `i1` "
@ -58,7 +58,7 @@ class SPV_LogicalUnaryOp<string mnemonic, Type operandType,
// -----
def SPV_FOrdEqualOp : SPV_LogicalBinaryOp<"FOrdEqual", SPV_Float, [Commutative]> {
def SPIRV_FOrdEqualOp : SPIRV_LogicalBinaryOp<"FOrdEqual", SPIRV_Float, [Commutative]> {
let summary = "Floating-point comparison for being ordered and equal.";
let description = [{
@ -89,7 +89,7 @@ def SPV_FOrdEqualOp : SPV_LogicalBinaryOp<"FOrdEqual", SPV_Float, [Commutative]>
// -----
def SPV_FOrdGreaterThanOp : SPV_LogicalBinaryOp<"FOrdGreaterThan", SPV_Float, []> {
def SPIRV_FOrdGreaterThanOp : SPIRV_LogicalBinaryOp<"FOrdGreaterThan", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are ordered and Operand 1 is
greater than Operand 2.
@ -123,7 +123,7 @@ def SPV_FOrdGreaterThanOp : SPV_LogicalBinaryOp<"FOrdGreaterThan", SPV_Float, []
// -----
def SPV_FOrdGreaterThanEqualOp : SPV_LogicalBinaryOp<"FOrdGreaterThanEqual", SPV_Float, []> {
def SPIRV_FOrdGreaterThanEqualOp : SPIRV_LogicalBinaryOp<"FOrdGreaterThanEqual", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are ordered and Operand 1 is
greater than or equal to Operand 2.
@ -157,7 +157,7 @@ def SPV_FOrdGreaterThanEqualOp : SPV_LogicalBinaryOp<"FOrdGreaterThanEqual", SPV
// -----
def SPV_FOrdLessThanOp : SPV_LogicalBinaryOp<"FOrdLessThan", SPV_Float, []> {
def SPIRV_FOrdLessThanOp : SPIRV_LogicalBinaryOp<"FOrdLessThan", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are ordered and Operand 1 is less
than Operand 2.
@ -191,7 +191,7 @@ def SPV_FOrdLessThanOp : SPV_LogicalBinaryOp<"FOrdLessThan", SPV_Float, []> {
// -----
def SPV_FOrdLessThanEqualOp : SPV_LogicalBinaryOp<"FOrdLessThanEqual", SPV_Float, []> {
def SPIRV_FOrdLessThanEqualOp : SPIRV_LogicalBinaryOp<"FOrdLessThanEqual", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are ordered and Operand 1 is less
than or equal to Operand 2.
@ -225,7 +225,7 @@ def SPV_FOrdLessThanEqualOp : SPV_LogicalBinaryOp<"FOrdLessThanEqual", SPV_Float
// -----
def SPV_FOrdNotEqualOp : SPV_LogicalBinaryOp<"FOrdNotEqual", SPV_Float, [Commutative]> {
def SPIRV_FOrdNotEqualOp : SPIRV_LogicalBinaryOp<"FOrdNotEqual", SPIRV_Float, [Commutative]> {
let summary = "Floating-point comparison for being ordered and not equal.";
let description = [{
@ -256,7 +256,7 @@ def SPV_FOrdNotEqualOp : SPV_LogicalBinaryOp<"FOrdNotEqual", SPV_Float, [Commuta
// -----
def SPV_FUnordEqualOp : SPV_LogicalBinaryOp<"FUnordEqual", SPV_Float, [Commutative]> {
def SPIRV_FUnordEqualOp : SPIRV_LogicalBinaryOp<"FUnordEqual", SPIRV_Float, [Commutative]> {
let summary = "Floating-point comparison for being unordered or equal.";
let description = [{
@ -287,7 +287,7 @@ def SPV_FUnordEqualOp : SPV_LogicalBinaryOp<"FUnordEqual", SPV_Float, [Commutati
// -----
def SPV_FUnordGreaterThanOp : SPV_LogicalBinaryOp<"FUnordGreaterThan", SPV_Float, []> {
def SPIRV_FUnordGreaterThanOp : SPIRV_LogicalBinaryOp<"FUnordGreaterThan", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are unordered or Operand 1 is
greater than Operand 2.
@ -321,7 +321,7 @@ def SPV_FUnordGreaterThanOp : SPV_LogicalBinaryOp<"FUnordGreaterThan", SPV_Float
// -----
def SPV_FUnordGreaterThanEqualOp : SPV_LogicalBinaryOp<"FUnordGreaterThanEqual", SPV_Float, []> {
def SPIRV_FUnordGreaterThanEqualOp : SPIRV_LogicalBinaryOp<"FUnordGreaterThanEqual", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are unordered or Operand 1 is
greater than or equal to Operand 2.
@ -355,7 +355,7 @@ def SPV_FUnordGreaterThanEqualOp : SPV_LogicalBinaryOp<"FUnordGreaterThanEqual",
// -----
def SPV_FUnordLessThanOp : SPV_LogicalBinaryOp<"FUnordLessThan", SPV_Float, []> {
def SPIRV_FUnordLessThanOp : SPIRV_LogicalBinaryOp<"FUnordLessThan", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are unordered or Operand 1 is less
than Operand 2.
@ -389,7 +389,7 @@ def SPV_FUnordLessThanOp : SPV_LogicalBinaryOp<"FUnordLessThan", SPV_Float, []>
// -----
def SPV_FUnordLessThanEqualOp : SPV_LogicalBinaryOp<"FUnordLessThanEqual", SPV_Float, []> {
def SPIRV_FUnordLessThanEqualOp : SPIRV_LogicalBinaryOp<"FUnordLessThanEqual", SPIRV_Float, []> {
let summary = [{
Floating-point comparison if operands are unordered or Operand 1 is less
than or equal to Operand 2.
@ -423,7 +423,7 @@ def SPV_FUnordLessThanEqualOp : SPV_LogicalBinaryOp<"FUnordLessThanEqual", SPV_F
// -----
def SPV_FUnordNotEqualOp : SPV_LogicalBinaryOp<"FUnordNotEqual", SPV_Float, [Commutative]> {
def SPIRV_FUnordNotEqualOp : SPIRV_LogicalBinaryOp<"FUnordNotEqual", SPIRV_Float, [Commutative]> {
let summary = "Floating-point comparison for being unordered or not equal.";
let description = [{
@ -454,8 +454,8 @@ def SPV_FUnordNotEqualOp : SPV_LogicalBinaryOp<"FUnordNotEqual", SPV_Float, [Com
// -----
def SPV_IEqualOp : SPV_LogicalBinaryOp<"IEqual",
SPV_Integer,
def SPIRV_IEqualOp : SPIRV_LogicalBinaryOp<"IEqual",
SPIRV_Integer,
[Commutative, UsableInSpecConstantOp]> {
let summary = "Integer comparison for equality.";
@ -487,8 +487,8 @@ def SPV_IEqualOp : SPV_LogicalBinaryOp<"IEqual",
// -----
def SPV_INotEqualOp : SPV_LogicalBinaryOp<"INotEqual",
SPV_Integer,
def SPIRV_INotEqualOp : SPIRV_LogicalBinaryOp<"INotEqual",
SPIRV_Integer,
[Commutative, UsableInSpecConstantOp]> {
let summary = "Integer comparison for inequality.";
@ -520,7 +520,7 @@ def SPV_INotEqualOp : SPV_LogicalBinaryOp<"INotEqual",
// -----
def SPV_IsInfOp : SPV_LogicalUnaryOp<"IsInf", SPV_Float, []> {
def SPIRV_IsInfOp : SPIRV_LogicalUnaryOp<"IsInf", SPIRV_Float, []> {
let summary = "Result is true if x is an IEEE Inf, otherwise result is false";
let description = [{
@ -551,7 +551,7 @@ def SPV_IsInfOp : SPV_LogicalUnaryOp<"IsInf", SPV_Float, []> {
// -----
def SPV_IsNanOp : SPV_LogicalUnaryOp<"IsNan", SPV_Float, []> {
def SPIRV_IsNanOp : SPIRV_LogicalUnaryOp<"IsNan", SPIRV_Float, []> {
let summary = [{
Result is true if x is an IEEE NaN, otherwise result is false.
}];
@ -584,8 +584,8 @@ def SPV_IsNanOp : SPV_LogicalUnaryOp<"IsNan", SPV_Float, []> {
// -----
def SPV_LogicalAndOp : SPV_LogicalBinaryOp<"LogicalAnd",
SPV_Bool,
def SPIRV_LogicalAndOp : SPIRV_LogicalBinaryOp<"LogicalAnd",
SPIRV_Bool,
[Commutative,
UsableInSpecConstantOp]> {
let summary = [{
@ -622,8 +622,8 @@ def SPV_LogicalAndOp : SPV_LogicalBinaryOp<"LogicalAnd",
// -----
def SPV_LogicalEqualOp : SPV_LogicalBinaryOp<"LogicalEqual",
SPV_Bool,
def SPIRV_LogicalEqualOp : SPIRV_LogicalBinaryOp<"LogicalEqual",
SPIRV_Bool,
[Commutative,
UsableInSpecConstantOp]> {
let summary = [{
@ -658,8 +658,8 @@ def SPV_LogicalEqualOp : SPV_LogicalBinaryOp<"LogicalEqual",
// -----
def SPV_LogicalNotOp : SPV_LogicalUnaryOp<"LogicalNot",
SPV_Bool,
def SPIRV_LogicalNotOp : SPIRV_LogicalUnaryOp<"LogicalNot",
SPIRV_Bool,
[UsableInSpecConstantOp]> {
let summary = [{
Result is true if Operand is false. Result is false if Operand is true.
@ -691,8 +691,8 @@ def SPV_LogicalNotOp : SPV_LogicalUnaryOp<"LogicalNot",
// -----
def SPV_LogicalNotEqualOp : SPV_LogicalBinaryOp<"LogicalNotEqual",
SPV_Bool,
def SPIRV_LogicalNotEqualOp : SPIRV_LogicalBinaryOp<"LogicalNotEqual",
SPIRV_Bool,
[Commutative,
UsableInSpecConstantOp]> {
let summary = [{
@ -727,8 +727,8 @@ def SPV_LogicalNotEqualOp : SPV_LogicalBinaryOp<"LogicalNotEqual",
// -----
def SPV_LogicalOrOp : SPV_LogicalBinaryOp<"LogicalOr",
SPV_Bool,
def SPIRV_LogicalOrOp : SPIRV_LogicalBinaryOp<"LogicalOr",
SPIRV_Bool,
[Commutative,
UsableInSpecConstantOp]> {
let summary = [{
@ -765,7 +765,7 @@ def SPV_LogicalOrOp : SPV_LogicalBinaryOp<"LogicalOr",
// -----
def SPV_OrderedOp : SPV_LogicalBinaryOp<"Ordered", SPV_Float, [Commutative]> {
def SPIRV_OrderedOp : SPIRV_LogicalBinaryOp<"Ordered", SPIRV_Float, [Commutative]> {
let summary = [{
Result is true if both x == x and y == y are true, where IEEE comparison
is used, otherwise result is false.
@ -798,17 +798,17 @@ def SPV_OrderedOp : SPV_LogicalBinaryOp<"Ordered", SPV_Float, [Commutative]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
}
// -----
def SPV_SGreaterThanOp : SPV_LogicalBinaryOp<"SGreaterThan",
SPV_Integer,
def SPIRV_SGreaterThanOp : SPIRV_LogicalBinaryOp<"SGreaterThan",
SPIRV_Integer,
[UsableInSpecConstantOp, SignedOp]> {
let summary = [{
Signed-integer comparison if Operand 1 is greater than Operand 2.
@ -842,8 +842,8 @@ def SPV_SGreaterThanOp : SPV_LogicalBinaryOp<"SGreaterThan",
// -----
def SPV_SGreaterThanEqualOp : SPV_LogicalBinaryOp<"SGreaterThanEqual",
SPV_Integer,
def SPIRV_SGreaterThanEqualOp : SPIRV_LogicalBinaryOp<"SGreaterThanEqual",
SPIRV_Integer,
[UsableInSpecConstantOp,
SignedOp]> {
let summary = [{
@ -879,8 +879,8 @@ def SPV_SGreaterThanEqualOp : SPV_LogicalBinaryOp<"SGreaterThanEqual",
// -----
def SPV_SLessThanOp : SPV_LogicalBinaryOp<"SLessThan",
SPV_Integer,
def SPIRV_SLessThanOp : SPIRV_LogicalBinaryOp<"SLessThan",
SPIRV_Integer,
[UsableInSpecConstantOp, SignedOp]> {
let summary = [{
Signed-integer comparison if Operand 1 is less than Operand 2.
@ -914,8 +914,8 @@ def SPV_SLessThanOp : SPV_LogicalBinaryOp<"SLessThan",
// -----
def SPV_SLessThanEqualOp : SPV_LogicalBinaryOp<"SLessThanEqual",
SPV_Integer,
def SPIRV_SLessThanEqualOp : SPIRV_LogicalBinaryOp<"SLessThanEqual",
SPIRV_Integer,
[UsableInSpecConstantOp,
SignedOp]> {
let summary = [{
@ -951,7 +951,7 @@ def SPV_SLessThanEqualOp : SPV_LogicalBinaryOp<"SLessThanEqual",
// -----
def SPV_SelectOp : SPV_Op<"Select",
def SPIRV_SelectOp : SPIRV_Op<"Select",
[NoSideEffect,
AllTypesMatch<["true_value", "false_value", "result"]>,
UsableInSpecConstantOp]> {
@ -999,13 +999,13 @@ def SPV_SelectOp : SPV_Op<"Select",
}];
let arguments = (ins
SPV_ScalarOrVectorOf<SPV_Bool>:$condition,
SPV_SelectType:$true_value,
SPV_SelectType:$false_value
SPIRV_ScalarOrVectorOf<SPIRV_Bool>:$condition,
SPIRV_SelectType:$true_value,
SPIRV_SelectType:$false_value
);
let results = (outs
SPV_SelectType:$result
SPIRV_SelectType:$result
);
let assemblyFormat = [{
@ -1015,8 +1015,8 @@ def SPV_SelectOp : SPV_Op<"Select",
// -----
def SPV_UGreaterThanOp : SPV_LogicalBinaryOp<"UGreaterThan",
SPV_Integer,
def SPIRV_UGreaterThanOp : SPIRV_LogicalBinaryOp<"UGreaterThan",
SPIRV_Integer,
[UnsignedOp,
UsableInSpecConstantOp]> {
let summary = [{
@ -1051,8 +1051,8 @@ def SPV_UGreaterThanOp : SPV_LogicalBinaryOp<"UGreaterThan",
// -----
def SPV_UGreaterThanEqualOp : SPV_LogicalBinaryOp<"UGreaterThanEqual",
SPV_Integer,
def SPIRV_UGreaterThanEqualOp : SPIRV_LogicalBinaryOp<"UGreaterThanEqual",
SPIRV_Integer,
[UnsignedOp,
UsableInSpecConstantOp]> {
let summary = [{
@ -1088,8 +1088,8 @@ def SPV_UGreaterThanEqualOp : SPV_LogicalBinaryOp<"UGreaterThanEqual",
// -----
def SPV_ULessThanOp : SPV_LogicalBinaryOp<"ULessThan",
SPV_Integer,
def SPIRV_ULessThanOp : SPIRV_LogicalBinaryOp<"ULessThan",
SPIRV_Integer,
[UnsignedOp, UsableInSpecConstantOp]> {
let summary = [{
Unsigned-integer comparison if Operand 1 is less than Operand 2.
@ -1123,7 +1123,7 @@ def SPV_ULessThanOp : SPV_LogicalBinaryOp<"ULessThan",
// -----
def SPV_UnorderedOp : SPV_LogicalBinaryOp<"Unordered", SPV_Float, [Commutative]> {
def SPIRV_UnorderedOp : SPIRV_LogicalBinaryOp<"Unordered", SPIRV_Float, [Commutative]> {
let summary = [{
Result is true if either x or y is an IEEE NaN, otherwise result is
false.
@ -1156,17 +1156,17 @@ def SPV_UnorderedOp : SPV_LogicalBinaryOp<"Unordered", SPV_Float, [Commutative]>
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Kernel]>
Capability<[SPIRV_C_Kernel]>
];
}
// -----
def SPV_ULessThanEqualOp : SPV_LogicalBinaryOp<"ULessThanEqual",
SPV_Integer,
def SPIRV_ULessThanEqualOp : SPIRV_LogicalBinaryOp<"ULessThanEqual",
SPIRV_Integer,
[UnsignedOp,
UsableInSpecConstantOp]> {
let summary = [{

View File

@ -16,7 +16,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
// -----
def SPV_MatrixTimesMatrixOp : SPV_Op<"MatrixTimesMatrix", [NoSideEffect]> {
def SPIRV_MatrixTimesMatrixOp : SPIRV_Op<"MatrixTimesMatrix", [NoSideEffect]> {
let summary = "Linear-algebraic multiply of LeftMatrix X RightMatrix.";
let description = [{
@ -48,19 +48,19 @@ def SPV_MatrixTimesMatrixOp : SPV_Op<"MatrixTimesMatrix", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Matrix]>
Capability<[SPIRV_C_Matrix]>
];
let arguments = (ins
SPV_AnyMatrix:$leftmatrix,
SPV_AnyMatrix:$rightmatrix
SPIRV_AnyMatrix:$leftmatrix,
SPIRV_AnyMatrix:$rightmatrix
);
let results = (outs
SPV_AnyMatrix:$result
SPIRV_AnyMatrix:$result
);
let assemblyFormat = [{
@ -70,7 +70,7 @@ def SPV_MatrixTimesMatrixOp : SPV_Op<"MatrixTimesMatrix", [NoSideEffect]> {
// -----
def SPV_MatrixTimesScalarOp : SPV_Op<"MatrixTimesScalar", [NoSideEffect]> {
def SPIRV_MatrixTimesScalarOp : SPIRV_Op<"MatrixTimesScalar", [NoSideEffect]> {
let summary = "Scale a floating-point matrix.";
let description = [{
@ -101,19 +101,19 @@ def SPV_MatrixTimesScalarOp : SPV_Op<"MatrixTimesScalar", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Matrix]>
Capability<[SPIRV_C_Matrix]>
];
let arguments = (ins
SPV_AnyMatrix:$matrix,
SPV_Float:$scalar
SPIRV_AnyMatrix:$matrix,
SPIRV_Float:$scalar
);
let results = (outs
SPV_AnyMatrix:$result
SPIRV_AnyMatrix:$result
);
// TODO: we need just one matrix type given that the input and result are the
@ -123,16 +123,16 @@ def SPV_MatrixTimesScalarOp : SPV_Op<"MatrixTimesScalar", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Matrix]>
Capability<[SPIRV_C_Matrix]>
];
}
// -----
def SPV_TransposeOp : SPV_Op<"Transpose", [NoSideEffect]> {
def SPIRV_TransposeOp : SPIRV_Op<"Transpose", [NoSideEffect]> {
let summary = "Transpose a matrix.";
let description = [{
@ -163,18 +163,18 @@ def SPV_TransposeOp : SPV_Op<"Transpose", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Matrix]>
Capability<[SPIRV_C_Matrix]>
];
let arguments = (ins
SPV_AnyMatrix:$matrix
SPIRV_AnyMatrix:$matrix
);
let results = (outs
SPV_AnyMatrix:$result
SPIRV_AnyMatrix:$result
);
let assemblyFormat = [{

View File

@ -18,7 +18,7 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
// -----
def SPV_AccessChainOp : SPV_Op<"AccessChain", [NoSideEffect]> {
def SPIRV_AccessChainOp : SPIRV_Op<"AccessChain", [NoSideEffect]> {
let summary = "Create a pointer into a composite object.";
let description = [{
@ -63,12 +63,12 @@ def SPV_AccessChainOp : SPV_Op<"AccessChain", [NoSideEffect]> {
}];
let arguments = (ins
SPV_AnyPtr:$base_ptr,
Variadic<SPV_Integer>:$indices
SPIRV_AnyPtr:$base_ptr,
Variadic<SPIRV_Integer>:$indices
);
let results = (outs
SPV_AnyPtr:$component_ptr
SPIRV_AnyPtr:$component_ptr
);
let builders = [OpBuilder<(ins "Value":$basePtr, "ValueRange":$indices)>];
@ -78,7 +78,7 @@ def SPV_AccessChainOp : SPV_Op<"AccessChain", [NoSideEffect]> {
// -----
def SPV_CopyMemoryOp : SPV_Op<"CopyMemory", []> {
def SPIRV_CopyMemoryOp : SPIRV_Op<"CopyMemory", []> {
let summary = [{
Copy from the memory pointed to by Source to the memory pointed to by
Target. Both operands must be non-void pointers and having the same <id>
@ -117,11 +117,11 @@ def SPV_CopyMemoryOp : SPV_Op<"CopyMemory", []> {
}];
let arguments = (ins
SPV_AnyPtr:$target,
SPV_AnyPtr:$source,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access,
SPIRV_AnyPtr:$target,
SPIRV_AnyPtr:$source,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access,
OptionalAttr<I32Attr>:$alignment,
OptionalAttr<SPV_MemoryAccessAttr>:$source_memory_access,
OptionalAttr<SPIRV_MemoryAccessAttr>:$source_memory_access,
OptionalAttr<I32Attr>:$source_alignment
);
@ -132,7 +132,7 @@ def SPV_CopyMemoryOp : SPV_Op<"CopyMemory", []> {
// -----
def SPV_InBoundsPtrAccessChainOp : SPV_Op<"InBoundsPtrAccessChain", [NoSideEffect]> {
def SPIRV_InBoundsPtrAccessChainOp : SPIRV_Op<"InBoundsPtrAccessChain", [NoSideEffect]> {
let summary = [{
Has the same semantics as OpPtrAccessChain, with the addition that the
resulting pointer is known to point within the base object.
@ -160,20 +160,20 @@ def SPV_InBoundsPtrAccessChainOp : SPV_Op<"InBoundsPtrAccessChain", [NoSideEffec
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Addresses]>
Capability<[SPIRV_C_Addresses]>
];
let arguments = (ins
SPV_AnyPtr:$base_ptr,
SPV_Integer:$element,
Variadic<SPV_Integer>:$indices
SPIRV_AnyPtr:$base_ptr,
SPIRV_Integer:$element,
Variadic<SPIRV_Integer>:$indices
);
let results = (outs
SPV_AnyPtr:$result
SPIRV_AnyPtr:$result
);
let builders = [OpBuilder<(ins "Value":$basePtr, "Value":$element, "ValueRange":$indices)>];
@ -181,7 +181,7 @@ def SPV_InBoundsPtrAccessChainOp : SPV_Op<"InBoundsPtrAccessChain", [NoSideEffec
// -----
def SPV_LoadOp : SPV_Op<"Load", []> {
def SPIRV_LoadOp : SPIRV_Op<"Load", []> {
let summary = "Load through a pointer.";
let description = [{
@ -217,13 +217,13 @@ def SPV_LoadOp : SPV_Op<"Load", []> {
}];
let arguments = (ins
SPV_AnyPtr:$ptr,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access,
SPIRV_AnyPtr:$ptr,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access,
OptionalAttr<I32Attr>:$alignment
);
let results = (outs
SPV_Type:$value
SPIRV_Type:$value
);
let builders = [
@ -235,7 +235,7 @@ def SPV_LoadOp : SPV_Op<"Load", []> {
// -----
def SPV_PtrAccessChainOp : SPV_Op<"PtrAccessChain", [NoSideEffect]> {
def SPIRV_PtrAccessChainOp : SPIRV_Op<"PtrAccessChain", [NoSideEffect]> {
let summary = [{
Has the same semantics as OpAccessChain, with the addition of the
Element operand.
@ -286,20 +286,20 @@ def SPV_PtrAccessChainOp : SPV_Op<"PtrAccessChain", [NoSideEffect]> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_Addresses, SPV_C_PhysicalStorageBufferAddresses, SPV_C_VariablePointers, SPV_C_VariablePointersStorageBuffer]>
Capability<[SPIRV_C_Addresses, SPIRV_C_PhysicalStorageBufferAddresses, SPIRV_C_VariablePointers, SPIRV_C_VariablePointersStorageBuffer]>
];
let arguments = (ins
SPV_AnyPtr:$base_ptr,
SPV_Integer:$element,
Variadic<SPV_Integer>:$indices
SPIRV_AnyPtr:$base_ptr,
SPIRV_Integer:$element,
Variadic<SPIRV_Integer>:$indices
);
let results = (outs
SPV_AnyPtr:$result
SPIRV_AnyPtr:$result
);
let builders = [OpBuilder<(ins "Value":$basePtr, "Value":$element, "ValueRange":$indices)>];
@ -307,7 +307,7 @@ def SPV_PtrAccessChainOp : SPV_Op<"PtrAccessChain", [NoSideEffect]> {
// -----
def SPV_StoreOp : SPV_Op<"Store", []> {
def SPIRV_StoreOp : SPIRV_Op<"Store", []> {
let summary = "Store through a pointer.";
let description = [{
@ -339,9 +339,9 @@ def SPV_StoreOp : SPV_Op<"Store", []> {
}];
let arguments = (ins
SPV_AnyPtr:$ptr,
SPV_Type:$value,
OptionalAttr<SPV_MemoryAccessAttr>:$memory_access,
SPIRV_AnyPtr:$ptr,
SPIRV_Type:$value,
OptionalAttr<SPIRV_MemoryAccessAttr>:$memory_access,
OptionalAttr<I32Attr>:$alignment
);
@ -360,7 +360,7 @@ def SPV_StoreOp : SPV_Op<"Store", []> {
// -----
def SPV_VariableOp : SPV_Op<"Variable", []> {
def SPIRV_VariableOp : SPIRV_Op<"Variable", []> {
let summary = [{
Allocate an object in memory, resulting in a pointer to it, which can be
used with OpLoad and OpStore.
@ -400,12 +400,12 @@ def SPV_VariableOp : SPV_Op<"Variable", []> {
}];
let arguments = (ins
SPV_StorageClassAttr:$storage_class,
SPIRV_StorageClassAttr:$storage_class,
Optional<AnyType>:$initializer
);
let results = (outs
SPV_AnyPtr:$pointer
SPIRV_AnyPtr:$pointer
);
}

View File

@ -18,7 +18,7 @@ include "mlir/Dialect/SPIRV/IR/SPIRVBase.td"
// -----
def SPV_KHRAssumeTrueOp : SPV_KhrVendorOp<"AssumeTrue", []> {
def SPIRV_KHRAssumeTrueOp : SPIRV_KhrVendorOp<"AssumeTrue", []> {
let summary = "TBD";
let description = [{
@ -38,14 +38,14 @@ def SPV_KHRAssumeTrueOp : SPV_KhrVendorOp<"AssumeTrue", []> {
}];
let availability = [
MinVersion<SPV_V_1_0>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_0>,
MaxVersion<SPIRV_V_1_6>,
Extension<[SPV_KHR_expect_assume]>,
Capability<[SPV_C_ExpectAssumeKHR]>
Capability<[SPIRV_C_ExpectAssumeKHR]>
];
let arguments = (ins
SPV_Bool:$condition
SPIRV_Bool:$condition
);
let results = (outs);
@ -56,7 +56,7 @@ def SPV_KHRAssumeTrueOp : SPV_KhrVendorOp<"AssumeTrue", []> {
// -----
def SPV_UndefOp : SPV_Op<"Undef", [NoSideEffect]> {
def SPIRV_UndefOp : SPIRV_Op<"Undef", [NoSideEffect]> {
let summary = "Make an intermediate object whose value is undefined.";
let description = [{
@ -83,7 +83,7 @@ def SPV_UndefOp : SPV_Op<"Undef", [NoSideEffect]> {
let arguments = (ins);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let hasVerifier = 0;

View File

@ -14,24 +14,24 @@
#ifndef MLIR_DIALECT_SPIRV_IR_NON_UNIFORM_OPS
#define MLIR_DIALECT_SPIRV_IR_NON_UNIFORM_OPS
class SPV_GroupNonUniformArithmeticOp<string mnemonic, Type type,
list<Trait> traits = []> : SPV_Op<mnemonic, traits> {
class SPIRV_GroupNonUniformArithmeticOp<string mnemonic, Type type,
list<Trait> traits = []> : SPIRV_Op<mnemonic, traits> {
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_GroupOperationAttr:$group_operation,
SPV_ScalarOrVectorOf<type>:$value,
Optional<SPV_Integer>:$cluster_size
SPIRV_ScopeAttr:$execution_scope,
SPIRV_GroupOperationAttr:$group_operation,
SPIRV_ScalarOrVectorOf<type>:$value,
Optional<SPIRV_Integer>:$cluster_size
);
let results = (outs
SPV_ScalarOrVectorOf<type>:$result
SPIRV_ScalarOrVectorOf<type>:$result
);
}
// -----
def SPV_GroupNonUniformBallotOp : SPV_Op<"GroupNonUniformBallot", []> {
def SPIRV_GroupNonUniformBallotOp : SPIRV_Op<"GroupNonUniformBallot", []> {
let summary = [{
Result is a bitfield value combining the Predicate value from all
invocations in the group that execute the same dynamic instance of this
@ -69,19 +69,19 @@ def SPV_GroupNonUniformBallotOp : SPV_Op<"GroupNonUniformBallot", []> {
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformBallot]>
Capability<[SPIRV_C_GroupNonUniformBallot]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_Bool:$predicate
SPIRV_ScopeAttr:$execution_scope,
SPIRV_Bool:$predicate
);
let results = (outs
SPV_IOrUIVec4:$result
SPIRV_IOrUIVec4:$result
);
let assemblyFormat = [{
@ -91,7 +91,7 @@ def SPV_GroupNonUniformBallotOp : SPV_Op<"GroupNonUniformBallot", []> {
// -----
def SPV_GroupNonUniformBroadcastOp : SPV_Op<"GroupNonUniformBroadcast",
def SPIRV_GroupNonUniformBroadcastOp : SPIRV_Op<"GroupNonUniformBroadcast",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
let summary = [{
Result is the Value of the invocation identified by the id Id to all
@ -139,20 +139,20 @@ def SPV_GroupNonUniformBroadcastOp : SPV_Op<"GroupNonUniformBroadcast",
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformBallot]>
Capability<[SPIRV_C_GroupNonUniformBallot]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_Type:$value,
SPV_Integer:$id
SPIRV_ScopeAttr:$execution_scope,
SPIRV_Type:$value,
SPIRV_Integer:$id
);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let assemblyFormat = [{
@ -162,7 +162,7 @@ def SPV_GroupNonUniformBroadcastOp : SPV_Op<"GroupNonUniformBroadcast",
// -----
def SPV_GroupNonUniformElectOp : SPV_Op<"GroupNonUniformElect", []> {
def SPIRV_GroupNonUniformElectOp : SPIRV_Op<"GroupNonUniformElect", []> {
let summary = [{
Result is true only in the active invocation with the lowest id in the
group, otherwise result is false.
@ -189,18 +189,18 @@ def SPV_GroupNonUniformElectOp : SPV_Op<"GroupNonUniformElect", []> {
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniform]>
Capability<[SPIRV_C_GroupNonUniform]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope
SPIRV_ScopeAttr:$execution_scope
);
let results = (outs
SPV_Bool:$result
SPIRV_Bool:$result
);
let assemblyFormat = "$execution_scope attr-dict `:` type($result)";
@ -208,7 +208,7 @@ def SPV_GroupNonUniformElectOp : SPV_Op<"GroupNonUniformElect", []> {
// -----
def SPV_GroupNonUniformFAddOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformFAdd", SPV_Float, []> {
def SPIRV_GroupNonUniformFAddOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformFAdd", SPIRV_Float, []> {
let summary = [{
A floating point add group operation of all Value operands contributed
by active invocations in the group.
@ -256,16 +256,16 @@ def SPV_GroupNonUniformFAddOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformFMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformFMax", SPV_Float, []> {
def SPIRV_GroupNonUniformFMaxOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformFMax", SPIRV_Float, []> {
let summary = [{
A floating point maximum group operation of all Value operands
contributed by active invocations in by group.
@ -316,16 +316,16 @@ def SPV_GroupNonUniformFMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformFMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformFMin", SPV_Float, []> {
def SPIRV_GroupNonUniformFMinOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformFMin", SPIRV_Float, []> {
let summary = [{
A floating point minimum group operation of all Value operands
contributed by active invocations in the group.
@ -376,16 +376,16 @@ def SPV_GroupNonUniformFMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformFMulOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformFMul", SPV_Float, []> {
def SPIRV_GroupNonUniformFMulOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformFMul", SPIRV_Float, []> {
let summary = [{
A floating point multiply group operation of all Value operands
contributed by active invocations in the group.
@ -433,16 +433,16 @@ def SPV_GroupNonUniformFMulOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformIAddOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformIAdd", SPV_Integer, []> {
def SPIRV_GroupNonUniformIAddOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformIAdd", SPIRV_Integer, []> {
let summary = [{
An integer add group operation of all Value operands contributed by
active invocations in the group.
@ -488,16 +488,16 @@ def SPV_GroupNonUniformIAddOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformIMulOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformIMul", SPV_Integer, []> {
def SPIRV_GroupNonUniformIMulOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformIMul", SPIRV_Integer, []> {
let summary = [{
An integer multiply group operation of all Value operands contributed by
active invocations in the group.
@ -543,17 +543,17 @@ def SPV_GroupNonUniformIMulOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformSMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformSMax",
SPV_Integer,
def SPIRV_GroupNonUniformSMaxOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformSMax",
SPIRV_Integer,
[SignedOp]> {
let summary = [{
A signed integer maximum group operation of all Value operands
@ -600,17 +600,17 @@ def SPV_GroupNonUniformSMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformSMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformSMin",
SPV_Integer,
def SPIRV_GroupNonUniformSMinOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformSMin",
SPIRV_Integer,
[SignedOp]> {
let summary = [{
A signed integer minimum group operation of all Value operands
@ -657,16 +657,16 @@ def SPV_GroupNonUniformSMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformShuffleOp : SPV_Op<"GroupNonUniformShuffle",
def SPIRV_GroupNonUniformShuffleOp : SPIRV_Op<"GroupNonUniformShuffle",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
let summary = [{
Result is the Value of the invocation identified by the id Id.
@ -695,20 +695,20 @@ def SPV_GroupNonUniformShuffleOp : SPV_Op<"GroupNonUniformShuffle",
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformShuffle]>
Capability<[SPIRV_C_GroupNonUniformShuffle]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_ScalarOrVector:$value,
SPV_Integer:$id
SPIRV_ScopeAttr:$execution_scope,
SPIRV_ScalarOrVector:$value,
SPIRV_Integer:$id
);
let results = (outs
SPV_ScalarOrVector:$result
SPIRV_ScalarOrVector:$result
);
let assemblyFormat = [{
@ -718,7 +718,7 @@ def SPV_GroupNonUniformShuffleOp : SPV_Op<"GroupNonUniformShuffle",
// -----
def SPV_GroupNonUniformShuffleDownOp : SPV_Op<"GroupNonUniformShuffleDown",
def SPIRV_GroupNonUniformShuffleDownOp : SPIRV_Op<"GroupNonUniformShuffleDown",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
let summary = [{
Result is the Value of the invocation identified by the current
@ -750,20 +750,20 @@ def SPV_GroupNonUniformShuffleDownOp : SPV_Op<"GroupNonUniformShuffleDown",
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformShuffleRelative]>
Capability<[SPIRV_C_GroupNonUniformShuffleRelative]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_ScalarOrVector:$value,
SPV_Integer:$delta
SPIRV_ScopeAttr:$execution_scope,
SPIRV_ScalarOrVector:$value,
SPIRV_Integer:$delta
);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let assemblyFormat = [{
@ -773,7 +773,7 @@ def SPV_GroupNonUniformShuffleDownOp : SPV_Op<"GroupNonUniformShuffleDown",
// -----
def SPV_GroupNonUniformShuffleUpOp : SPV_Op<"GroupNonUniformShuffleUp",
def SPIRV_GroupNonUniformShuffleUpOp : SPIRV_Op<"GroupNonUniformShuffleUp",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
let summary = [{
Result is the Value of the invocation identified by the current
@ -804,20 +804,20 @@ def SPV_GroupNonUniformShuffleUpOp : SPV_Op<"GroupNonUniformShuffleUp",
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformShuffleRelative]>
Capability<[SPIRV_C_GroupNonUniformShuffleRelative]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_ScalarOrVector:$value,
SPV_Integer:$delta
SPIRV_ScopeAttr:$execution_scope,
SPIRV_ScalarOrVector:$value,
SPIRV_Integer:$delta
);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let assemblyFormat = [{
@ -827,7 +827,7 @@ def SPV_GroupNonUniformShuffleUpOp : SPV_Op<"GroupNonUniformShuffleUp",
// -----
def SPV_GroupNonUniformShuffleXorOp : SPV_Op<"GroupNonUniformShuffleXor",
def SPIRV_GroupNonUniformShuffleXorOp : SPIRV_Op<"GroupNonUniformShuffleXor",
[NoSideEffect, AllTypesMatch<["value", "result"]>]> {
let summary = [{
Result is the Value of the invocation identified by the current
@ -858,20 +858,20 @@ def SPV_GroupNonUniformShuffleXorOp : SPV_Op<"GroupNonUniformShuffleXor",
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformShuffle]>
Capability<[SPIRV_C_GroupNonUniformShuffle]>
];
let arguments = (ins
SPV_ScopeAttr:$execution_scope,
SPV_ScalarOrVector:$value,
SPV_Integer:$mask
SPIRV_ScopeAttr:$execution_scope,
SPIRV_ScalarOrVector:$value,
SPIRV_Integer:$mask
);
let results = (outs
SPV_Type:$result
SPIRV_Type:$result
);
let assemblyFormat = [{
@ -881,8 +881,8 @@ def SPV_GroupNonUniformShuffleXorOp : SPV_Op<"GroupNonUniformShuffleXor",
// -----
def SPV_GroupNonUniformUMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformUMax",
SPV_Integer,
def SPIRV_GroupNonUniformUMaxOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformUMax",
SPIRV_Integer,
[UnsignedOp]> {
let summary = [{
An unsigned integer maximum group operation of all Value operands
@ -930,17 +930,17 @@ def SPV_GroupNonUniformUMaxOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}
// -----
def SPV_GroupNonUniformUMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniformUMin",
SPV_Integer,
def SPIRV_GroupNonUniformUMinOp : SPIRV_GroupNonUniformArithmeticOp<"GroupNonUniformUMin",
SPIRV_Integer,
[UnsignedOp]> {
let summary = [{
An unsigned integer minimum group operation of all Value operands
@ -988,10 +988,10 @@ def SPV_GroupNonUniformUMinOp : SPV_GroupNonUniformArithmeticOp<"GroupNonUniform
}];
let availability = [
MinVersion<SPV_V_1_3>,
MaxVersion<SPV_V_1_6>,
MinVersion<SPIRV_V_1_3>,
MaxVersion<SPIRV_V_1_6>,
Extension<[]>,
Capability<[SPV_C_GroupNonUniformArithmetic, SPV_C_GroupNonUniformClustered, SPV_C_GroupNonUniformPartitionedNV]>
Capability<[SPIRV_C_GroupNonUniformArithmetic, SPIRV_C_GroupNonUniformClustered, SPIRV_C_GroupNonUniformPartitionedNV]>
];
}

View File

@ -25,7 +25,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
// -----
def SPV_AddressOfOp : SPV_Op<"mlir.addressof",
def SPIRV_AddressOfOp : SPIRV_Op<"mlir.addressof",
[DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
InFunctionScope, NoSideEffect]> {
let summary = "Get the address of a global variable.";
@ -58,7 +58,7 @@ def SPV_AddressOfOp : SPV_Op<"mlir.addressof",
);
let results = (outs
SPV_AnyPtr:$pointer
SPIRV_AnyPtr:$pointer
);
let hasOpcode = 0;
@ -72,7 +72,7 @@ def SPV_AddressOfOp : SPV_Op<"mlir.addressof",
// -----
def SPV_ConstantOp : SPV_Op<"Constant",
def SPIRV_ConstantOp : SPIRV_Op<"Constant",
[ConstantLike,
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
NoSideEffect]> {
@ -119,7 +119,7 @@ def SPV_ConstantOp : SPV_Op<"Constant",
);
let results = (outs
SPV_Type:$constant
SPIRV_Type:$constant
);
let hasFolder = 1;
@ -143,7 +143,7 @@ def SPV_ConstantOp : SPV_Op<"Constant",
// -----
def SPV_EntryPointOp : SPV_Op<"EntryPoint", [InModuleScope]> {
def SPIRV_EntryPointOp : SPIRV_Op<"EntryPoint", [InModuleScope]> {
let summary = [{
Declare an entry point, its execution model, and its interface.
}];
@ -189,7 +189,7 @@ def SPV_EntryPointOp : SPV_Op<"EntryPoint", [InModuleScope]> {
}];
let arguments = (ins
SPV_ExecutionModelAttr:$execution_model,
SPIRV_ExecutionModelAttr:$execution_model,
FlatSymbolRefAttr:$fn,
SymbolRefArrayAttr:$interface
);
@ -205,7 +205,7 @@ def SPV_EntryPointOp : SPV_Op<"EntryPoint", [InModuleScope]> {
// -----
def SPV_ExecutionModeOp : SPV_Op<"ExecutionMode", [InModuleScope]> {
def SPIRV_ExecutionModeOp : SPIRV_Op<"ExecutionMode", [InModuleScope]> {
let summary = "Declare an execution mode for an entry point.";
let description = [{
@ -238,7 +238,7 @@ def SPV_ExecutionModeOp : SPV_Op<"ExecutionMode", [InModuleScope]> {
let arguments = (ins
FlatSymbolRefAttr:$fn,
SPV_ExecutionModeAttr:$execution_mode,
SPIRV_ExecutionModeAttr:$execution_mode,
I32ArrayAttr:$values
);
@ -255,7 +255,7 @@ def SPV_ExecutionModeOp : SPV_Op<"ExecutionMode", [InModuleScope]> {
// -----
def SPV_FuncOp : SPV_Op<"func", [
def SPIRV_FuncOp : SPIRV_Op<"func", [
AutomaticAllocationScope, DeclareOpInterfaceMethods<CallableOpInterface>,
FunctionOpInterface, InModuleScope, IsolatedFromAbove, Symbol
]> {
@ -292,7 +292,7 @@ def SPV_FuncOp : SPV_Op<"func", [
let arguments = (ins
TypeAttrOf<FunctionType>:$function_type,
StrAttr:$sym_name,
SPV_FunctionControlAttr:$function_control
SPIRV_FunctionControlAttr:$function_control
);
let results = (outs);
@ -331,7 +331,7 @@ def SPV_FuncOp : SPV_Op<"func", [
// -----
def SPV_GlobalVariableOp : SPV_Op<"GlobalVariable", [InModuleScope, Symbol]> {
def SPIRV_GlobalVariableOp : SPIRV_Op<"GlobalVariable", [InModuleScope, Symbol]> {
let summary = [{
Allocate an object in memory at module scope. The object is
referenced using a symbol name.
@ -431,7 +431,7 @@ def SPV_GlobalVariableOp : SPV_Op<"GlobalVariable", [InModuleScope, Symbol]> {
// -----
def SPV_ModuleOp : SPV_Op<"module",
def SPIRV_ModuleOp : SPIRV_Op<"module",
[IsolatedFromAbove, NoRegionArguments, NoTerminator,
SingleBlock, SymbolTable, Symbol]> {
let summary = "The top-level op that defines a SPIR-V module";
@ -479,9 +479,9 @@ def SPV_ModuleOp : SPV_Op<"module",
}];
let arguments = (ins
SPV_AddressingModelAttr:$addressing_model,
SPV_MemoryModelAttr:$memory_model,
OptionalAttr<SPV_VerCapExtAttr>:$vce_triple,
SPIRV_AddressingModelAttr:$addressing_model,
SPIRV_MemoryModelAttr:$memory_model,
OptionalAttr<SPIRV_VerCapExtAttr>:$vce_triple,
OptionalAttr<StrAttr>:$sym_name
);
@ -520,7 +520,7 @@ def SPV_ModuleOp : SPV_Op<"module",
// -----
def SPV_ReferenceOfOp : SPV_Op<"mlir.referenceof", [NoSideEffect]> {
def SPIRV_ReferenceOfOp : SPIRV_Op<"mlir.referenceof", [NoSideEffect]> {
let summary = "Reference a specialization constant.";
let description = [{
@ -552,7 +552,7 @@ def SPV_ReferenceOfOp : SPV_Op<"mlir.referenceof", [NoSideEffect]> {
);
let results = (outs
SPV_Type:$reference
SPIRV_Type:$reference
);
let hasOpcode = 0;
@ -564,7 +564,7 @@ def SPV_ReferenceOfOp : SPV_Op<"mlir.referenceof", [NoSideEffect]> {
// -----
def SPV_SpecConstantOp : SPV_Op<"SpecConstant", [InModuleScope, Symbol]> {
def SPIRV_SpecConstantOp : SPIRV_Op<"SpecConstant", [InModuleScope, Symbol]> {
let summary = [{
Declare a new integer-type or floating-point-type scalar specialization
constant.
@ -614,7 +614,7 @@ def SPV_SpecConstantOp : SPV_Op<"SpecConstant", [InModuleScope, Symbol]> {
// -----
def SPV_SpecConstantCompositeOp : SPV_Op<"SpecConstantComposite", [
def SPIRV_SpecConstantCompositeOp : SPIRV_Op<"SpecConstantComposite", [
InModuleScope, Symbol]> {
let summary = "Declare a new composite specialization constant.";
@ -668,7 +668,7 @@ def SPV_SpecConstantCompositeOp : SPV_Op<"SpecConstantComposite", [
// -----
def SPV_SpecConstantOperationOp : SPV_Op<"SpecConstantOperation", [
def SPIRV_SpecConstantOperationOp : SPIRV_Op<"SpecConstantOperation", [
NoSideEffect, InFunctionScope,
SingleBlockImplicitTerminator<"YieldOp">]> {
let summary = [{
@ -759,7 +759,7 @@ def SPV_SpecConstantOperationOp : SPV_Op<"SpecConstantOperation", [
// -----
def SPV_YieldOp : SPV_Op<"mlir.yield", [
def SPIRV_YieldOp : SPIRV_Op<"mlir.yield", [
HasParent<"SpecConstantOperationOp">, NoSideEffect, Terminator]> {
let summary = [{
Yields the result computed in `spirv.SpecConstantOperation`'s
@ -770,7 +770,7 @@ def SPV_YieldOp : SPV_Op<"mlir.yield", [
This op is a special terminator whose only purpose is to terminate
an `spirv.SpecConstantOperation`'s enclosed region. It accepts a
single operand produced by the preceeding (and only other) instruction
in its parent block (see SPV_SpecConstantOperation for further
in its parent block (see SPIRV_SpecConstantOperation for further
details). This op has no corresponding SPIR-V instruction.
```

View File

@ -144,7 +144,7 @@ struct VectorExtractStridedSliceOpConvert final
}
};
template <class SPVFMAOp>
template <class SPIRVFMAOp>
struct VectorFmaOpConvert final : public OpConversionPattern<vector::FMAOp> {
using OpConversionPattern::OpConversionPattern;
@ -154,8 +154,8 @@ struct VectorFmaOpConvert final : public OpConversionPattern<vector::FMAOp> {
Type dstType = getTypeConverter()->convertType(fmaOp.getType());
if (!dstType)
return failure();
rewriter.replaceOpWithNewOp<SPVFMAOp>(fmaOp, dstType, adaptor.getLhs(),
adaptor.getRhs(), adaptor.getAcc());
rewriter.replaceOpWithNewOp<SPIRVFMAOp>(fmaOp, dstType, adaptor.getLhs(),
adaptor.getRhs(), adaptor.getAcc());
return success();
}
};
@ -272,8 +272,8 @@ struct VectorInsertStridedSliceOpConvert final
}
};
template <class SPVFMaxOp, class SPVFMinOp, class SPVUMaxOp, class SPVUMinOp,
class SPVSMaxOp, class SPVSMinOp>
template <class SPIRVFMaxOp, class SPIRVFMinOp, class SPIRVUMaxOp,
class SPIRVUMinOp, class SPIRVSMaxOp, class SPIRVSMinOp>
struct VectorReductionPattern final
: public OpConversionPattern<vector::ReductionOp> {
using OpConversionPattern::OpConversionPattern;
@ -325,12 +325,12 @@ struct VectorReductionPattern final
INT_AND_FLOAT_CASE(ADD, IAddOp, FAddOp);
INT_AND_FLOAT_CASE(MUL, IMulOp, FMulOp);
INT_OR_FLOAT_CASE(MAXF, SPVFMaxOp);
INT_OR_FLOAT_CASE(MINF, SPVFMinOp);
INT_OR_FLOAT_CASE(MINUI, SPVUMinOp);
INT_OR_FLOAT_CASE(MINSI, SPVSMinOp);
INT_OR_FLOAT_CASE(MAXUI, SPVUMaxOp);
INT_OR_FLOAT_CASE(MAXSI, SPVSMaxOp);
INT_OR_FLOAT_CASE(MAXF, SPIRVFMaxOp);
INT_OR_FLOAT_CASE(MINF, SPIRVFMinOp);
INT_OR_FLOAT_CASE(MINUI, SPIRVUMinOp);
INT_OR_FLOAT_CASE(MINSI, SPIRVSMinOp);
INT_OR_FLOAT_CASE(MAXUI, SPIRVUMaxOp);
INT_OR_FLOAT_CASE(MAXSI, SPIRVSMaxOp);
case vector::CombiningKind::AND:
case vector::CombiningKind::OR:

View File

@ -17,28 +17,28 @@ include "mlir/Dialect/SPIRV/IR/SPIRVOps.td"
// spirv.Bitcast
//===----------------------------------------------------------------------===//
def ConvertChainedBitcast : Pat<(SPV_BitcastOp (SPV_BitcastOp $operand)),
(SPV_BitcastOp $operand)>;
def ConvertChainedBitcast : Pat<(SPIRV_BitcastOp (SPIRV_BitcastOp $operand)),
(SPIRV_BitcastOp $operand)>;
//===----------------------------------------------------------------------===//
// spirv.LogicalNot
//===----------------------------------------------------------------------===//
def ConvertLogicalNotOfIEqual : Pat<
(SPV_LogicalNotOp (SPV_IEqualOp $lhs, $rhs)),
(SPV_INotEqualOp $lhs, $rhs)>;
(SPIRV_LogicalNotOp (SPIRV_IEqualOp $lhs, $rhs)),
(SPIRV_INotEqualOp $lhs, $rhs)>;
def ConvertLogicalNotOfINotEqual : Pat<
(SPV_LogicalNotOp (SPV_INotEqualOp $lhs, $rhs)),
(SPV_IEqualOp $lhs, $rhs)>;
(SPIRV_LogicalNotOp (SPIRV_INotEqualOp $lhs, $rhs)),
(SPIRV_IEqualOp $lhs, $rhs)>;
def ConvertLogicalNotOfLogicalEqual : Pat<
(SPV_LogicalNotOp (SPV_LogicalEqualOp $lhs, $rhs)),
(SPV_LogicalNotEqualOp $lhs, $rhs)>;
(SPIRV_LogicalNotOp (SPIRV_LogicalEqualOp $lhs, $rhs)),
(SPIRV_LogicalNotEqualOp $lhs, $rhs)>;
def ConvertLogicalNotOfLogicalNotEqual : Pat<
(SPV_LogicalNotOp (SPV_LogicalNotEqualOp $lhs, $rhs)),
(SPV_LogicalEqualOp $lhs, $rhs)>;
(SPIRV_LogicalNotOp (SPIRV_LogicalNotEqualOp $lhs, $rhs)),
(SPIRV_LogicalEqualOp $lhs, $rhs)>;
//===----------------------------------------------------------------------===//
// spirv.Select -> spirv.GL.*Clamp
@ -47,18 +47,18 @@ def ConvertLogicalNotOfLogicalNotEqual : Pat<
def ValuesAreEqual : Constraint<CPred<"$0 == $1">>;
foreach CmpClampPair = [
[SPV_FOrdLessThanOp, SPV_GLFClampOp],
[SPV_FOrdLessThanEqualOp, SPV_GLFClampOp],
[SPV_SLessThanOp, SPV_GLSClampOp],
[SPV_SLessThanEqualOp, SPV_GLSClampOp],
[SPV_ULessThanOp, SPV_GLUClampOp],
[SPV_ULessThanEqualOp, SPV_GLUClampOp]] in {
[SPIRV_FOrdLessThanOp, SPIRV_GLFClampOp],
[SPIRV_FOrdLessThanEqualOp, SPIRV_GLFClampOp],
[SPIRV_SLessThanOp, SPIRV_GLSClampOp],
[SPIRV_SLessThanEqualOp, SPIRV_GLSClampOp],
[SPIRV_ULessThanOp, SPIRV_GLUClampOp],
[SPIRV_ULessThanEqualOp, SPIRV_GLUClampOp]] in {
// Detect: $min < $input, $input < $max
def ConvertComparisonIntoClamp1_#CmpClampPair[0] : Pat<
(SPV_SelectOp
(SPIRV_SelectOp
(CmpClampPair[0]
(SPV_SelectOp:$middle0
(SPIRV_SelectOp:$middle0
(CmpClampPair[0] $min, $input),
$input,
$min
@ -72,10 +72,10 @@ def ConvertComparisonIntoClamp1_#CmpClampPair[0] : Pat<
// Detect: $input < $min, $max < $input
def ConvertComparisonIntoClamp2_#CmpClampPair[0] : Pat<
(SPV_SelectOp
(SPIRV_SelectOp
(CmpClampPair[0] $max, $input),
$max,
(SPV_SelectOp
(SPIRV_SelectOp
(CmpClampPair[0] $input, $min),
$min,
$input

View File

@ -36,22 +36,23 @@ ArrayRef<spirv::Extension> spirv::getImpliedExtensions(spirv::Version version) {
// Note: the following lists are from "Appendix A: Changes" of the spec.
#define V_1_3_IMPLIED_EXTS \
Extension::SPV_KHR_shader_draw_parameters, Extension::SPV_KHR_16bit_storage, \
Extension::SPV_KHR_device_group, Extension::SPV_KHR_multiview, \
Extension::SPV_KHR_storage_buffer_storage_class, \
Extension::SPV_KHR_shader_draw_parameters, \
Extension::SPV_KHR_16bit_storage, Extension::SPV_KHR_device_group, \
Extension::SPV_KHR_multiview, \
Extension::SPV_KHR_storage_buffer_storage_class, \
Extension::SPV_KHR_variable_pointers
#define V_1_4_IMPLIED_EXTS \
Extension::SPV_KHR_no_integer_wrap_decoration, \
Extension::SPV_GOOGLE_decorate_string, \
Extension::SPV_GOOGLE_hlsl_functionality1, \
Extension::SPV_KHR_no_integer_wrap_decoration, \
Extension::SPV_GOOGLE_decorate_string, \
Extension::SPV_GOOGLE_hlsl_functionality1, \
Extension::SPV_KHR_float_controls
#define V_1_5_IMPLIED_EXTS \
Extension::SPV_KHR_8bit_storage, Extension::SPV_EXT_descriptor_indexing, \
Extension::SPV_EXT_shader_viewport_index_layer, \
Extension::SPV_EXT_physical_storage_buffer, \
Extension::SPV_KHR_physical_storage_buffer, \
Extension::SPV_KHR_8bit_storage, Extension::SPV_EXT_descriptor_indexing, \
Extension::SPV_EXT_shader_viewport_index_layer, \
Extension::SPV_EXT_physical_storage_buffer, \
Extension::SPV_KHR_physical_storage_buffer, \
Extension::SPV_KHR_vulkan_memory_model
switch (version) {

View File

@ -23,18 +23,18 @@ namespace {
namespace mlir {
namespace spirv {
void populateSPIRVGLCanonicalizationPatterns(RewritePatternSet &results) {
results.add<ConvertComparisonIntoClamp1_SPV_FOrdLessThanOp,
ConvertComparisonIntoClamp1_SPV_FOrdLessThanEqualOp,
ConvertComparisonIntoClamp1_SPV_SLessThanOp,
ConvertComparisonIntoClamp1_SPV_SLessThanEqualOp,
ConvertComparisonIntoClamp1_SPV_ULessThanOp,
ConvertComparisonIntoClamp1_SPV_ULessThanEqualOp,
ConvertComparisonIntoClamp2_SPV_FOrdLessThanOp,
ConvertComparisonIntoClamp2_SPV_FOrdLessThanEqualOp,
ConvertComparisonIntoClamp2_SPV_SLessThanOp,
ConvertComparisonIntoClamp2_SPV_SLessThanEqualOp,
ConvertComparisonIntoClamp2_SPV_ULessThanOp,
ConvertComparisonIntoClamp2_SPV_ULessThanEqualOp>(
results.add<ConvertComparisonIntoClamp1_SPIRV_FOrdLessThanOp,
ConvertComparisonIntoClamp1_SPIRV_FOrdLessThanEqualOp,
ConvertComparisonIntoClamp1_SPIRV_SLessThanOp,
ConvertComparisonIntoClamp1_SPIRV_SLessThanEqualOp,
ConvertComparisonIntoClamp1_SPIRV_ULessThanOp,
ConvertComparisonIntoClamp1_SPIRV_ULessThanEqualOp,
ConvertComparisonIntoClamp2_SPIRV_FOrdLessThanOp,
ConvertComparisonIntoClamp2_SPIRV_FOrdLessThanEqualOp,
ConvertComparisonIntoClamp2_SPIRV_SLessThanOp,
ConvertComparisonIntoClamp2_SPIRV_SLessThanEqualOp,
ConvertComparisonIntoClamp2_SPIRV_ULessThanOp,
ConvertComparisonIntoClamp2_SPIRV_ULessThanEqualOp>(
results.getContext());
}
} // namespace spirv

View File

@ -14,7 +14,7 @@ func.func @control_barrier_0() -> () {
func.func @control_barrier_1() -> () {
// expected-error @+2 {{to be one of}}
// expected-error @+1 {{failed to parse SPV_ScopeAttr}}
// expected-error @+1 {{failed to parse SPIRV_ScopeAttr}}
spirv.ControlBarrier <Something>, <Device>, <Acquire|UniformMemory>
return
}

View File

@ -34,7 +34,7 @@ func.func @spv_entry_point() attributes {
// -----
func.func @spv_entry_point() attributes {
// expected-error @+2 {{failed to parse SPV_EntryPointABIAttr parameter 'local_size' which is to be a `DenseIntElementsAttr`}}
// expected-error @+2 {{failed to parse SPIRV_EntryPointABIAttr parameter 'local_size' which is to be a `DenseIntElementsAttr`}}
// expected-error @+1 {{invalid kind of attribute specified}}
spirv.entry_point_abi = #spirv.entry_point_abi<local_size = 64>
} { return }
@ -231,8 +231,8 @@ func.func @vce_wrong_extension_type() attributes {
// -----
func.func @vce_wrong_extension() attributes {
// expected-error @+1 {{unknown extension: SPV_Something}}
vce = #spirv.vce<v1.0, [Shader], [SPV_Something]>
// expected-error @+1 {{unknown extension: SPIRV_Something}}
vce = #spirv.vce<v1.0, [Shader], [SPIRV_Something]>
} { return }
// -----

View File

@ -4,7 +4,7 @@
module attributes {
gpu.container_module,
spirv.target_env = #spirv.target_env<
#spirv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>,
#spirv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>,
#spirv.resource_limits<>>
} {
gpu.module @kernels {

View File

@ -508,7 +508,7 @@ static mlir::GenRegistration
// Serialization AutoGen
//===----------------------------------------------------------------------===//
/// Generates code to serialize attributes of a SPV_Op `op` into `os`. The
/// Generates code to serialize attributes of a SPIRV_Op `op` into `os`. The
/// generates code extracts the attribute with name `attrName` from
/// `operandList` of `op`.
static void emitAttributeSerialization(const Attribute &attr,
@ -517,9 +517,9 @@ static void emitAttributeSerialization(const Attribute &attr,
StringRef attrName, raw_ostream &os) {
os << tabs
<< formatv("if (auto attr = {0}->getAttr(\"{1}\")) {{\n", opVar, attrName);
if (attr.getAttrDefName() == "SPV_ScopeAttr" ||
attr.getAttrDefName() == "SPV_MemorySemanticsAttr" ||
attr.getAttrDefName() == "SPV_MatrixLayoutAttr") {
if (attr.getAttrDefName() == "SPIRV_ScopeAttr" ||
attr.getAttrDefName() == "SPIRV_MemorySemanticsAttr" ||
attr.getAttrDefName() == "SPIRV_MatrixLayoutAttr") {
// These two enums are encoded as <id> to constant values in SPIR-V blob,
// but we directly use the constant value as attribute in SPIR-V dialect. So
// need to handle them separately from normal enum attributes.
@ -530,8 +530,8 @@ static void emitAttributeSerialization(const Attribute &attr,
"attr.cast<{2}::{3}Attr>().getValue()))));\n",
operandList, opVar, baseEnum.getCppNamespace(),
baseEnum.getEnumClassName());
} else if (attr.isSubClassOf("SPV_BitEnumAttr") ||
attr.isSubClassOf("SPV_I32EnumAttr")) {
} else if (attr.isSubClassOf("SPIRV_BitEnumAttr") ||
attr.isSubClassOf("SPIRV_I32EnumAttr")) {
EnumAttr baseEnum(attr.getDef().getValueAsDef("enum"));
os << tabs
<< formatv(" {0}.push_back(static_cast<uint32_t>("
@ -566,7 +566,7 @@ static void emitAttributeSerialization(const Attribute &attr,
os << tabs << "}\n";
}
/// Generates code to serialize the operands of a SPV_Op `op` into `os`. The
/// Generates code to serialize the operands of a SPIRV_Op `op` into `os`. The
/// generated queries the SSA-ID if operand is a SSA-Value, or serializes the
/// attributes. The `operands` vector is updated appropriately. `elidedAttrs`
/// updated as well to include the serialized attributes.
@ -650,7 +650,7 @@ static void emitArgumentSerialization(const Operator &op, ArrayRef<SMLoc> loc,
}
}
/// Generates code to serializes the result of SPV_Op `op` into `os`. The
/// Generates code to serializes the result of SPIRV_Op `op` into `os`. The
/// generated gets the ID for the type of the result (if any), the SSA-ID of
/// the result and updates `resultID` with the SSA-ID.
static void emitResultSerialization(const Operator &op, ArrayRef<SMLoc> loc,
@ -677,7 +677,7 @@ static void emitResultSerialization(const Operator &op, ArrayRef<SMLoc> loc,
}
}
/// Generates code to serialize attributes of SPV_Op `op` that become
/// Generates code to serialize attributes of SPIRV_Op `op` that become
/// decorations on the `resultID` of the serialized operation `opVar` in the
/// SPIR-V binary.
static void emitDecorationSerialization(const Operator &op, StringRef tabs,
@ -701,7 +701,7 @@ static void emitDecorationSerialization(const Operator &op, StringRef tabs,
}
}
/// Generates code to serialize an SPV_Op `op` into `os`.
/// Generates code to serialize an SPIRV_Op `op` into `os`.
static void emitSerializationFunction(const Record *attrClass,
const Record *record, const Operator &op,
raw_ostream &os) {
@ -720,7 +720,7 @@ static void emitSerializationFunction(const Record *attrClass,
if (op.getNumAttributes() == 0 && op.getNumVariableLengthOperands() == 0) {
std::string extInstSet;
std::string opcode;
if (record->isSubClassOf("SPV_ExtInstOp")) {
if (record->isSubClassOf("SPIRV_ExtInstOp")) {
extInstSet =
formatv("\"{0}\"", record->getValueAsString("extendedInstSetName"));
opcode = std::to_string(record->getValueAsInt("extendedInstOpcode"));
@ -749,7 +749,7 @@ static void emitSerializationFunction(const Record *attrClass,
emitArgumentSerialization(op, record->getLoc(), " ", opVar, operands,
elidedAttrs, os);
if (record->isSubClassOf("SPV_ExtInstOp")) {
if (record->isSubClassOf("SPIRV_ExtInstOp")) {
os << formatv(
" (void)encodeExtensionInstruction({0}, \"{1}\", {2}, {3});\n", opVar,
record->getValueAsString("extendedInstSetName"),
@ -802,7 +802,7 @@ static void finalizeDispatchSerializationFn(StringRef opVar, raw_ostream &os) {
os << "}\n\n";
}
/// Generates code to deserialize the attribute of a SPV_Op into `os`. The
/// Generates code to deserialize the attribute of a SPIRV_Op into `os`. The
/// generated code reads the `words` of the serialized instruction at
/// position `wordIndex` and adds the deserialized attribute into `attrList`.
static void emitAttributeDeserialization(const Attribute &attr,
@ -810,9 +810,9 @@ static void emitAttributeDeserialization(const Attribute &attr,
StringRef attrList, StringRef attrName,
StringRef words, StringRef wordIndex,
raw_ostream &os) {
if (attr.getAttrDefName() == "SPV_ScopeAttr" ||
attr.getAttrDefName() == "SPV_MemorySemanticsAttr" ||
attr.getAttrDefName() == "SPV_MatrixLayoutAttr") {
if (attr.getAttrDefName() == "SPIRV_ScopeAttr" ||
attr.getAttrDefName() == "SPIRV_MemorySemanticsAttr" ||
attr.getAttrDefName() == "SPIRV_MatrixLayoutAttr") {
// These two enums are encoded as <id> to constant values in SPIR-V blob,
// but we directly use the constant value as attribute in SPIR-V dialect. So
// need to handle them separately from normal enum attributes.
@ -823,8 +823,8 @@ static void emitAttributeDeserialization(const Attribute &attr,
"getConstantInt({4}[{5}++]).getValue().getZExtValue()))));\n",
attrList, attrName, baseEnum.getCppNamespace(),
baseEnum.getEnumClassName(), words, wordIndex);
} else if (attr.isSubClassOf("SPV_BitEnumAttr") ||
attr.isSubClassOf("SPV_I32EnumAttr")) {
} else if (attr.isSubClassOf("SPIRV_BitEnumAttr") ||
attr.isSubClassOf("SPIRV_I32EnumAttr")) {
EnumAttr baseEnum(attr.getDef().getValueAsDef("enum"));
os << tabs
<< formatv(" {0}.push_back(opBuilder.getNamedAttr(\"{1}\", "
@ -864,7 +864,7 @@ static void emitAttributeDeserialization(const Attribute &attr,
}
}
/// Generates the code to deserialize the result of an SPV_Op `op` into
/// Generates the code to deserialize the result of an SPIRV_Op `op` into
/// `os`. The generated code gets the type of the result specified at
/// `words`[`wordIndex`], the SSA ID for the result at position `wordIndex` + 1
/// and updates the `resultType` and `valueID` with the parsed type and SSA ID,
@ -908,7 +908,7 @@ static void emitResultDeserialization(const Operator &op, ArrayRef<SMLoc> loc,
}
}
/// Generates the code to deserialize the operands of an SPV_Op `op` into
/// Generates the code to deserialize the operands of an SPIRV_Op `op` into
/// `os`. The generated code reads the `words` of the binary instruction, from
/// position `wordIndex` to the end, and either gets the Value corresponding to
/// the ID encoded, or deserializes the attributes encoded. The parsed
@ -986,7 +986,7 @@ static void emitDecorationDeserialization(const Operator &op, StringRef tabs,
}
}
/// Generates code to deserialize an SPV_Op `op` into `os`.
/// Generates code to deserialize an SPIRV_Op `op` into `os`.
static void emitDeserializationFunction(const Record *attrClass,
const Record *record,
const Operator &op, raw_ostream &os) {
@ -1111,7 +1111,7 @@ emitExtendedSetDeserializationDispatch(const RecordKeeper &recordKeeper,
StringRef extensionSetName("extensionSetName"),
instructionID("instructionID"), words("words");
// First iterate over all ops derived from SPV_ExtensionSetOps to get all
// First iterate over all ops derived from SPIRV_ExtensionSetOps to get all
// extensionSets.
// For each of the extensions a separate raw_string_ostream is used to
@ -1123,7 +1123,7 @@ emitExtendedSetDeserializationDispatch(const RecordKeeper &recordKeeper,
initExtendedSetDeserializationDispatch(extensionSetName, instructionID, words,
os);
auto defs = recordKeeper.getAllDerivedDefinitions("SPV_ExtInstOp");
auto defs = recordKeeper.getAllDerivedDefinitions("SPIRV_ExtInstOp");
for (const auto *def : defs) {
if (!def->getValueAsBit("autogenSerialization")) {
continue;
@ -1163,7 +1163,7 @@ emitExtendedSetDeserializationDispatch(const RecordKeeper &recordKeeper,
}
/// Emits all the autogenerated serialization/deserializations functions for the
/// SPV_Ops.
/// SPIRV_Ops.
static bool emitSerializationFns(const RecordKeeper &recordKeeper,
raw_ostream &os) {
llvm::emitSourceFileHeader("SPIR-V Serialization Utilities/Functions", os);
@ -1181,12 +1181,13 @@ static bool emitSerializationFns(const RecordKeeper &recordKeeper,
// Handle the SPIR-V ops.
initDispatchSerializationFn(opVar, dSerFn);
initDispatchDeserializationFn(opcode, words, dDesFn);
auto defs = recordKeeper.getAllDerivedDefinitions("SPV_Op");
auto defs = recordKeeper.getAllDerivedDefinitions("SPIRV_Op");
for (const auto *def : defs) {
Operator op(def);
emitSerializationFunction(attrClass, def, op, serFn);
emitDeserializationFunction(attrClass, def, op, deserFn);
if (def->getValueAsBit("hasOpcode") || def->isSubClassOf("SPV_ExtInstOp")) {
if (def->getValueAsBit("hasOpcode") ||
def->isSubClassOf("SPIRV_ExtInstOp")) {
emitSerializationDispatch(op, " ", opVar, dSerFn);
}
if (def->getValueAsBit("hasOpcode")) {
@ -1288,8 +1289,8 @@ static void emitAvailabilityImpl(const Operator &srcOp, raw_ostream &os) {
for (const Availability &avail : opAvailabilities)
availClasses.try_emplace(avail.getClass(), avail);
for (const NamedAttribute &namedAttr : srcOp.getAttributes()) {
if (!namedAttr.attr.isSubClassOf("SPV_BitEnumAttr") &&
!namedAttr.attr.isSubClassOf("SPV_I32EnumAttr"))
if (!namedAttr.attr.isSubClassOf("SPIRV_BitEnumAttr") &&
!namedAttr.attr.isSubClassOf("SPIRV_I32EnumAttr"))
continue;
EnumAttr enumAttr(namedAttr.attr.getDef().getValueAsDef("enum"));
@ -1330,8 +1331,8 @@ static void emitAvailabilityImpl(const Operator &srcOp, raw_ostream &os) {
// Update with enum attributes' specific availability spec.
for (const NamedAttribute &namedAttr : srcOp.getAttributes()) {
if (!namedAttr.attr.isSubClassOf("SPV_BitEnumAttr") &&
!namedAttr.attr.isSubClassOf("SPV_I32EnumAttr"))
if (!namedAttr.attr.isSubClassOf("SPIRV_BitEnumAttr") &&
!namedAttr.attr.isSubClassOf("SPIRV_I32EnumAttr"))
continue;
EnumAttr enumAttr(namedAttr.attr.getDef().getValueAsDef("enum"));
@ -1391,7 +1392,7 @@ static bool emitAvailabilityImpl(const RecordKeeper &recordKeeper,
raw_ostream &os) {
llvm::emitSourceFileHeader("SPIR-V Op Availability Implementations", os);
auto defs = recordKeeper.getAllDerivedDefinitions("SPV_Op");
auto defs = recordKeeper.getAllDerivedDefinitions("SPIRV_Op");
for (const auto *def : defs) {
Operator op(def);
emitAvailabilityImpl(op, os);
@ -1419,7 +1420,7 @@ static bool emitCapabilityImplication(const RecordKeeper &recordKeeper,
llvm::emitSourceFileHeader("SPIR-V Capability Implication", os);
EnumAttr enumAttr(
recordKeeper.getDef("SPV_CapabilityAttr")->getValueAsDef("enum"));
recordKeeper.getDef("SPIRV_CapabilityAttr")->getValueAsDef("enum"));
os << "ArrayRef<spirv::Capability> "
"spirv::getDirectImpliedCapabilities(spirv::Capability cap) {\n"

View File

@ -266,8 +266,8 @@ def get_availability_spec(enum_case, capability_mapping, for_op, for_cap):
"""
assert not (for_op and for_cap), 'cannot set both for_op and for_cap'
DEFAULT_MIN_VERSION = 'MinVersion<SPV_V_1_0>'
DEFAULT_MAX_VERSION = 'MaxVersion<SPV_V_1_6>'
DEFAULT_MIN_VERSION = 'MinVersion<SPIRV_V_1_0>'
DEFAULT_MAX_VERSION = 'MaxVersion<SPIRV_V_1_6>'
DEFAULT_CAP = 'Capability<[]>'
DEFAULT_EXT = 'Extension<[]>'
@ -275,7 +275,7 @@ def get_availability_spec(enum_case, capability_mapping, for_op, for_cap):
if min_version == 'None':
min_version = ''
elif min_version:
min_version = 'MinVersion<SPV_V_{}>'.format(min_version.replace('.', '_'))
min_version = 'MinVersion<SPIRV_V_{}>'.format(min_version.replace('.', '_'))
# TODO: delete this once ODS can support dialect-specific content
# and we can use omission to mean no requirements.
if for_op and not min_version:
@ -283,7 +283,7 @@ def get_availability_spec(enum_case, capability_mapping, for_op, for_cap):
max_version = enum_case.get('lastVersion', '')
if max_version:
max_version = 'MaxVersion<SPV_V_{}>'.format(max_version.replace('.', '_'))
max_version = 'MaxVersion<SPIRV_V_{}>'.format(max_version.replace('.', '_'))
# TODO: delete this once ODS can support dialect-specific content
# and we can use omission to mean no requirements.
if for_op and not max_version:
@ -314,7 +314,7 @@ def get_availability_spec(enum_case, capability_mapping, for_op, for_cap):
else:
canonicalized_caps.append(c)
prefixed_caps = [
'SPV_C_{}'.format(c) for c in sorted(set(canonicalized_caps))
'SPIRV_C_{}'.format(c) for c in sorted(set(canonicalized_caps))
]
if for_cap:
# If this is generating the availability for capabilities, we need to
@ -333,7 +333,7 @@ def get_availability_spec(enum_case, capability_mapping, for_op, for_cap):
avail = ''
# Compose availability spec if any of the requirements is not empty.
# For ops, because we have a default in SPV_Op class, omit if the spec
# For ops, because we have a default in SPIRV_Op class, omit if the spec
# is the same.
if (min_version or max_version or caps or exts) and not (
for_op and min_version == DEFAULT_MIN_VERSION and
@ -387,7 +387,7 @@ def gen_operand_kind_enum_attr(operand_kind, capability_mapping):
# Generate the definition for each enum case
case_category = 'I32Bit' if is_bit_enum else 'I32'
fmt_str = 'def SPV_{acronym}_{case_name} {colon:>{offset}} '\
fmt_str = 'def SPIRV_{acronym}_{case_name} {colon:>{offset}} '\
'{category}EnumAttrCase{suffix}<"{symbol}"{case_value_part}>{avail}'
case_defs = []
for case_pair in kind_cases:
@ -424,7 +424,7 @@ def gen_operand_kind_enum_attr(operand_kind, capability_mapping):
case_defs = '\n'.join(case_defs)
# Generate the list of enum case names
fmt_str = 'SPV_{acronym}_{symbol}';
fmt_str = 'SPIRV_{acronym}_{symbol}';
case_names = [fmt_str.format(acronym=kind_acronym,symbol=case[0])
for case in kind_cases]
@ -436,8 +436,8 @@ def gen_operand_kind_enum_attr(operand_kind, capability_mapping):
# Generate the enum attribute definition
kind_category = 'Bit' if is_bit_enum else 'I32'
enum_attr = '''def SPV_{name}Attr :
SPV_{category}EnumAttr<"{name}", "valid SPIR-V {name}", "{snake_name}", [
enum_attr = '''def SPIRV_{name}Attr :
SPIRV_{category}EnumAttr<"{name}", "valid SPIR-V {name}", "{snake_name}", [
{cases}
]>;'''.format(
name=kind_name,
@ -451,11 +451,11 @@ def gen_opcode(instructions):
""" Generates the TableGen definition to map opname to opcode
Returns:
- A string containing the TableGen SPV_OpCode definition
- A string containing the TableGen SPIRV_OpCode definition
"""
max_len = max([len(inst['opname']) for inst in instructions])
def_fmt_str = 'def SPV_OC_{name} {colon:>{offset}} '\
def_fmt_str = 'def SPIRV_OC_{name} {colon:>{offset}} '\
'I32EnumAttrCase<"{name}", {value}>;'
opcode_defs = [
def_fmt_str.format(
@ -466,7 +466,7 @@ def gen_opcode(instructions):
]
opcode_str = '\n'.join(opcode_defs)
decl_fmt_str = 'SPV_OC_{name}'
decl_fmt_str = 'SPIRV_OC_{name}'
opcode_list = [
decl_fmt_str.format(name=inst['opname']) for inst in instructions
]
@ -475,8 +475,8 @@ def gen_opcode(instructions):
'{:6}'.format('') + ', '.join(sublist) for sublist in opcode_list
]
opcode_list = ',\n'.join(opcode_list)
enum_attr = 'def SPV_OpcodeAttr :\n'\
' SPV_I32EnumAttr<"{name}", "valid SPIR-V instructions", '\
enum_attr = 'def SPIRV_OpcodeAttr :\n'\
' SPIRV_I32EnumAttr<"{name}", "valid SPIR-V instructions", '\
'"opcode", [\n'\
'{lst}\n'\
' ]>;'.format(name='Opcode', lst=opcode_list)
@ -514,7 +514,7 @@ def gen_instr_coverage_report(path, instructions):
content = content.split(AUTOGEN_OPCODE_SECTION_MARKER)
existing_opcodes = [k[11:] for k in re.findall('def SPV_OC_\w+', content[1])]
existing_opcodes = [k[11:] for k in re.findall('def SPIRV_OC_\w+', content[1])]
existing_instructions = list(
filter(lambda inst: (inst['opname'] in existing_opcodes),
instructions))
@ -568,7 +568,7 @@ def update_td_opcodes(path, instructions, filter_list):
assert len(content) == 3
# Extend opcode list with existing list
existing_opcodes = [k[11:] for k in re.findall('def SPV_OC_\w+', content[1])]
existing_opcodes = [k[11:] for k in re.findall('def SPIRV_OC_\w+', content[1])]
filter_list.extend(existing_opcodes)
filter_list = list(set(filter_list))
@ -604,7 +604,7 @@ def update_td_enum_attrs(path, operand_kinds, filter_list):
# Extend filter list with existing enum definitions
existing_kinds = [
k[8:-4] for k in re.findall('def SPV_\w+Attr', content[1])]
k[8:-4] for k in re.findall('def SPIRV_\w+Attr', content[1])]
filter_list.extend(existing_kinds)
capability_mapping = get_capability_mapping(operand_kinds)
@ -656,17 +656,17 @@ def map_spec_operand_to_ods_argument(operand):
if kind == 'IdRef':
if quantifier == '':
arg_type = 'SPV_Type'
arg_type = 'SPIRV_Type'
elif quantifier == '?':
arg_type = 'Optional<SPV_Type>'
arg_type = 'Optional<SPIRV_Type>'
else:
arg_type = 'Variadic<SPV_Type>'
arg_type = 'Variadic<SPIRV_Type>'
elif kind == 'IdMemorySemantics' or kind == 'IdScope':
# TODO: Need to further constrain 'IdMemorySemantics'
# and 'IdScope' given that they should be generated from OpConstant.
assert quantifier == '', ('unexpected to have optional/variadic memory '
'semantics or scope <id>')
arg_type = 'SPV_' + kind[2:] + 'Attr'
arg_type = 'SPIRV_' + kind[2:] + 'Attr'
elif kind == 'LiteralInteger':
if quantifier == '':
arg_type = 'I32Attr'
@ -685,7 +685,7 @@ def map_spec_operand_to_ods_argument(operand):
else:
# The rest are all enum operands that we represent with op attributes.
assert quantifier != '*', 'unexpected to have variadic enum attribute'
arg_type = 'SPV_{}Attr'.format(kind)
arg_type = 'SPIRV_{}Attr'.format(kind)
if quantifier == '?':
arg_type = 'OptionalAttr<{}>'.format(arg_type)
@ -725,13 +725,13 @@ def get_op_definition(instruction, opname, doc, existing_info, capability_mappin
- A string containing the TableGen op definition
"""
if settings.gen_cl_ops:
fmt_str = ('def SPV_{opname}Op : '
'SPV_{inst_category}<"{opname_src}", {opcode}, <<Insert result type>> > '
fmt_str = ('def SPIRV_{opname}Op : '
'SPIRV_{inst_category}<"{opname_src}", {opcode}, <<Insert result type>> > '
'{{\n let summary = {summary};\n\n let description = '
'[{{\n{description}}}];{availability}\n')
else:
fmt_str = ('def SPV_{vendor_name}{opname_src}Op : '
'SPV_{inst_category}<"{opname_src}"{category_args}, [{traits}]> '
fmt_str = ('def SPIRV_{vendor_name}{opname_src}Op : '
'SPIRV_{inst_category}<"{opname_src}"{category_args}, [{traits}]> '
'{{\n let summary = {summary};\n\n let description = '
'[{{\n{description}}}];{availability}\n')
@ -787,7 +787,7 @@ def get_op_definition(instruction, opname, doc, existing_info, capability_mappin
# Set op's result
results = ''
if len(operands) > 0 and operands[0]['kind'] == 'IdResultType':
results = '\n SPV_Type:$result\n '
results = '\n SPIRV_Type:$result\n '
operands = operands[1:]
if 'results' in existing_info:
results = existing_info['results']
@ -902,13 +902,13 @@ def extract_td_op_info(op_def):
- A dict containing potential manually specified sections
"""
# Get opname
opname = [o[8:-2] for o in re.findall('def SPV_\w+Op', op_def)]
opname = [o[8:-2] for o in re.findall('def SPIRV_\w+Op', op_def)]
assert len(opname) == 1, 'more than one ops in the same section!'
opname = opname[0]
# Get instruction category
inst_category = [
o[4:] for o in re.findall('SPV_\w+Op',
o[4:] for o in re.findall('SPIRV_\w+Op',
op_def.split(':', 1)[1])
]
assert len(inst_category) <= 1, 'more than one ops in the same section!'