When to use ADOX instead of ADCX?

The only difference mentioned in the reference to the Intel instruction set is the use of the overflow flag instead of the carry flag. When is ADOX used instead of ADCX to perform unsigned ADCX additions?

+5
source share
1 answer

ADOX can be used when you do not want to overwrite the carry flag, for example, you saved something like a rotation.

However, their main use is to speed up big-int arithmetic, because now you can make two additions with parallel mulx in combination with mulx

From Intel document New instructions Support for large integer arithmetic

ADCX / ADOX instructions

The adcx and adox instructions are extensions to the adox instruction, designed to support two separate transfer chains. They are defined as:

 adcx dest/src1, src2 adox dest/src1, src2 

Both teams compute the sum of src1 and src2 plus carry and generate the output sum of dest and execution. The difference between the two instructions is that adcx uses the CF flag to carry and execute (leaving the OF flag unchanged), while the adox command uses the OF flag to carry and execute (leaving the CF flag hasn't changed).

on this topic:

What is the difference between ia32 / ia64 ADC and ADCX instructions?

+8
source

Source: https://habr.com/ru/post/1269718/


All Articles