This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r242151 - in /branches/ARM/sve-branch/gcc: rtl....


Author: rsandifo
Date: Fri Nov 11 17:08:53 2016
New Revision: 242151

URL: https://gcc.gnu.org/viewcvs?rev=242151&root=gcc&view=rev
Log:
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.

Modified:
    branches/ARM/sve-branch/gcc/rtl.h
    branches/ARM/sve-branch/gcc/simplify-rtx.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]