On our legacy systems, we provide an “assume clean parameters” option to tell the compiler that the caller sign/zero extended out to the width of the argument slot. If not, the called routine will have to do the extension as needed. We default to “assume clean parameters” on Alpha and Itanium, but should change that to “don’t assume clean parameters” on x86.
On OpenVMS, our ABI on Alpha and Itanium specifies that the caller extend the argument and so far we’ve been riding along on LLVM doing something similar but we’ll have to do OpenVMS-specific changes. For example, we sign-extend 32-bit unsigned parameters (yes, sign extend, not zero extend). It helps legacy programs with mismatched prototypes when then moved from the 32-bit VAX to later 64-bit systems like Alpha and Itanium.