This is the mail archive of the
mailing list for the GCC project.
r242151 - in /branches/ARM/sve-branch/gcc: rtl....
- From: rsandifo at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Fri, 11 Nov 2016 17:08:53 -0000
- Subject: r242151 - in /branches/ARM/sve-branch/gcc: rtl....
Date: Fri Nov 11 17:08:53 2016
New Revision: 242151
Use scalar_int_mode in simplify_const_unary_operation
The main scalar integer block in simplify_const_unary_operation
had the condition:
if (CONST_SCALAR_INT_P (op) && width > 0)
where "width > 0" was a roundabout way of testing != VOIDmode.
This patch replaces it with a check for a scalar_int_mode instead.
It also uses the number of bits in the input rather than the output
mode to determine the result of a "count ... bits in zero" operation.
(At the momemnt these modes have to be the same, but it still seems
conceptually wrong to use the number of bits in the output mode.)
The handling of float->integer ops also checked "width > 0",
but this was redundant with the earlier check for MODE_INT.
These changes require the rtl wi:: routines to take machine_mode_enums,
to avoid an ambiguity when using scalar_int_modes instead of
machine_modes. The problem is that machine_mode_enum (like all enums)
can be implicitly converted to an integer, and so the mode classes can
indirectly be converted to an integer too. (And this is useful when
modes are used as array indices, for example.) So when scalar_int_mode
was used, the non-rtl wi:: candidates that take integer precisions
instead of modes had the same rank as the machine_mode ones.