Is it possible? For a small code without any branches/loops.
Are there any gcc flags or intrinsic instructions like SSE’s for x86 and other processor families? I am just curious since all the processors available these days follow out of order execution model.
Thanks in advance
Most modern out-of-order CPUs are inherently out-of-order, without switching possible between in-order and out-of-order modes.
You can try to find some in-order CPU, and there are some:
While it is not possible to directly turn off instruction reordering in the typical out-of-order CPU, you can inject something serializing (like
cpuidin x86 world) between every your instruction to simulate in-order execution.There is a part of Intel manuals (vol 3a) about serializing instructions (copied from http://objectmix.com/asm-x86-asm-370/69413-serializing-instructions.html):