4

I have a question of curiosity.

How is Int64 implemented for 32 bit processors? I can see three options

  1. 32 bit processors have some kind of extension allowing 64 bit arithmetic
  2. Int64 is it implemented entirely in the CLR, which implements 64 bit arithmetics by using 32 bit operations
  3. Some 32 bit processors can do 64 bit arithmetic and CLR use this logic. On other processors CLR falls back to it's own implementation of 64 bit logic.

First scenario doesn't look plausible, because it implies that 64 bit processors now should be capable of doing 128 bit arithmetic. The second raises a question on how it can be done efficiently. The third looks like to unite the worst features of both approaches.

alpha-mouse
  • 4,953
  • 24
  • 36

1 Answers1

6
  • Intel x86 processors like old Pentiums (as an example of 32 bit processor) have been capable of doing 64 bit arithmetic and even 128 bit arithmetic for a long time (XMMM0-XMM7 for instance).
  • 64 bit arithmetic using only 32 bit registries is well documented
  • platform specific implementations of the CLR are free to implement one of the above, or implement something else to satisfy the requirement.
Community
  • 1
  • 1
Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • Topic discussing 64 bit arithmetic on 32 bit registers covers addition only. I was thinking mainly of multiplication and division. – alpha-mouse Nov 20 '10 at 01:26