[FFmpeg-devel] [PATCH 3/5] mathops: add [SU]DIVMOD macros

Michael Niedermayer michaelni
Mon Apr 12 16:33:42 CEST 2010

On Sun, Apr 11, 2010 at 11:05:52PM +0100, Mans Rullgard wrote:
> These macros calculate the quotient and remainder of two values. This
> is necessary for adding workarounds for gcc failing to calculate
> quotient and remainder simultaneously on some platforms.

this code pessimization bug should be submitted to the gcc devels and then the
issue number added as comment to the code so it can be removed once gcc
has been fixed instead of becoming another piece of accumulated cruft

that said i suspect that all uses of this macro can be implemenetd more
efficiently by multiplying by the inverse shifting down to get the /
and then doing a multiply and subtract for the %


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100412/bcbb66e7/attachment.pgp>

More information about the ffmpeg-devel mailing list