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: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing


On Sat, 31 Jan 2015, Jeff Law wrote:

> The nice thing about wrapping the result inside a convert is the types for the
> inner operations will propagate from the type of the inner operands, which is
> exactly what we want.  We then remove the hack assigning type and instead the
> original type will be used for the outermost convert.

Those inner operands still need converting to unsigned for arithmetic.

> And FWIW, there's no reason to restrict the pattern to just masking off the
> sign bit.  That's what the PR complains about, but we can do considerably
> better here.  That's part of the reason why I put in the iterators -- to
> generalize this to more cases.

Well, we want to move shorten_binary_op and shorten_compare to the new 
mechanism.

-- 
Joseph S. Myers
joseph@codesourcery.com


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