Part of splitting the std dialect.
int dialect is intended to contain basic integer operations (e.g. register-to-register ops on widely available hardware). The
int dialect is to have
builtin as its only dependency. The primary smoke test of adding ops into the
int dialect is that they cannot introduce any dependencies and that they must operate only on integer types.
Ops excluded from the
int dialect would be:
uitofpbecause they introduce floating point types
Ops included in the dialect include:
- Arithmetic ops, e.g.
- Bitwise and shift ops, e.g.
index_castbecause it converts between integer types
std.addi -> int.add std.subi -> int.sub std.muli -> int.mul std.divi_unsigned -> int.div.unsigned std.divi_signed -> int.div.signed std.ceildivi_signed -> int.ceil_div.signed std.floordivi_signed -> int.floor_div.signed std.remi_unsigned -> int.rem.unsigned std.remi_signed -> int.rem.signed std.and -> int.and std.or -> int.or std.xor -> int.xor std.cmpi -> int.cmp std.shift_left -> int.shift_left std.shift_right_signed -> int.shift_right.signed std.shift_right_unsigned -> int.shift_right.unsigned std.zexti -> int.zext std.sexti -> int.sext std.trunci -> int.trunc std.index_cast -> int.index_cast
float dialect is intended to contain basic floating-point operations. The
float dialect will have only
builtin as a dependency. Ops in
float will operate primarily on floating point types but may accept or return integer arguments. Transcendental functions or functions expressed in terms of approximate real arithmetic belong elsewhere.
Ops excluded from
float would be:
- Trigonometric functions and roots
Ops included in
float would be:
- Cast operations, including
- Basic arithmetic operations: e.g.
std.addf -> float.add std.subf -> float.sub std.mulf -> float.mul std.fmaf -> float.fma std.divf -> float.div std.remf -> float.rem std.ceilf -> float.ceil std.floorf -> float.floor std.cmpf -> float.cmp std.copysign -> float.copysign std.fpext -> float.ext std.fptrunc -> float.trunc std.negf -> float.neg std.absf -> float.abs std.uitofp -> float.from_ui std.sitofp -> float.from_si std.fptosi -> float.to_ui std.fptoui -> float.to_si std.bitcast -> float.bitcast
The dialects will be created one at a time, with the
int dialect first, to test the waters for how complex the migration will be. The
int dialect will be created in two patches to help the review process: one that focuses on the design of the dialect, and one that deals with the details of migrating the code base over. Both patches will be pushed atomically, so that the redundancy created by the first patch will not exist beyond it.
The same process will be repeated for the