Results 1 to 5 of 5

Thread: 32bit Vs. 64bit

  1. #1

    32bit Vs. 64bit

    Recently I've discovered that my laptop is 64bit so I decided to change the OS (and move from Ubuntu to Fedora) and I having some problems. For example, Allegro.pas 4 have a problem with sound that makes it raises SIGSEGV faults and I can't see how to fix it (actually I didn't look too dept ). A lot of time ago I did read threads in several forums discussing about to install a 64bit OS or keep it in 32bit, and also I've read about some issues of Free Pascal and its 64bit support. I never understood why it should be a problem since moving from 16bit to 32bit wasn't too problematic (moving from 8bit to 16bit was a bit of pain though ).

    Now I'm a bit frustrated and I'm tempted to remove it and back to the 32bit which worked almost perfectly. (Actually I do want to back to the good old 8bit systems... ). I still have a 32bit system (an "old" IBM) but lately I use the laptop as my main system.

    What do you recommend? Go back to 32bit or strike with 64bit until it works? Do you know about problems with Free Pascal and 64bit systems?
    No signature provided yet.

  2. #2
    There are many performance advantages going for 64-bit which are too often overlooked. For instance, you have many more CPU registers so the compiler can optimize the code better and floating-point operations typically use SSE instead of FPU, which also gives more registers and is faster.

    As for porting to 64-bit, you need to adjust the code to take increased pointer size into consideration. Note that the integer size may not necessarily change since typical OSes are either LLP64 or LP64 as opposed to ILP64 as one may expect; this might be weird at first especially if you recall the move from 16-bit to 32-bit OS.

    In my opinion, as long as your CPU supports it, 64-bit is the way to go. On all my systems including ones in the office we use 64-bit OS exclusively and most applications we use have been ported to 64-bit too. For instance, Asphyre has been ported to 64-bit almost a year ago both for Delphi and FPC. I don't think you'll have much trouble porting Allegro too.

  3. #3
    I only use 64 bit Linux systems. I had almost no problems with FPC except with Allegro.pas and SDL. The SDL part (getpixel) was solved of course, which was discussed on Freepascal-meets-SDL: http://332959.forumromanum.com/membe...meets_sdl.html
    Best regards,
    Cybermonkey

  4. #4
    Quote Originally Posted by Lifepower View Post
    There are many performance advantages going for 64-bit which are too often overlooked. (...)

    In my opinion, as long as your CPU supports it, 64-bit is the way to go. On all my systems including ones in the office we use 64-bit OS exclusively and most applications we use have been ported to 64-bit too. For instance, Asphyre has been ported to 64-bit almost a year ago both for Delphi and FPC. I don't think you'll have much trouble porting Allegro too.
    Actually I don't know if problem is Allegro or Allegro.pas. As I've said I didn't look to deep. I don't know why I can't compile Allegro by myself so I haven't a debuggable version to test properly.

    Anyway, what are the most common problems related with 32bit->64bit porting? Is there a gide somewhere? I've found some docs at the Free Pascal's wiki but nothing specific.

    Quote Originally Posted by Cybermonkey View Post
    I only use 64 bit Linux systems. I had almost no problems with FPC except with Allegro.pas and SDL. The SDL part (getpixel) was solved of course, which was discussed on Freepascal-meets-SDL: http://332959.forumromanum.com/membe...meets_sdl.html
    Had you? So I should work on it.

    Anyway I should ask to the Allegro's development team about what does changes between 32bit and 64bit...
    No signature provided yet.

  5. #5
    Quote Originally Posted by Ñuño Martínez View Post
    Anyway, what are the most common problems related with 32bit->64bit porting? Is there a gide somewhere? I've found some docs at the Free Pascal's wiki but nothing specific.
    Typically, you should look for code that works with pointers (e.g. calculating pixel address directly), especially if using Pointer <-> Integer typecasts, which should be changed to PtrInt / PtrUInt instead. When accessing external APIs, make sure that pointers and other data types are not mixed (e.g. if function requests pointer, don't declare it as integer and vice-versa). Other than that, LLP64 and LP64 models are meant to simplify porting applications to 64-bit, so if you don't rely heavily on pointers, your code should supposedly work out of the box.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •