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
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
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
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
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
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
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)))
>
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])
>>
(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:
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
10 matches
Mail list logo