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]

Re: [PATCH] Add reg_truncated_to_mode to rtl_hooks


Adam Nemet wrote:
This patch adds reg_truncated_to_mode to rtl_hooks.  With this we can
now turn TRUNCATEs into SUBREGs in simplify_unary_operation_1.  The
patch is similar to the respective part of Paolo Bonzini's patch from
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00684.html.

Even though I cannot approve it, thank you very much for tackling this.


With these changes we remove seven truncations in
gcc.c-torture/execute.  They all seem to have been unnecessary.

All for the better.


+ /* Suppose that truncation from the machine mode of X to MODE is not a
+ no-op. See if there is anything special about X so that we can
+ assume it already contains a truncated value of MODE. */
+ + bool
+ truncated_to_mode (enum machine_mode mode, rtx x)
+ {
+ return REG_P (x) && rtl_hooks.reg_truncated_to_mode (mode, x);
+ }

This function is very small and will not be inlined. Would you consider inlining it manually into the sole place where it is used?


Thanks,

Paolo


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