Skip to content

scalar.divremsi

← scalar dialect

Signed integer quotient and remainder computed from one division. The quotient rounds toward zero, the remainder has the sign of the dividend, the divisor must be nonzero, and the quotient must be representable in the result type.

Operation contract

Property Value
Semantic phase executable
Traits Pure, DistributionTransfer

Signature

Kind Name Type Cardinality Description
Operand lhs integer required —
Operand rhs integer required —
Result quotient integer required —
Result remainder integer required —

Verification constraints

  • SameType(lhs, rhs, quotient, remainder)

Examples

%q, %r = scalar.divremsi %lhs, %rhs : i32