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, i386]: Fix PR 91385, Zero-extended negation is not generated


On Wed, Aug 07, 2019 at 08:37:52PM +0200, Uros Bizjak wrote:
> It looks that combine lost some of its unwanted creativity. Added
> testcase will keep it that way.

Huh, I wonder why it ever did that :-)  Strange.

> -;; Combine is quite creative about this pattern.
>  (define_insn "*negsi2_1_zext"
>    [(set (match_operand:DI 0 "register_operand" "=r")
> -	(lshiftrt:DI
> -	  (neg:DI (ashift:DI (match_operand:DI 1 "register_operand" "0")
> -			     (const_int 32)))
> -	(const_int 32)))
> +	(zero_extend:DI
> +	  (neg:SI (match_operand:SI 1 "register_operand" "0"))))
>     (clobber (reg:CC FLAGS_REG))]

Thanks for adding a testcase!


Segher


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