BBC BASIC
« 32-bit versus 64-bit timing comparison »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 4:45pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: 32-bit versus 64-bit timing comparison  (Read 235 times)
michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 141
xx Re: 32-bit versus 64-bit timing comparison
« Reply #7 on: Dec 14th, 2017, 04:46am »

It would be an asset to have a 64bit version in the works. Even if it is promoted as an experimental version. Never hurts to tinker with an idea.

Compatibility would be not so important, if a person could harness the core aspects were there. (graphics, and basic controls)

A person could build thier own graphics controls from the ground up.

Id say start with a small working package. It can be its own thing too. Its not too hard to learn the differnces.
User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 692
xx Re: 32-bit versus 64-bit timing comparison
« Reply #8 on: Dec 14th, 2017, 7:09pm »

on Dec 14th, 2017, 04:46am, michael wrote:
It would be an asset to have a 64bit version in the works. Even if it is promoted as an experimental version. Never hurts to tinker with an idea.

I've updated bb64.zip which, as discussed, flags that it is a 64-bit edition by setting bit 6 of @platform% (so the least significant byte is now &40).

However please be aware that this change has significantly worsened compatibility, and SDLIDE.bbc will no longer run correctly without modification. I have a patched version here; if anybody wants it uploaded let me know.

Richard.
« Last Edit: Dec 14th, 2017, 10:30pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 692
xx Re: 32-bit versus 64-bit timing comparison
« Reply #9 on: Dec 17th, 2017, 9:41pm »

For those who have downloaded, or expect to download, the 'experimental' 64-bit version of BBC BASIC, these are the main issues you need to be aware of when testing:
  • Although described as a '64-bit version', BBC BASIC is a 32-bit language and pointers (particularly pointers to the heap and stack) remain 32-bits. This means (in this release at least) that the heap and stack must reside in the bottom 4 Gbytes of the address space.

  • The SYS statement has not been modified to be 64-bit compatible, and can currently pass only 32-bit integer parameters to the called function. Passing floating-point values will be a particularly tricky issue to resolve because of the x86-64 ABI, and currently no fully satisfactory solution is known.

  • API calls (e.g. of SDL 2.0 functions) which take a structure as a parameter are very likely to require the layout of the structure to be modified. Typically this will involve changing 32-bit members to 64-bits, and inserting padding members to ensure that any 64-bit members are QWORD aligned.

  • Bit 6 of the @platform% system variable is set by this version, to indicate that it is 64-bits. This may be tested when it is necessary to make code conditional on the 'bitness', for example in order to declare a modified structure layout as above. However please note that this change may itself result in an incompatibility with existing programs.

  • Some 'system variables', notably @hwnd%, @memhdc% and @hfile%() are still 32-bits, even though the values they contain may not be. This has not proved to be an issue in Windows, to date, but almost certainly will be if and when the 64-bit version is ported to other platforms. Solutions to this are bound to introduce more incompatibilities.

  • There is no assembler (or, to be precise, the assembler is for ARM which is no use at all!). This is not going to be acceptable in the long term, but at present there is no known solution for how an assembler will eventually be implemented.

  • The CALL statement and the USR function, which are used to call 'machine code' routines, may not work as expected and certainly will not pass the static integer variables (A%, B% etc.) in a way compatible with their 32-bit cousins. In the absence of an assembler it is unlikely that you will be wanting to use these keywords, but not impossible.

  • Some Interpreter Internal Variables are not at the addresses documented at the Wiki, because they have been moved to accommodate 64-bit values.

  • Several of the current libraries are not 64-bit compatible, these include arraylib, asmlib*, sortlib, socklib, ogllib/gleslib and timerlib.
There are probably other factors that don't immediately come to mind. If you notice any unexpected behaviour that cannot be explained by these differences, please let me know. Happy testing!

Richard.
« Last Edit: Dec 18th, 2017, 11:56am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls