FAILURE MAP
← Case archive

FA-89482 / Instruction set emulation / Member archive

Signed remainder takes the divisor sign · case 02

rem of a negative dividend by a positive divisor returns a positive remainder.

Member previewVariant 2 · 3 implementations · 11 checks per implementation

Case contract

Input [op, a, b] with a, b as unsigned 32-bit register values. div/rem interpret them as signed; quotient truncates toward zero and the remainder takes the dividend's sign; division by zero gives quotient all ones (0xFFFFFFFF) and remainder = dividend; the overflow case -2^31 / -1 gives -2^31 with remainder 0. divu/remu are unsigned; divu by zero gives 0xFFFFFFFF and remu by zero gives the dividend. Results are returned as unsigned 32-bit values.

Why this case matters

ISA emulators must reproduce defined results for division corner cases that host languages treat differently or trap on.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
signed remainder sign follows dividend14294967295Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗