[PATCH] Fix do_div() for all architectures

Richard Henderson rth@twiddle.net
Thu Jul 10 22:57:00 GMT 2003


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~



More information about the Gcc mailing list