The "regular" registers in x86 are only 32-bit in size, so you can't use them to add two 64-bit integers (unless you do the addition in multiple steps).
But can you add two 64-bit integers natively using another way, using SSE for example?
The "regular" registers in x86 are only 32-bit in size, so you can't use them to add two 64-bit integers (unless you do the addition in multiple steps).
But can you add two 64-bit integers natively using another way, using SSE for example?
In 32 bit modes, there are four ways to do this:
add
and then an adc
on general purpose registersThe fastest of these for a single 64 bit operation is probably the add
/adc
approach. For multiple operations, SSE2 is going to be the fastest, then MMX (if you can live with the transition penalty and being unable to use the x87 FPU while in MMX state) and lastly x87.
In 64 bit mode (long mode), you can additionally simply do 64 bit arithmetic on 64 bit general purpose registers.
Let me know if you want more details or examples.