int cread(int *xp)
{
return (xp?*xp : 0);
}
================================>
movl $0,%eax
testl %edx,%edx
cmovne (edx),%eax
看看,有什么问题没有?希望高手们提出自己的见解,不胜感激
------解决方案--------------------------------------------------------
For the memory-based forms of CMOVcc, memory-related exceptions may be reported even if the condition is false.
In 64-bit mode, CMOVcc with a 32-bit operand size will clear the upper 32 bits of the destination
register even if the condition is false.
------解决方案--------------------------------------------------------
amd的文档,他说可能会引发,意思是实现这个指令系统的cpu可以引发也可以不引发,所以不能确信
反正我这里intel的cpu执行这两个都会异常
stc;cmovc 0,%eax
clc;cmovc 0,%eax