This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use SHLD with both inputs from the same register to implement rotate on Sandy Bridge and later Intel CPUs
ClosedPublic

Authored by craig.topper on Feb 20 2017, 4:20 PM.

Details

Summary

Sandy Bridge and later CPUs have better throughput using a SHLD to implement rotate versus the normal rotate instructions. Additionally it saves one uop and avoids a partial flag update dependency.

This patch implements this change on any Sandy Bridge or later processor without BMI2 instructions. With BMI2 we will use RORX as we currently do.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 20 2017, 4:20 PM
zvi accepted this revision.Feb 20 2017, 10:37 PM

LGTM

This revision is now accepted and ready to land.Feb 20 2017, 10:37 PM
This revision was automatically updated to reflect the committed changes.