Re: redundant divmodsi4 not optimized away

2010-04-28 Thread Greg McGary
On 04/28/10 05:58, Michael Matz wrote: On Tue, 27 Apr 2010, Greg McGary wrote: (define_insn "*udivmodsi4_libcall" [(set (reg:SI 4) (udiv:SI (reg:SI 1) (reg:SI 2))) (set (reg:SI 1) (umod:SI (reg:SI 1) (reg:SI 2))) (clobber (reg:SI 2)) (clobber (re

Re: redundant divmodsi4 not optimized away

2010-04-28 Thread Michael Matz
Hi, On Tue, 27 Apr 2010, Greg McGary wrote: > (define_insn "*udivmodsi4_libcall" > [(set (reg:SI 4) > (udiv:SI (reg:SI 1) > (reg:SI 2))) >(set (reg:SI 1) > (umod:SI (reg:SI 1) > (reg:SI 2))) >(clobber (reg:SI 2)) >(clobber (reg:SI 3)) >(clobber (reg:CC

Re: redundant divmodsi4 not optimized away

2010-04-27 Thread Greg McGary
On 04/26/10 22:09, Ian Lance Taylor wrote: Greg McGary writes: I have a port without div or mod machine instructions. I wrote divmodsi4 patterns that do the libcall directly, hoping that GCC would recognize the opportunity to use a single divmodsi4 to compute both quotient and remainder

Re: redundant divmodsi4 not optimized away

2010-04-26 Thread Ian Lance Taylor
Greg McGary writes: > I have a port without div or mod machine instructions. I wrote > divmodsi4 patterns that do the libcall directly, hoping that GCC would > recognize the opportunity to use a single divmodsi4 to compute both > quotient and remainder. Alas, GCC calls divmodsi4 tw

redundant divmodsi4 not optimized away

2010-04-26 Thread Greg McGary
I have a port without div or mod machine instructions. I wrote divmodsi4 patterns that do the libcall directly, hoping that GCC would recognize the opportunity to use a single divmodsi4 to compute both quotient and remainder. Alas, GCC calls divmodsi4 twice with the same divisor and dividend

RE: divmodsi4

2008-10-16 Thread Dave Korn
quotient is used > afterwards. Below is the src code and the corresponding basic block. > > I suspect that a workaround will be to look not only for the presence > of the REG_UNUSED note, but check check the reg's mode as well, to > successfully determine whether the quotien

Re: divmodsi4

2008-10-13 Thread Omar Torres
rrent ] [31]))) >>> (set (reg:SI 5 %iph [34]) >>> (mod:SI (reg:SI 1 %r3 [30]) >>> (reg:SI 5 %iph [orig:31 current ] [31]))) >>> ]) 56 {*divmodsi4} (insn_list:REG_DEP_TRUE 10 >>> (insn_list:REG_DEP_TRUE 11 (nil))) >

RE: divmodsi4

2008-10-10 Thread Dave Korn
rallel [ >> (set (reg:SI 1 %r3 [33]) >> (div:SI (reg:SI 1 %r3 [30]) >> (reg:SI 5 %iph [orig:31 current ] [31]))) >> (set (reg:SI 5 %iph [34]) >> (mod:SI (reg:SI 1 %r3 [30]) >>

Re: divmodsi4

2008-10-10 Thread Ian Lance Taylor
(div:SI (reg:SI 1 %r3 [30]) > (reg:SI 5 %iph [orig:31 current ] [31]))) > (set (reg:SI 5 %iph [34]) > (mod:SI (reg:SI 1 %r3 [30]) > (reg:SI 5 %iph [orig:31 current ] [31]))) > ]) 56 {*divmodsi4} (insn_list:

divmodsi4

2008-10-09 Thread Omar Torres
Hi All, I am having trouble distinguishing div vs mod while implementing the divmodsi4 instruction. The gccint documentation states: "If an instruction that just produces a quotient or just a remainder exists and is more efficient than the instruction that produces both, write the output ro