‘mathExt’ Dialect¶
Extended Math dialect.
Operations¶
mathExt.ilogb (mathExt::IlogbOp)¶
An exponent components of a floating-point number
Syntax:
operation ::= `mathExt.ilogb` $operand (`fastmath` `` $fastmath^)?
attr-dict `:` type($result)
ilogb(x) := floor(log2(abs(x)))
The ilogb operation takes one operand of floating point type (i.e.,
scalar, tensor or vector) and returns one result of the same type. It has no
standard attributes.
Traits: AlwaysSpeculatableImplTrait, Elementwise, SameOperandsAndResultType, Scalarizable, Tensorizable, Vectorizable
Interfaces: ArithFastMathInterface, ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface), VectorUnrollOpInterface
Effects: MemoryEffects::Effect{}
Attributes¶
| Attribute | MLIR Type | Description |
|---|---|---|
fastmath | ::mlir::arith::FastMathFlagsAttr | Floating point fast math flags{{% markdown %}}Enum cases: * none (`none`) * reassoc (`reassoc`) * nnan (`nnan`) * ninf (`ninf`) * nsz (`nsz`) * arcp (`arcp`) * contract (`contract`) * afn (`afn`) * fast (`fast`){{% /markdown %}} |
Operands¶
Operand |
Description |
|---|---|
|
floating-point-like |
Results¶
Result |
Description |
|---|---|
|
floating-point-like |
mathExt.ldep (mathExt::LdexpOp)¶
A fractional components of a floating-point number
Syntax:
operation ::= `mathExt.ldep` $lhs `,` $rhs (`fastmath` `` $fastmath^)?
attr-dict `:` type($result)
ldep(x) = x * (ilogb(x) + 1)^(-1)
The ldexp operation takes two operands of floating point type (i.e.,
scalar, tensor or vector) and returns one result of the same type. Operands
must have the same type.
Traits: AlwaysSpeculatableImplTrait, Elementwise, SameOperandsAndResultType, Scalarizable, Tensorizable, Vectorizable
Interfaces: ArithFastMathInterface, ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface), VectorUnrollOpInterface
Effects: MemoryEffects::Effect{}
Attributes¶
| Attribute | MLIR Type | Description |
|---|---|---|
fastmath | ::mlir::arith::FastMathFlagsAttr | Floating point fast math flags{{% markdown %}}Enum cases: * none (`none`) * reassoc (`reassoc`) * nnan (`nnan`) * ninf (`ninf`) * nsz (`nsz`) * arcp (`arcp`) * contract (`contract`) * afn (`afn`) * fast (`fast`){{% /markdown %}} |
Operands¶
Operand |
Description |
|---|---|
|
floating-point-like |
|
floating-point-like |
Results¶
Result |
Description |
|---|---|
|
floating-point-like |
Enums¶
CmpFPredicate¶
allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
Cases¶
Symbol |
Value |
String |
|---|---|---|
AlwaysFalse |
|
false |
OEQ |
|
oeq |
OGT |
|
ogt |
OGE |
|
oge |
OLT |
|
olt |
OLE |
|
ole |
ONE |
|
one |
ORD |
|
ord |
UEQ |
|
ueq |
UGT |
|
ugt |
UGE |
|
uge |
ULT |
|
ult |
ULE |
|
ule |
UNE |
|
une |
UNO |
|
uno |
AlwaysTrue |
|
true |
CmpIPredicate¶
allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Cases¶
Symbol |
Value |
String |
|---|---|---|
eq |
|
eq |
ne |
|
ne |
slt |
|
slt |
sle |
|
sle |
sgt |
|
sgt |
sge |
|
sge |
ult |
|
ult |
ule |
|
ule |
ugt |
|
ugt |
uge |
|
uge |
IntegerOverflowFlags¶
Integer overflow arith flags
Cases¶
Symbol |
Value |
String |
|---|---|---|
none |
|
none |
nsw |
|
nsw |
nuw |
|
nuw |
RoundingMode¶
Floating point rounding mode
Cases¶
Symbol |
Value |
String |
|---|---|---|
to_nearest_even |
|
to_nearest_even |
downward |
|
downward |
upward |
|
upward |
toward_zero |
|
toward_zero |
to_nearest_away |
|
to_nearest_away |
AtomicRMWKind¶
allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
Cases¶
Symbol |
Value |
String |
|---|---|---|
addf |
|
addf |
addi |
|
addi |
assign |
|
assign |
maximumf |
|
maximumf |
maxs |
|
maxs |
maxu |
|
maxu |
minimumf |
|
minimumf |
mins |
|
mins |
minu |
|
minu |
mulf |
|
mulf |
muli |
|
muli |
ori |
|
ori |
andi |
|
andi |
maxnumf |
|
maxnumf |
minnumf |
|
minnumf |
FastMathFlags¶
Floating point fast math flags
Cases¶
Symbol |
Value |
String |
|---|---|---|
none |
|
none |
reassoc |
|
reassoc |
nnan |
|
nnan |
ninf |
|
ninf |
nsz |
|
nsz |
arcp |
|
arcp |
contract |
|
contract |
afn |
|
afn |
fast |
|
fast |