For now clang will assume the integer parameters have been sign/zero extended in the caller, which will cause some ABI compatibility issues.
This patch will add -mextend-small-integer which can specify how to handle small integer arguments.
- Adds one new ConservativeExtend Kind, which means we shouldn't make any assumptions about the caller and callee. In this case, we must do zero/sign extension for integer parameters in caller and callee.
- Adds -mextend-small-integer=<arg> option:
- none : Pass the small integer parameter directly in caller.
- conserative: Always extend small integer parameter in the caller but do not assume in the callee that the caller actually did the extension. This is the default value.
- assumed: Assume the small integer parameter has been extened in the caller.
- default: Use the default rule for the target.
Combine like others?