tcg/x86_64: generated dec/inc instead of sub/addwhen possible
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Anthony Liguori
From: Aurelien Jarno<[email protected]>
Intel recommends not using inc/dec. Since these instructions don't update all of the flags, they cannot be issued in parallel to previous instructions that do.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 8 lines · Avi Kivity
Quoted 3 lines · Anthony Liguori
From: Aurelien Jarno<[email protected]>
Intel recommends not using inc/dec. Since these instructions don't update all of the flags, they cannot be issued in parallel to previous instructions that do.
That's true, but I think Icache misses will cost you more than the false dependencies; due to code size expansion in the translation process, optimizing rules should not be obeyed blindly. I guess this should be measured.
Laurent
Quoted 6 lines · Laurent Desnogues
Quoted 5 lines · Avi Kivity
Quoted 3 lines · Anthony Liguori
From: Aurelien Jarno<[email protected]>
Quoted 8 lines
Quoted 3 lines
Intel recommends not using inc/dec. Since these instructions don't update all of the flags, they cannot be issued in parallel to previous instructions that do.
That's true, but I think Icache misses will cost you more than the false dependencies; due to code size expansion in the translation process, optimizing rules should not be obeyed blindly. I guess this should be measured.
I vaguely remember measuring it and the results were different on Pentium IV-based and Pentium M-based processors. On one of them inc/dec was faster, while on the other it was add/sub. I can't remember which one had which results though.
Best regards,
Filip Navara
Quoted 5 lines · Filip Navara
I vaguely remember measuring it and the results were different on Pentium IV-based and Pentium M-based processors. On one of them inc/dec was faster, while on the other it was add/sub. I can't remember which one had which results though.
Do you mean in a QEMU context or something else? If that was with QEMU, was the program significantly large?
Laurent
Quoted 9 lines · Laurent Desnogues
Quoted 5 lines · Filip Navara
I vaguely remember measuring it and the results were different on Pentium IV-based and Pentium M-based processors. On one of them inc/dec was faster, while on the other it was add/sub. I can't remember which one had which results though.
Do you mean in a QEMU context or something else? If that was with QEMU, was the program significantly large?
In QEMU/TCG context. It was some synthetic benchmark, most probably Dhrystone.
Best regards,
Filip Navara