Re: [PATCH 1/3] Port to Solaris

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 21, 2011 at 01:06:02PM +0000, Jilles Tjoelker wrote:
>
> What you can do is use PRIdMAX from <inttypes.h>, normally defined as
> "jd". You can then define this to "lld" or "jd" if it is not defined.
> I think this makes the code uglier (just like your change), but oh well.

I agree.  Brian, please update your patch accordingly.

Thanks!

> By the way, I wonder what the advantage of imaxdiv() above separate %
> and / is. Compilers can detect the matching between a % b and a / b and
> do it in one operation, and any use of imaxdiv() trips gcc's
> -Waggregate-return.

It used to generate smaller code with gcc.  If gcc now knows how
to optimise it properly then I guess we can remove imaxdiv.

I just checked and gcc 4.4.5 still generates two divisions without
imaxdiv.  On the other hand gcc doesn't even inline imaxdiv.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux