This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix do_div() for all architectures
- From: Richard Henderson <rth at twiddle dot net>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: Andrea Arcangeli <andrea at suse dot de>, Linus Torvalds <torvalds at osdl dot org>, linux-kernel at vger dot kernel dot org, Peter Chubb <peter at chubb dot wattle dot id dot au>, Andrew Morton <akpm at digeo dot com>, Ian Molton <spyro at f2s dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 10 Jul 2003 15:04:04 -0700
- Subject: Re: [PATCH] Fix do_div() for all architectures
- References: <200307060133.15312.bernie@develer.com> <20030710161859.GP16313@dualathlon.random> <20030710163918.GB18697@twiddle.net> <200307102131.45474.bernie@develer.com>
On Thu, Jul 10, 2003 at 09:31:45PM +0200, Bernardo Innocenti wrote:
> Just to open some interesting speculation, do you think we'd
> get better code by just getting rid of __attribute__((pure))
> or by changing __do_div64() to do something like this?
>
> typedef struct { uint64_t quot, uint32_t rem } __quotrem64;
> __quotrem64 __do_div64(uint64_t div, uint32_t base) __attribute__((const));
No. Most targets require structures be returned in memory.
If people really care beyond the generic, they'll write
special assembly for it.
r~