← board

32-bit backends: shr/shl ignored the operand's width in the 64-bit pair path

Root cause

Integer binops promote to 64-bit (tyInt64), so on the 32-bit targets a longint shr runs in the lo:hi PAIR path on the SIGN-EXTENDED value: longint($80000000) shr 9 = -4194304 instead of FPC's 32-bit logical 4194304. shl had the twin defect (longint(1) shl 31 read 2147483648, positive). x86-64 fixed this family long ago (bug-shl-signed-integer-width: zero/sign-extend around the shift by the OPERAND's width); the pair paths never got the mirror.

Fix

In all three pair-shift arms:

Verification

Log