modulus and remainder

"Matthew J. Lockner" <>
28 Jun 2001 23:51:56 -0400

          From comp.compilers

Related articles
modulus and remainder (Matthew J. Lockner) (2001-06-28)
Re: modulus and remainder (2001-07-01)
Re: modulus and remainder (Joachim Durchholz) (2001-07-01)
| List of all articles for this month |

From: "Matthew J. Lockner" <>
Newsgroups: comp.compilers
Date: 28 Jun 2001 23:51:56 -0400
Organization: University of Northern Iowa
Keywords: arithmetic, question
Posted-Date: 28 Jun 2001 23:51:56 EDT

Hello all,

Does anyone know of a thorough reference on compiling modulus and remainder
operators in expressions? I was looking at the output of gcc on some small
test C functions to get some insights. Sometimes it uses a divide
instruction, and uses the remainder left in a register by the instruction.
That seems like an obvious approach, but it doesn't always use that
technique. I would like to see some of the theory behind this and other
approaches. Ideally I would also like to see how translating modulus
operations differs from translating remainder operations, where each
operator is defined as it would be in Ada, for example (i.e., where the two
operations might yield different results).

M. Lockner

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.