何时使用ADOX代替ADCX? [英] When to use ADOX instead of ADCX?

查看:223
本文介绍了何时使用ADOX代替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

摘自Intel的论文

From Intel's paper New Instructions Support Large Integer Arithmetic

ADCX/ADOX指令

adcxadox指令是adc指令的扩展,旨在支持两条单独的进位链.它们定义为:

ADCX/ADOX Instructions

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

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

这两个指令计算src1src2的总和加上一个进位,并生成输出总和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆