This is the mail archive of the gcc-patches@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]

[PATCH] gen_lowpart_no_emit RTL hook


This is another patch to prepare moving transformations from
combine.c to simplify-rtx.c.  gen_lowpart can emit instructions via
copy_to_reg or force_reg, and thus simplify-rtx.c must resort to either
gen_lowpart_common or gen_lowpart_SUBREG.

However, combine.c defines a version of gen_lowpart that is more
aggressive in generating possibly invalid rtx, but will not generate new
pseudos. When transformations are moved to simplify-rtx.c, it is valid to use this version of gen_lowpart.


So, this patch turns this ``common'' (it occurs 3 times) pattern found in simplify-rtx.c, into a different RTL hook:

      rtx x = gen_lowpart_common (mode, op0);
      if (x)
        return x;
      if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
        return gen_lowpart_SUBREG (mode, op0);
      return op0;

This patch introduces no difference in behavior. Subsequent patches
will involve:
- using gen_lowpart_for_combine as combine's gen_lowpart_no_emit hook
- investigating using lowpart_subreg instead of gen_lowpart_SUBREG.
- investigating merging gen_lowpart_if_possible with the generic implementation of the hook


Bootstrapped/regtested powerpc-apple-darwin7.8.0, ok for mainline?

Paolo


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