Horde3D

Next-Generation Graphics Engine
It is currently 14.05.2024, 21:08

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 26.08.2008, 09:17 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
Hello guys 8)

I have a little question : What is 64bit programming benefits that 32bit don't provides ?

Already multicore and 64bit CPUs are regular and you can find them in every office and house (else my house, I have PIII 750 and Radeon7000; I will buy something like that about next 2 month).
Does 64bit programming provide a big performance and quality increase in game development :?:

PLEASE DISCUSS YOUR OPINIONS AND EXPERIENCES


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 14:13 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
64bit has exactly one benefit for the programmer - it allows you to address more than 4 gigabytes of memory (3GB on 32bit Windows). If you are working on huge datasets, this is great, but otherwise there is no real need to switch. Current consumer level 64-bit processors run 32-bit code just fine.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 14:53 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
swiftcoder wrote:
64bit has exactly one benefit for the programmer - it allows you to address more than 4 gigabytes of memory (3GB on 32bit Windows). If you are working on huge datasets, this is great, but otherwise there is no real need to switch. Current consumer level 64-bit processors run 32-bit code just fine.


Later I have seen some where (I think wikipedia about HL2) that 64bit version of Half-Life 2 has been improved the game performance and fps efficiently :|


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 16:23 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
64-bit processors are typically faster than 32-bit processors, and 64-bit code may run very slightly faster than 32-bit code, when running on a 64-bit processor. More often, 64-bit builds take advantage of the increased number of registers available on x64, which can help out a lot. They may also be optimised for the larger caches typically present on newer processors.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 18:03 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
swiftcoder wrote:
64-bit processors are typically faster than 32-bit processors, and 64-bit code may run very slightly faster than 32-bit code, when running on a 64-bit processor. More often, 64-bit builds take advantage of the increased number of registers available on x64, which can help out a lot. They may also be optimised for the larger caches typically present on newer processors.


Is it necessary to change any code pieces or just configuring compiler build options for 64bit platform will be enough :?:


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 19:19 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
Some types will be different... if I mind right, ints are really the only ones affected but you'll need to be careful with this.

Best example I can give is Sol's SDL Tutorials has a blend tutorial that is hard-coded to 32bit int boundaries.. if you try and compile the same code with a 64bit compiler, it just plain doesn't work at best, segfaults nastily otherwise. To fix it, you can use a compiler specific pre-processor command ( read: nasty hack ) to force it back to 32bit int calculations, or re-do it for longs ( which are 64-bit ints on both 32/64 bit systems ) or do a check on execution whether it's 32bit or 64bit and handle the change accordingly.

But generally, unless you're doing something very next-gen, some sort of advanced simulation of something, or a device driver ( in which case you're in the wrong place ;)) I'd honestly not bother with 64bit binaries as 32bit works fine for the moment.

As for the wikipedia article on HL2 being "better" in 64bit.. I looked it up and it basically says there's widely varying reports of it being better, or being much much worse and buggier.. as there are two 64bit architectures for the PC - IA64 and AMD64 - the split between them may be greater than just the standard Intel x86 and AMD x86 processors, so you've that to watch out for too.


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 19:43 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
I'd like to have 64bit though, as a lot of linux users already use it, like me. :)

Actually the only thing you have to take care of is some good coding style: Use pointer variables where you store pointers, do not store pointers in ints.

At least on Linux amd64 there's nothing more because int is still 32 bits long :)


Top
 Profile  
Reply with quote  
PostPosted: 26.08.2008, 20:42 
Offline

Joined: 22.05.2008, 18:30
Posts: 37
I use 64bit Linux too.. and I also used 64bit Linux when you basically had to set up "32bit chroot jails" to get any 32bit stuff to work at all ;) programming for both 32bit and 64bit was fun in them days, hehe

You do sometimes need to use int pointers though.. in regards to the blend tutorial I was talking about, SDL's surfaces are pointers to unsigned ints .. so directly messing with them - as that tutorial does for it's blending - requires accessing said pointer which does change depending on whether you're on 32bit or 64bit. It all basically comes down to how you program really, be it banging the hardware directly, where int pointers are something you may actually come across now and then, or hiding behind an API and letting it do everything ( and hoping it behaves itself and does type-checking for 32/64 bit )


Top
 Profile  
Reply with quote  
PostPosted: 27.08.2008, 01:19 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
stuckie wrote:
You do sometimes need to use int pointers though.. in regards to the blend tutorial I was talking about, SDL's surfaces are pointers to unsigned ints .. so directly messing with them - as that tutorial does for it's blending - requires accessing said pointer which does change depending on whether you're on 32bit or 64bit.
This is the real problem with moving to 64-bit. *EVERY* API you use must also be 64-bit. Interfacing to 32-bit libraries from 64-bit code may work under limited environments, but it doesn't work dependably or cross-platform. Since the majority of libraries are yet to be ported to 64-bit, you end up only using 64-bit if you need the massive amounts of RAM.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 27.08.2008, 12:52 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
Quote:
*EVERY* API you use must also be 64-bit.

And on linux most are. I currently don't know a single example which does not work. (Blender used to corrupt files on 64 bits, but that has fixed quite some times ago)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group