64-bit

BlitzMax Forums/BlitzMax Programming/64-bit

JoshK(Posted 2009) [#1]
Is it possible to use more than 4 gigs RAM in BMX? If not, is it at all possible to compile it in 64-bit mode?


beanage(Posted 2009) [#2]
Wanna do that too. How?


ImaginaryHuman(Posted 2009) [#3]
I believe the compiler is currently only 32-bit, unless someone knows different.


Grisu(Posted 2009) [#4]
I doubt this is possible atm...


xlsior(Posted 2009) [#5]
32-bit only at this point -- and thinking about what goes on in the background, personally I would not expect 64 bit executables to happen anytime soon... There are a lot of things in Blitzmax that currently assume 32-bit, such as integer handles and pointers that are used throughout that are all 32-bit datatypes in the current incarnation.

Even if you could magically change that all over to a 64-bit datatype at compile time to be able to deal with addresses >4GB, I could imagine it breaking all kinds of unrelated things because bit shifts (SHL / SHR) would behave differently all of a sudden: instead of bits getting discarded once shifted beyond the 32-bit range all of a sudden they would remain in scope leading to larger-than-expected variable contents with all the unexpected results that could come from that...

Now, I'd love to see 64-bit exe generation myself as well, but I'd think that there is a LOT more to it than simply flipping a "64-bit, please!" switch in the compiler.


BlitzSupport(Posted 2009) [#6]
Not by default, but on Windows you can apparently do some hackery (possibly in a C import)...

http://msdn.microsoft.com/en-us/library/bb147385(VS.85).aspx

http://lists.zerezo.com/mingw-users/msg00330.html


JoshK(Posted 2009) [#7]
Theoretically, if a good amount of money was invested, how hard would this be to do?


FlameDuck(Posted 2009) [#8]
Theoretically, if a good amount of money was invested, how hard would this be to do?
Depends largely on the compiler design. Since BlitzMAX mostly uses GNU tools, it would probably not be too much of a hassle to make BCC 64-bit aware. However I don't think a 64-bit version of MinGW exists, so for Windows uses it would be largely pointless.


xlsior(Posted 2009) [#9]
However I don't think a 64-bit version of MinGW exists, so for Windows uses it would be largely pointless


It appears that there might be?
http://sourceforge.net/projects/mingw-w64

Hm... It certainly would be interesting if we could make 64-bit exes. :-?

Actually -- come to think of it, it's also been mentioned in the past that a change on the backend to use the Microsoft Visual C++ Express toolchain wasn't necessarily out of the real of possibilities either. If that's indeed true, than it would open up another potential road for 64-bit exes since the MS toolchain is capable of creating those.


ImaginaryHuman(Posted 2009) [#10]
What are the benefits?


GaryV(Posted 2009) [#11]
What are the benefits?


Not having your app/game having to run under emulation on 64bit Operating Systems.


Azathoth(Posted 2009) [#12]
What are the benefits?
Native 64 bit ints, the ability to access more than 4GB of memory.


xlsior(Posted 2009) [#13]
And what GaryV said: No emulation.

Under 64-bit windows, all 32-bit applications run through an emulation layer WOW64 (Windows-on-windows).

It runs at near-native speeds, but there's still some overhead in running it vs. a native 64-bit exe, so they are slightly slower than running the same program on 32-bit windows.


JoshK(Posted 2009) [#14]
The only reason I care is a prospective client is doing some kind of massive data management and was asking about this.


Flemmonk(Posted 2009) [#15]
They would be better off learning C


Winni(Posted 2009) [#16]

They would be better off learning C



Or Python. Or C#. Or maybe even that coffee language. They all have 64-Bit implementations. Unfortunately, Mark Sibly posted many months ago that there won't be a 64-Bit version of BlitzMax.


GaryV(Posted 2009) [#17]
Unfortunately, Mark Sibly posted many months ago that there won't be a 64-Bit version of BlitzMax.


If that is true, keep in mind that 7 was supposed to be 64 bit only and MS changed it early on and said the next OS would be 64bit only.

If the next OS appears as fast as 7 did after Vista, you are looking at a very short lifespan for BlitzMax made products unless running under emulation makes you happy.

IMHO, it has gotten to the point where right now, developers should be releasing 32 bit and 64 bit versions of their software.


beanage(Posted 2009) [#18]
Indeed.


JoshK(Posted 2009) [#19]
There are things that are important and things that are hype. 64-bit support, for most applications, is hype. I only care because I was asked by someone who needs it for something special.


Brucey(Posted 2009) [#20]
Well, it would be nice to be able to access the 64 gig of available RAM on our server...

BlitzMax default file utilities also have issues with large-file support, which is an issue when you want to read 32gig files... fortunately, being modular, one just implements ones own 64-bit file support.


GaryV(Posted 2009) [#21]
I have mentioned it before, Brucey is working on a 64 bit compiler addon. There are only a couple of us testing it so far. It is still buggy, but it is very promising.

64-bit support, for most applications, is hype.


Not really. You have to search hard to find a 32 bit processor still being sold. Manufacturers are increasingly installing 64 bit versions of the OS on new machines. The need for legacy software will be disappearing sooner than later. It will go just as quickly as 16 bit software did.


ImaginaryHuman(Posted 2009) [#22]
Okay so who here currently has a need for a 64-bit native integer, or to use more than 4 gigs of ram? Probably almost no-one. I don't think these things are particular useful for us folks, for the most part. I would be quite happy if Mac Linux and Windows were all running native 64-bit stuff, from a cleanness point of view, but I don't see how it's such a major thing.


GaryV(Posted 2009) [#23]
Okay so who here currently has a need for a 64-bit native integer, or to use more than 4 gigs of ram? Probably almost no-on


Right now, what you write in BMax has to run under emulation on 64 bit systems. Why would actually supporting 64 bit versions of Windows (which are in wide use) be a bad thing?


xlsior(Posted 2009) [#24]
I agree, 64-bit support would be very welcome... But more than likely it's a monumental task to implement, since there is so much code that just assumes 32-bit at this point.


beanage(Posted 2009) [#25]
I would have use for this extending my ib renderer.


xlsior(Posted 2009) [#26]
Anyway, here's the official word as of three months ago:

http://www.blitzbasic.com/Community/posts.php?topic=83917#947706

There are no plans for a 'native' 64 bit version as it would be a massive mission compiler wise...