Thread: A few questions about 64 bit and Windows...

  1. #1
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204

    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.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    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.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    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.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    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.

  7. #7
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    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!).

  8. #8
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    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.
    Last edited by abachler; 08-28-2008 at 06:53 AM.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    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

  10. #10
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

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