tcg: Merge INDEX_op_div2_{i32,i64}

Rename to INDEX_op_divs2 to emphasize signed inputs,
and mirroring INDEX_op_divu2_*.  Document the opcode.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-01-07 16:44:23 -08:00
parent d6cad9c927
commit ee1805b9e6
4 changed files with 20 additions and 14 deletions

View file

@ -297,6 +297,15 @@ Arithmetic
- | *t0* = *t1* % *t2* (unsigned)
| Undefined behavior if division by zero.
* - divs2 *q*, *r*, *nl*, *nh*, *d*
- | *q* = *nh:nl* / *d* (signed)
| *r* = *nh:nl* % *d*
| Undefined behaviour if division by zero, or the double-word
numerator divided by the single-word divisor does not fit
within the single-word quotient. The code generator will
pass *nh* as a simple sign-extension of *nl*, so the only
overflow should be *INT_MIN* / -1.
Logical
-------