Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1135 ディスカッション

x87 and out-of-order execution

k_sarnath
ビギナー
737件の閲覧回数
Since most x87 instructions rely on TOP OF STACK as an implied parameter -- Will it affect out of order execution?
Will switching to scalar SSE code give dramatic performance (like doing a MUL and ADD together etc..)

Thanks,
0 件の賞賛
1 解決策
capens__nicolas
新規コントリビューター I
737件の閲覧回数
It affects out-of-order execution in the same way as other operand dependencies. Also note that the XCHG instruction is virtually for free (latency 0) since it is handled as a register renaming.

However, x87 by default computes 80-bit results, which for operations like division and square root are very slow. You can explicitly lower that precision to 64- or 32-bit though through the control word.

Also, some compilers are not that good at creating efficient x87 code due to the complications ofmanaging theregister stack. There can generate notably faster scalar SSE code. As far as I'm aware the difference on most reputable compilers is very minor though.

Furthermore on x64 SSE has access to 16 registers which for some algorithms reduces spilling.

But if you really want to improve performance you should probably look into parallelising your code to make full use of SSE (and later AVX).

元の投稿で解決策を見る

2 返答(返信)
capens__nicolas
新規コントリビューター I
738件の閲覧回数
It affects out-of-order execution in the same way as other operand dependencies. Also note that the XCHG instruction is virtually for free (latency 0) since it is handled as a register renaming.

However, x87 by default computes 80-bit results, which for operations like division and square root are very slow. You can explicitly lower that precision to 64- or 32-bit though through the control word.

Also, some compilers are not that good at creating efficient x87 code due to the complications ofmanaging theregister stack. There can generate notably faster scalar SSE code. As far as I'm aware the difference on most reputable compilers is very minor though.

Furthermore on x64 SSE has access to 16 registers which for some algorithms reduces spilling.

But if you really want to improve performance you should probably look into parallelising your code to make full use of SSE (and later AVX).
k_sarnath
ビギナー
737件の閲覧回数
Thanks for the detailed answer! It was useful.
返信