Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit b386929

Browse files
committed
Vector element extraction without stack operations on Power 8
This patch corresponds to review: http://reviews.llvm.org/D12032 This patch builds onto the patch that provided scalar to vector conversions without stack operations (D11471). Included in this patch: - Vector element extraction for all vector types with constant element number - Vector element extraction for v16i8 and v8i16 with variable element number - Removal of some unnecessary COPY_TO_REGCLASS operations that ended up unnecessarily moving things around between registers Not included in this patch (will be in upcoming patch): - Vector element extraction for v4i32, v4f32, v2i64 and v2f64 with variable element number - Vector element insertion for variable/constant element number Testing is provided for all extractions. The extractions that are not implemented yet are just placeholders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249822 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 12b807e commit b386929

File tree

4 files changed

+1749
-23
lines changed

4 files changed

+1749
-23
lines changed

lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,21 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
543543

544544
if (Subtarget.hasVSX()) {
545545
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v2f64, Legal);
546-
if (Subtarget.hasP8Vector())
546+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2f64, Legal);
547+
if (Subtarget.hasP8Vector()) {
547548
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4f32, Legal);
549+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Legal);
550+
}
548551
if (Subtarget.hasDirectMove()) {
549552
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Legal);
550553
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Legal);
551554
setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4i32, Legal);
552555
// FIXME: this is causing bootstrap failures, disable temporarily
553556
//setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v2i64, Legal);
557+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v16i8, Legal);
558+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v8i16, Legal);
559+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4i32, Legal);
560+
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2i64, Legal);
554561
}
555562
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2f64, Legal);
556563

0 commit comments

Comments
 (0)