何时使用ADOX代替ADCX? [英] When to use ADOX instead of ADCX?
问题描述
The only difference mentioned in the Intel instruction set reference is the usage of the overflow-flag instead of the carry-flag. When does one use ADOX
instead of ADCX
to perform an unsigned addition with a carry?
推荐答案
当您不想覆盖进位标志(例如您已经存储了轮换内容)时,可以使用ADOX.
ADOX can be used when you don't want to overwrite the carry flag, like you've stored something like a rotation out.
但是,它们的主要用途是加速big-int算术,因为现在您可以结合使用mulx
However their main usage is to accelerate big-int arithmetics because now you can do two additions with carry in parallel in conjunction with mulx
From Intel's paper New Instructions Support Large Integer Arithmetic
ADCX/ADOX指令
adcx
和adox
指令是adc
指令的扩展,旨在支持两条单独的进位链.它们定义为:
ADCX/ADOX Instructions
The
adcx
andadox
instructions are extensions of theadc
instruction, designed to support two separate carry chains. They are defined as:
adcx dest/src1, src2
adox dest/src1, src2
这两个指令计算src1
和src2
的总和加上一个进位,并生成输出总和dest和一个进位.这两条指令之间的区别在于,adcx
使用CF标志进行进位和执行(保持OF标志不变),而adox
指令使用OF标志进行进位和执行(保留OF标志) CF标志不变).
Both instructions compute the sum of src1
and src2
plus a carry-in and generate an output sum dest and a carry-out. The difference between these two instructions is that adcx
uses the CF flag for the carry in and carry out (leaving the OF flag unchanged), whereas the adox
instruction uses the OF flag for the carry in and carry out (leaving the CF flag unchanged).
相关:
在ia32/ia64上的ADC和ADCX指令之间有什么区别?
这篇关于何时使用ADOX代替ADCX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!