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.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
ping - for some reason this patch didn't get emailed to the commits list over the weekend
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 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).