This is an archive of the discontinued LLVM Phabricator instance.

[X86][XOP] Added support for the lowering of 128-bit vector shifts to XOP shift instructions
ClosedPublic

Authored by RKSimon on Mar 29 2015, 4:30 AM.

Details

Summary

The XOP shifts just have logical / arithmetic versions and the left / right shifts are controlled by whether the value is positive / negative. Because of this I've added new X86ISD nodes instead of trying to force them to use the existing shift nodes. Additionally the upcoming Excavator cores (bdver4) will support XOP and AVX2 - meaning that it should use the (slightly easier) AVX2 32/64 bit shifts when it can and fall back to XOP in other cases.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 22851.Mar 29 2015, 4:30 AM
RKSimon retitled this revision from to [X86][XOP] Added support for the lowering of 128-bit vector shifts to XOP shift instructions.
RKSimon updated this object.
RKSimon edited the test plan for this revision. (Show Details)
RKSimon added a reviewer: craig.topper.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: Unknown Object (MLST).

ping - for some reason this patch didn't get emailed to the commits list over the weekend

Adding reviewers - we really need more AMD specialists!

RKSimon updated this revision to Diff 35802.Sep 26 2015, 10:04 AM

Updated old patch now that I finally have test hardware again.

andreadb accepted this revision.Sep 29 2015, 3:19 AM
andreadb edited edge metadata.

Hi Simon,

Nice patch! LGTM.

lib/Target/X86/X86TargetTransformInfo.cpp
227–234

This change is not needed by your patch. I suggest that you just leave this code as it is (there are at least other three places in this same file where we do the same thing).

test/Analysis/CostModel/X86/vshift-cost.ll
5–9

As a TODO, we should add extra test coverage in the cost model for packed arithmetic/logical shifts with variable shift count. In this file I only see tests for packed logical shift left with variable count.

I think we should extend this file and add extra tests for packed logical/arithmetic shifts and how it changes for AVX2 and XOP. This can be done in a separate patch.

This revision is now accepted and ready to land.Sep 29 2015, 3:19 AM
This revision was automatically updated to reflect the committed changes.