FAILURE MAP
← Case archive

FA-89564 / Instruction set emulation / Member archive

srai shifts in zeros · case 04

Arithmetic right shift of a negative value produces a large positive value.

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

Input [prog]: [op, rd, a, b] with ops addi (x[a]+b), add, sub, lui (b<<12), slt (signed), sltu (unsigned), sltiu (x[a] < b sign-extended then taken unsigned), srai, srli, slli (shift amount b & 31). Registers x0..x31 start at 0 and hold unsigned 32-bit values; x0 always reads 0 and writes to it are discarded. Return sorted [index, value] of nonzero registers.

Why this case matters

Every RISC emulator implements a register file with a zero register and 32-bit wrapping arithmetic on a host with unbounded integers.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
arithmetic and logical right shift[[1, 4294967216], [2, 1073741804], [3, 15], [4, 2147483608]][[1, 4294967216], [2, 4294967276], [3, 15], [4, 4294967256]]Failed

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 ↗