Announcement

Collapse
No announcement yet.

32bit variables on 64bit hardware

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 32bit variables on 64bit hardware

    Hi

    There is the common statement that in order to optimise speed one should use 32bit DWORD variables rather than WORD or BYTE as counters etc.

    In the case of PB9 which generates 32bit code and where one is using a 32 bit Windows on a 64bit CPU hardware system should one be using 32 bit or 64bit variables in order to optimize speed.

    Then there is also the scenario where we have 32bit PB generated code running under 64bit windows on 64 bit hardware

    My question basically is : Is the DWORD variable rule a function of the CPU or the operating system or the PB version.

    Hedley

  • #2
    The optimizaton is a fucntion of the compiler.. stick with 32-bit integers when you have a choice.

    BTW, last time I read it in the help, the signed LONG is preferred over the unsigned DWORD for this purpose. Don't know if that changed in 9x

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Hedley,
      should one be using 32 bit or 64bit variables in order to optimize speed.
      Stick to LONGs. PB uses the FPU to handle 64bit varaiables.

      Paul.

      Comment


      • #4
        > Stick to LONGs. PB uses the FPU to handle 64bit varaiables

        That should read "PB for 32-bit Windows uses the FPU..."

        (Probably PB for 16-bit Windows, too. Not that I do a whole lot of stuff for Win/3 anymore)
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Michael,
          All PB compilers use the FPU for 64 bit numbers, even PB/DOS.

          Paul.

          Comment


          • #6
            the signed LONG is preferred over the unsigned DWORD for this purpose. Don't know if that changed in 9x
            I may help you out on this, it has not changed a bit. And will probably not change unless CPU architecture changes significant.

            See:
            http://www.jose.it-berater.org/smffo...p?topic=2684.0

            Comment


            • #7
              Thanks for the info. Will stay with longs or registers for counters

              Comment

              Working...
              X