Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td
Show First 20 Lines • Show All 1,006 Lines • ▼ Show 20 Lines | let description = [{ | ||||
```mlir | ```mlir | ||||
%0 = spv.GLSL.Fma %a, %b, %c : f32 | %0 = spv.GLSL.Fma %a, %b, %c : f32 | ||||
%1 = spv.GLSL.Fma %a, %b, %c : vector<3xf16> | %1 = spv.GLSL.Fma %a, %b, %c : vector<3xf16> | ||||
``` | ``` | ||||
}]; | }]; | ||||
} | } | ||||
// ---- | |||||
def SPV_GLSLFrexpStructOp : SPV_GLSLOp<"FrexpStruct", 52, [NoSideEffect]> { | |||||
let summary = "Splits x into two components such that x = significand * 2^exponent"; | |||||
let description = [{ | |||||
Result is a structure containing x split into a floating-point significand | |||||
ergawy: Look like the description is taken from an old revision of the spec. Given that `Frexp` is not… | |||||
+1 antiagainst: +1 | |||||
Thanks for clarifying the generation of glsl extension. I was confused by the fact that all ops containing "<!-- End of AutoGen section-->". We added this instruction months ago, and I didn't notice the out-of-date problem. I will update with the latest version. A side question is that if knronos update the spirv version's, those documents needs to get update or we haven't done things like this? Weiwei-2021: Thanks for clarifying the generation of glsl extension. I was confused by the fact that all ops… | |||||
Not Done ReplyInline Actions
Yeah. But I won't worry that too much. The spec is not updated very frequently. Changes will be reflected when we add new ops. There is a delay there but it's fine to me. antiagainst: > A side question is that if knronos update the spirv version's, those documents needs to get… | |||||
in the range (-1.0, 0.5] or [0.5, 1.0) and an integral exponent of 2, such that: | |||||
x = significand * 2^exponent | |||||
If x is a zero, the exponent is 0.0. If x is an infinity or a NaN, the | |||||
exponent is undefined. If x is 0.0, the significand is 0.0. If x is -0.0, | |||||
the significand is -0.0 | |||||
Result Type must be an OpTypeStruct with two members. Member 0 must have | |||||
the same type as the type of x. Member 0 holds the significand. Member 1 | |||||
must be a scalar or vector with integer component type, with 32-bit | |||||
component width. Member 1 holds the exponent. These two members and x must | |||||
have the same number of components. | |||||
The operand x must be a scalar or vector whose component type is | |||||
floating-point. | |||||
<!-- End of AutoGen section --> | |||||
``` | |||||
float-scalar-vector-type ::= float-type | | |||||
`vector<` integer-literal `x` float-type `>` | |||||
integer-scalar-vector-type ::= integer-type | | |||||
`vector<` integer-literal `x` integer-type `>` | |||||
frexpstruct-op ::= ssa-id `=` `spv.GLSL.FrexpStruct` ssa-use `:` | |||||
`!spv.struct<` float-scalar-vector-type `,` | |||||
integer-scalar-vector-type `>` | |||||
``` | |||||
#### Example: | |||||
```mlir | |||||
%2 = spv.GLSL.FrexpStruct %0 : f32 -> !spv.struct<f32, i32> | |||||
%3 = spv.GLSL.FrexpStruct %0 : vector<3xf32> -> !spv.struct<vector<3xf32>, vector<3xi32>> | |||||
``` | |||||
}]; | |||||
let arguments = (ins | |||||
SPV_ScalarOrVectorOf<SPV_Float>:$operand | |||||
); | |||||
let results = (outs | |||||
SPV_AnyStruct:$result | |||||
); | |||||
let assemblyFormat = [{ | |||||
attr-dict $operand `:` type($operand) `->` type($result) | |||||
}]; | |||||
let verifier = [{ return ::verifyGLSLFrexpStructOp(*this); }]; | |||||
} | |||||
#endif // MLIR_DIALECT_SPIRV_IR_GLSL_OPS | #endif // MLIR_DIALECT_SPIRV_IR_GLSL_OPS |
Look like the description is taken from an old revision of the spec. Given that Frexp is not supported here (and deprecated), it would be great to use the latest revision: https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html