Is FLAGS/EFLAGS part of “CC” (condition control) for clobber list?

情到浓时终转凉″ 提交于 2019-12-05 11:48:32

According to the manual, yes - cc is clobbered. RDRAND also sets OF, SF, ZF, AF, PF <- 0.

In practice, gcc assumes that an __asm__ block always clobbers the [E|R]FLAGS condition code register for x86. I don't have the reference, but you can see this assumption in places like the longlong.h header used in various GNU packages.

It is, as you say, harmless if not used. For that reason, you might as well include it, since it still provides semantic intent, or commentary at worst. Also consider that Clang and ICC implement GCC asm syntax, and they would be conforming to the documentation if they honoured the "cc" clobber, rather than presume it - even though this is unlikely.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!