The Intel C++ and Fortran compilers support the option -fextend-arguments={32,64}. One of our customers has requested that this support be added clang. This option controls how scalar integral arguments are extended in calls to unprototyped and varargs functions. When we investigated the support for the ICL option, we discovered that "-fextend-arguments=32" had no effect in the generated code, so this patch passes the option into the compiler only for intel64, otherwise the width defaults to 32 bits as usual. This patch is only meaningful for targets that pass int arguments in 64 bits.
For supported targets, signed int values are sign extended to 64 bits in the parameter list, and unsigned int values are zero extended to 64 bits.
@kbsmith1 tells me that this option is primarily useful for porting 32-bit programs to the 64-bit environment, and although that architecture shift happened years ago, the customer is still interested in this support.
It turns out that there is currently similar logic in clang support for the OpenCL option "cl_khr_fp64" which causes certain float arguments, in unprototyped context, to be expanded to float or double.
Will this change be acceptable?
The comments aren't quite right as this matters in functions with prototypes as well (due to variadic arguments). How about "integer arguments are sign or zero extended to 32/64 bits during default argument promotions."?