Recent

Author Topic: [SOLVED] How do Int64's work on 32-bit architectures?  (Read 5838 times)

Gizmo

  • Hero Member
  • *****
  • Posts: 831
[SOLVED] How do Int64's work on 32-bit architectures?
« on: October 02, 2015, 01:00:22 am »
When using 32-bit Lazarus and FPC on a 32-bit computer, when you declare an Int64, how is it able to use it? And how is the subsequent 32-bit program able to compute those Int64 integers on the 32-bit computers?

I only ask because I use Int64 a lot, to hold large byte count values and the like. They always work fine on 32-bit systems, and its only just occured to me to ask how?
« Last Edit: October 05, 2015, 12:17:15 am by Gizmo »

derek.john.evans

  • Guest
Re: How do Int64's work on 32-bit architectures?
« Reply #1 on: October 02, 2015, 01:09:36 am »
Same way it has alway been done. Using multiple 32bit calculations.

The 64bit FPC would use the available 64bit processor commands.



BeniBela

  • Hero Member
  • *****
  • Posts: 922
    • homepage
Re: How do Int64's work on 32-bit architectures?
« Reply #2 on: October 02, 2015, 05:12:35 pm »
slowly...

v.denis

  • Guest
Re: How do Int64's work on 32-bit architectures?
« Reply #3 on: October 02, 2015, 09:32:40 pm »
For example when doing addition on 32-bit machine, first add lower parts (and keep overflow bit), then add higher parts (using overflow bit).

Check these:
http://stackoverflow.com/questions/1652654/adding-64-bit-numbers-using-32-bit-arithmetic
http://stackoverflow.com/questions/23038451/how-does-a-32-bit-processor-support-64-bit-integers
« Last Edit: October 02, 2015, 09:35:23 pm by v.denis »

 

TinyPortal © 2005-2018