; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names -mtriple=powerpc64-ibm-aix < %s  | \
; RUN:   FileCheck %s


define <4 x i8> @backsmith_pure_1(<8 x i32> %0) {
; CHECK-LABEL: backsmith_pure_1:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    ld r3, L..C0(r2) # %const.0
; CHECK-NEXT:    xxsldwi vs34, vs35, vs35, 1
; CHECK-NEXT:    lxvw4x vs36, 0, r3
; CHECK-NEXT:    vspltb v3, v3, 3
; CHECK-NEXT:    vperm v2, v2, v2, v4
; CHECK-NEXT:    xxland vs34, vs35, vs34
; CHECK-NEXT:    blr
entry:
  %shuffle = shufflevector <8 x i32> %0, <8 x i32> zeroinitializer, <4 x i32> <i32 5, i32 6, i32 7, i32 4>
  %conv4 = trunc <4 x i32> %shuffle to <4 x i8>
  %shift = shufflevector <4 x i8> %conv4, <4 x i8> zeroinitializer, <4 x i32> <i32 3, i32 poison, i32 poison, i32 poison>
  %foldExtExtBinop = and <4 x i8> %shift, %conv4
  ret <4 x i8> %foldExtExtBinop
}
