Commit fc00693d authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Revert "[codegen] Swap using xchgq rather than three movq on x64"

This reverts commit a8fccd95.

Reason for revert: We'd need to investigate on a range of hardware
generations to assess if this is a good change; in general new 
hardware (intel 9th gen / amd ryzen) seems to be happier with 
xchg, while older hardware is not happy with xchg.

Original change's description:
> [codegen] Swap using xchgq rather than three movq on x64
> 
> R=​sigurds@chromium.org
> 
> Change-Id: Icd6e66b9bb23ca0dbf9fc5fe5c737a0bc3056a89
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1678359
> Auto-Submit: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62386}

TBR=sigurds@chromium.org,thibaudm@chromium.org

Change-Id: I8dc84d0899e6cbeccbca2cc557da9fb97c8d4bc8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1679495Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62405}
parent 468d5be7
......@@ -4121,7 +4121,9 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
if (source->IsRegister()) {
Register src = g.ToRegister(source);
Register dst = g.ToRegister(destination);
__ xchgq(src, dst);
__ movq(kScratchRegister, src);
__ movq(src, dst);
__ movq(dst, kScratchRegister);
} else {
DCHECK(source->IsFPRegister());
XMMRegister src = g.ToDoubleRegister(source);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment