C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 08-28-2008, 03:11 AM   #1
Not stupid, just stupider
 
yaya's Avatar
 
Join Date: May 2007
Location: Earthland
Posts: 151
Thumbs up A few questions about 64 bit and Windows...

I'm planning to buy a new Windows computer that I can use to run high-end games and also program on. Anyways, my questions are:

If I compile a program on 64 bit, can it still run on 32 bit (what can I do so it will run)?
Do you think it would be worth getting 64 bit now? Is it easy to upgrade if I do get 32 bit?
Is Vista going to eventually get as good/better than XP?

Thanks in advanced.
yaya is offline   Reply With Quote
Old 08-28-2008, 03:34 AM   #2
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Quote:
If I compile a program on 64 bit, can it still run on 32 bit (what can I do so it will run)?
No - the 32-bit OS doesn't know about the extra bits/registers that are available in 64-bit, so it won't work [in fact, the processor itself prevents you from getting into 64-bit mode unless your kernel has enabled it - so it's just not going to happen].

Your other questions are harder to answer. I think that the status of 64-bit drivers is a lot better than it used to be [because drivers integrate with the kernel, they need to be the same as the kernel].

As to Vista and comparison to XP, I haven't even used Vista (for real at least - I booted it a few times on a virtualization system - but I don't think that counts).

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 08-28-2008, 03:56 AM   #3
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
Apps compiled as 64-bit apps won't run in x86 windows. However, you CAN still compile them as 32-bits. They'll run on both x86 and x64.

I really don't see much benefit of 64-bit, except for some more memory that you don't need right now. It's the future, yes, but it's not worth spending a lot of money on IMO. You can't upgrade to 64-bit, you'll have to reinstall Windows. But I can't speak for drivers.

About Vista. I think Vista is actually becoming usable. I've been using it for a while with little problems. No, it's not a great improvement over XP. A lot of it is overhyped. Better can be argued, though. I say it has better tools, nicer interface and features. However, it's more of a resource hog plus there's compatibility problems with some things. If I were asked, is it worth investing in - as in buying, the answer is NO. Is Vista usable - is it something I should get eventually? The answer would be yes, since future Windows are built on Vista's architecture (I'm thinking of Windows 7 here). It should be painless to upgrade from Vista to Windows 7, but not from XP.

That's my thoughts on the whole.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 08-28-2008, 04:21 AM   #4
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Quote:
Originally Posted by Elysia View Post
I really don't see much benefit of 64-bit, except for some more memory that you don't need right now. It's the future, yes, but it's not worth spending a lot of money on IMO. You can't upgrade to 64-bit, you'll have to reinstall Windows. But I can't speak for drivers.
Actually, many applications run faster in 64-bit than 32-bit - particularly if you have many function calls with quite a few parameters, as 64-bit having more registers pass the first 5 or 6 arguments in registers, whilst 32-bit can only use at the most 3 registers for passing arguments. More registers also help the code generation in the functions themselves, as it allows the compiler to keep more data in registers without having to load/store so much. Code on x86-64 is usually about 15% instructions less than the same code compiled for x86-32 (using the same compiler - obviously, different compilers will perform more or less well on a particular piece of code in general). 15% fewer instructions in itself gives a 15% speed improvement, but avoiding potentially lengthy memory operations often give more than that.

However, I have seen people indicate that applications would run twice as fast on 64-bit as they do on 32-bit. This is true for some special cases, but in most cases, those are the same that run 2/4x faster if implemented in MMX/3DNow and SSE respectively - and once that is done, there is little or no benefit from moving to 64-bit.

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 08-28-2008, 04:23 AM   #5
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
Yeah, but I don't really consider there's enough applications or demand for it to be really worth it.
Sure, upgrading to 64-bit is a good idea and should be done, at least for the future. But I'm sticking to 32-bit myself for the time being.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 08-28-2008, 04:25 AM   #6
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Quote:
Originally Posted by Elysia View Post
Yeah, but I don't really consider there's enough applications or demand for it to be really worth it.
Sure, upgrading to 64-bit is a good idea and should be done, at least for the future. But I'm sticking to 32-bit myself for the time being.
Sure.

I also think that MS has done a poor job at promoting/supporting 64-bit - if you take your average Linux distro, it comes in 64-bit, and generally it works just as well if not better than the same 32-bit distro. Windows doesn't seem to be the same case, both when it comes to availability and functional parity.

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 08-28-2008, 05:07 AM   #7
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,139
Of course it should be done in the future, that's really a given.

You just have to make up your mind whether the future is now . I still run 32bit Windows and Linux on my 64bit CPU... mainly because of how small the program base for 64bit was (in the case of Linux) and is for Windows (mainly in the case of drivers).

I researched the performance of 64-bit vs 32-bit, and established that for my purposes, sticking with 32-bit for the time being was worthwhile (performance cost vs benefits of 64-bit) for my use, you may have to think about what you want to do (I also play no part in helping my Linux distro in the sense of package compiling, etc -- perhaps I should!).
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Old 08-28-2008, 06:45 AM   #8
Rampaging 35 Stone Welsh
 
abachler's Avatar
 
Join Date: Apr 2007
Posts: 2,927
What OS you compile on is irrelevant. If you compile the project AS 32 bit then it will run on 32 or 64 bit windows. If you compile it AS 64 bit then it will only run on 64 bit windows. The largest differences between 32 and 64 bit windows are larger and more registers on 64 bit, which lets the compiler further optimize some code, and increased available memory. A 32 bit windows application is limited to 2GB(3GB) of allocated memory. A 64 bit windows application is limited to 9.2 QtB (9.2 billion GB) in theory, although no motherboards curently support that much.

for most applications, 64 bit wil run slightly slower than the same application compiled under 32 bit.

In general MS screwed the pooch for 64 bit by removing support for inline assembly. Many drivers make heavy use of inline assembly particularly the IN and OUT mnemonics. There are macro equivelants, but for many pieces fo hardware, driver performance is critical. Using a 3rd party assembler is certainly possible, but then you are unnecessarily introducing an additional development environment.
__________________
He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet

Last edited by abachler; 08-28-2008 at 06:53 AM.
abachler is offline   Reply With Quote
Old 08-28-2008, 08:07 AM   #9
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
Quote:
although no motherboards curently support that much.
Nor do the CPUs. Current 64-bit CPUs support 40 bits of physical address (1 TB RAM) and 48 bits of virtual address (256 TB addressable space).

64-bit has more advantages over 32-bit than just the added registers. With 64-bit, MS was able to finally get rid of their outdated ABI. 64-bit Windows features a better calling convention (6 arguments are passed in registers now, whereas the x86 stdcall convention passed everything on the stack) and better exception support (table-based vs stack frame marking - this means zero overhead when no exception is actually thrown).
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Old 08-28-2008, 08:49 AM   #10
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,120
When deciding whether to upgrade to Windows x64 you need to do some homework. If you have some older hardware in your system, chances are you'll probably run into driver problems.
When I bought my new PC I spent months researching every component that I put into it and when I installed Vista x64, I had no problems at all.
Well OK, no hardware problems anyways. Some software that use drivers (like VMWare Server, Flash...) still don't have x64 drivers, which is a pain.
cpjust is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OS: To go 64 bit or not to go? foxman Tech Board 24 04-29-2008 03:48 AM
Formatting 64 bit integers Dino C++ Programming 6 02-05-2008 08:24 PM
64 bit testing DrSnuggles C++ Programming 7 11-20-2007 03:20 AM
dual boot Win XP, win 2000 Micko Tech Board 6 05-30-2005 02:55 PM


All times are GMT -6. The time now is 05:14 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22