diff --git a/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/llvm/lib/Target/PowerPC/PPCInstrVSX.td --- a/llvm/lib/Target/PowerPC/PPCInstrVSX.td +++ b/llvm/lib/Target/PowerPC/PPCInstrVSX.td @@ -3547,7 +3547,7 @@ (SUBREG_TO_REG (i64 1), (MTVSRWZ $A), sub_64)>; defm : ScalToVecWPermute< v8i16, (i32 i32:$A), - (SUBREG_TO_REG (i64 1), MovesToVSR.BE_BYTE_0, sub_64), + (SUBREG_TO_REG (i64 1), MovesToVSR.BE_HALF_0, sub_64), (SUBREG_TO_REG (i64 1), (MTVSRWZ $A), sub_64)>; defm : ScalToVecWPermute< v4i32, (i32 i32:$A), diff --git a/llvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll b/llvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll --- a/llvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll +++ b/llvm/test/CodeGen/PowerPC/scalar_vector_test_5.ll @@ -30,7 +30,7 @@ ; P8BE-LABEL: scalar_to_vector_half: ; P8BE: # %bb.0: # %entry ; P8BE-NEXT: lhz r3, 0(r3) -; P8BE-NEXT: sldi r3, r3, 56 +; P8BE-NEXT: sldi r3, r3, 48 ; P8BE-NEXT: mtfprd f0, r3 ; P8BE-NEXT: mffprd r3, f0 ; P8BE-NEXT: rldicl r3, r3, 8, 56