[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}
GCC revision 259524 implemented range check for the vec_splat_{su}{8,16,32}
builtins. However, as a consequence of the implementation, the range check
is not done correctly for the expected vspltis[bhw] instructions. The result
is that we may not get a valid error message if the valid range of the data
is exceeded.
Although the input of the function prototype of vec_splat_{su}{8,16,32} is
const int, the actual data usage range is limited to the data range of 5 bits
signed. We should limit the int_cst.val[0] data to the 5 bit signed data range
without any modification in the input arg0 parameter. However, the sext_hwi
function intercepts the data of TREE_INT_CST_LOW (arg0) as size bits in the
sext_hwi (TREE_INT_CST_LOW (arg0), size) statement. This will cause some of
the excess data to fall within the range of 5 bits signed, so that the correct
diagnostic information cannot be generated, we need to remove the sext_hwi to
ensure that the input data has not been modified.
This patch fix range check for the vec_splat_s[8,16,32] builtins. The argument
must be a 5-bit const int as specified for the vspltis[bhw] instructions.
for gcc/ChangeLog
PR target/88100
* gcc/config/rs6000/rs6000.c (rs6000_gimple_fold_builtin)
<case ALTIVEC_BUILTIN_VSPLTISB, ALTIVEC_BUILTIN_VSPLTISH,
ALTIVEC_BUILTIN_VSPLTISW>: Don't convert the operand before
range checking it.
for gcc/testsuite/ChangeLog
PR target/88100
* gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase.
From-SVN: r269033