DIVS
Operation
Divides the signed destination by source with truncation toward zero and writes the quotient.
Assembler Syntax
DIVS.{B|W|L|Q}(z) <ea>(e), Rn(d)
DIVS.{B|W|L|Q}(z) Rn(s), Rn(d)
Privilege
Unprivileged
Repeat eligibility
REP eligible; REPcc observes dst
Interprets both selected-width operands as signed integers, divides the destination by the source with truncation toward zero, and writes the quotient. A sub-Q quotient is sign-extended to 64 bits. Division by zero raises DIVIDE_BY_ZERO; the most-negative value divided by minus one raises SIGNED_DIVIDE_OVERFLOW.
Let \(n\) be the selected operand width, \(d\) the signed two's-complement dividend, and \(s\) the signed two's-complement divisor. The quotient and remainder are defined by $\(q = \operatorname{trunc}(d/s), \qquad r = d - qs .\)$ Thus a nonzero remainder has the sign of the dividend. The destination supplies the dividend and receives \(q\).
A zero divisor raises DIVIDE_BY_ZERO; the most-negative value divided by \(-1\) raises SIGNED_DIVIDE_OVERFLOW. No destination is changed.
2.75in
Encodings
DIVS.{B|W|L|Q}(z) <ea>(e), Rn(d)
Format: Instruction format for DIVS.{B|W|L|Q}(z) <ea>(e), Rn(d)
2.75in DIVS.{B|W|L|Q}(z) Rn(s), Rn(d)
Format: Instruction format for DIVS.{B|W|L|Q}(z) Rn(s), Rn(d)