On 7/15/19 9:30 AM, Richard Sandiford wrote: > Richard Sandiford <richard.sandif...@arm.com> writes: >> This patch extends the tree-level folding of variable-length vectors >> so that it can also be used on rtxes. The first step is to move >> the tree_vector_builder new_unary/binary_operator routines to the >> parent vector_builder class (which in turn means adding a new >> template parameter). The second step is to make simplify-rtx.c >> use a direct rtx analogue of the VECTOR_CST handling in fold-const.c. >> >> Tested on aarch64-linux-gnu, aarch64_be-elf and x86_64-linux-gnu. >> OK to install? >> >> Richard > > Here's a version updated for the earlier patch, so that we take > both HONOR_NANS and HONOR_SNANS into account. Tested on > aarch64-linux-gnu to far. > > Thanks, > Richard > > > 2019-07-15 Richard Sandiford <richard.sandif...@arm.com> > > gcc/ > * rtl.h (bit_and_conditions, bit_ior_conditions): Declare. > * jump.c (flags_to_condition): Add an honor_nans_p argument. > (bit_ior_conditions, bit_and_conditions): New functions. > * simplify-rtx.c (simplify_binary_operation_1): Try to fold an > AND or IOR of two comparisons into a single comparison. > (simplify_ternary_operation): Try to fold an if_then_else involving > two conditions into an AND of two conditions. > (test_merged_comparisons): New function. > (simplify_rtx_c_tests): Call it. This is fine once the prereqs are approved.
jeff