473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

fast 64-bit dividend minu remainder calculation

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

May 1 '07 #1
2 1829
<ps****@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
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
May 1 '07 #2
ps****@gmail.com wrote:
>
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.
Easy, if you have a C99 compiler and the long long type. Otherwise
look at your compiler documentation.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

May 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hugo | last post by:
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, XP boots from C and XP 64 boots from D. They both have VS 2005 Beta 2 installed. I have a webapp developed in Win XP (32) which...
0
by: Kathryn Doss | last post by:
<html> <body> <div style="width:100%;height:400px;"> <table style="position:relative;z-index:0;" width="100%" height="100%" border="0" cellpadding="20" cellspacing="0"> <tr> <td...
3
by: garth_rockett | last post by:
We need to process a very large amount of delimited variable length ASCII data in files as large as 3-4 gigs. We need a high performance parser for this and as always, we have no money to buy one....
4
by: Alexis Gallagher | last post by:
(I tried to post this yesterday but I think my ISP ate it. Apologies if this is a double-post.) Is it possible to do very fast string processing in python? My bioinformatics application needs to...
10
by: krunalb | last post by:
Hi, I am trying to shift unsigned long long value by 64 bits and this is what i get #include <stdio.h> int main() { unsigned short shiftby= 64;
2
by: Gernot Frisch | last post by:
Hi, I have some code that scales from an image buffer to the screen buffer (line by line). Assume: int Width; // Width of image (e.g. 32) int zWidth; // Width of screen output (e.g. 192) ...
3
by: Gernot Frisch | last post by:
Hi, I have this code that blends 2 pixels, but it's not really fast. Can someone help me speeding it up? #define GETR(a) (unsigned char)(((((a)>>11)&31)*255)/31) #define GETG(a) (unsigned...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
0
by: Vinod Sadanandan | last post by:
Fast-Start Failover An Overview In Dataguard Environment ============================================================================= This article describes the automatic fast start failover...
1
by: jihad4u | last post by:
assuming i have data for students names,credit hours, totalpoint or qualitypoints. i have trouble with both counting that is total number of students who fall under each category. printing students....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.