fast 64-bit dividend minu remainder calculation

P

pshemu

hi,

is there a way to fast calculate x-x%y (greatest multiplication of y
before x), where x and y are 64-bit integers on a 32-bit machine??
Maybe MMX registers would be useful?? I am writing this with gcc and
gas. Any help would be appreciated and thanks in advance.

Best regards,

Przemek
 
P

P.J. Plauger

is there a way to fast calculate x-x%y (greatest multiplication of y
before x), where x and y are 64-bit integers on a 32-bit machine??
Maybe MMX registers would be useful?? I am writing this with gcc and
gas. Any help would be appreciated and thanks in advance.

If you have long long support, I think (x / y) * y gives you what you want.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top