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, middle-end] Transform (and (truncate)) into (truncate (and))


Adam Nemet wrote:
This is to give a chance to the TARGET_MODE_REP_EXTENDED machinery to remove
another truncate as in:

  (set (reg:SI A) (truncate:SI (reg:DI B)))
  (set (reg:SI C) (and:SI (reg:SI A) (const_int 0xfff)))
->
  (set (subreg:DI (reg:SI C)) (and:DI (reg:DI B) (const_int 0xfff)))

Bootstrapped and regtested on {mips64octeon,x86_64}-linux and regtested on
mipsisa64r2-elf.  No assembly change in gcc.c-torture/execute for x86_64.

OK after the bug-fix patch from yesterday?

Adam


* simplify-rtx.c (simplify_binary_operation_1) <AND>: Transform (and (truncate)) into (truncate (and)).

testsuite/
* gcc.target/mips/truncate-5.c: New test.
OK
Jeff


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