1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx -ppc-vsr-nums-as-vr \ 3; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \ 4; RUN: | FileCheck %s 5 6; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector -ppc-vsr-nums-as-vr \ 7; RUN: -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu < %s \ 8; RUN: | FileCheck --check-prefix=CHECK-P9-VECTOR %s 9 10; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \ 11; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s \ 12; RUN: --check-prefix=CHECK-P9 --implicit-check-not xxswapd 13 14define <2 x double> @testi0(<2 x double>* %p1, double* %p2) { 15; CHECK-LABEL: testi0: 16; CHECK: # %bb.0: 17; CHECK-NEXT: lxvd2x vs0, 0, r3 18; CHECK-NEXT: lfdx f1, 0, r4 19; CHECK-NEXT: xxswapd vs0, vs0 20; CHECK-NEXT: xxmrghd v2, vs0, vs1 21; CHECK-NEXT: blr 22; 23; CHECK-P9-VECTOR-LABEL: testi0: 24; CHECK-P9-VECTOR: # %bb.0: 25; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3 26; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4 27; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0 28; CHECK-P9-VECTOR-NEXT: xxmrghd v2, vs0, vs1 29; CHECK-P9-VECTOR-NEXT: blr 30; 31; CHECK-P9-LABEL: testi0: 32; CHECK-P9: # %bb.0: 33; CHECK-P9-NEXT: lfd f1, 0(r4) 34; CHECK-P9-NEXT: lxv vs0, 0(r3) 35; CHECK-P9-NEXT: xxswapd vs1, f1 36; CHECK-P9-NEXT: xxpermdi v2, vs0, vs1, 1 37; CHECK-P9-NEXT: blr 38 %v = load <2 x double>, <2 x double>* %p1 39 %s = load double, double* %p2 40 %r = insertelement <2 x double> %v, double %s, i32 0 41 ret <2 x double> %r 42 43 44} 45 46define <2 x double> @testi1(<2 x double>* %p1, double* %p2) { 47; CHECK-LABEL: testi1: 48; CHECK: # %bb.0: 49; CHECK-NEXT: lxvd2x vs0, 0, r3 50; CHECK-NEXT: lfdx f1, 0, r4 51; CHECK-NEXT: xxswapd vs0, vs0 52; CHECK-NEXT: xxpermdi v2, vs1, vs0, 1 53; CHECK-NEXT: blr 54; 55; CHECK-P9-VECTOR-LABEL: testi1: 56; CHECK-P9-VECTOR: # %bb.0: 57; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3 58; CHECK-P9-VECTOR-NEXT: lfdx f1, 0, r4 59; CHECK-P9-VECTOR-NEXT: xxswapd vs0, vs0 60; CHECK-P9-VECTOR-NEXT: xxpermdi v2, vs1, vs0, 1 61; CHECK-P9-VECTOR-NEXT: blr 62; 63; CHECK-P9-LABEL: testi1: 64; CHECK-P9: # %bb.0: 65; CHECK-P9-NEXT: lfd f1, 0(r4) 66; CHECK-P9-NEXT: lxv vs0, 0(r3) 67; CHECK-P9-NEXT: xxswapd vs1, f1 68; CHECK-P9-NEXT: xxmrgld v2, vs1, vs0 69; CHECK-P9-NEXT: blr 70 %v = load <2 x double>, <2 x double>* %p1 71 %s = load double, double* %p2 72 %r = insertelement <2 x double> %v, double %s, i32 1 73 ret <2 x double> %r 74 75 76} 77 78define double @teste0(<2 x double>* %p1) { 79; CHECK-LABEL: teste0: 80; CHECK: # %bb.0: 81; CHECK-NEXT: lxvd2x vs1, 0, r3 82; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1 83; CHECK-NEXT: blr 84; 85; CHECK-P9-VECTOR-LABEL: teste0: 86; CHECK-P9-VECTOR: # %bb.0: 87; CHECK-P9-VECTOR-NEXT: lxvd2x vs1, 0, r3 88; CHECK-P9-VECTOR-NEXT: # kill: def $f1 killed $f1 killed $vsl1 89; CHECK-P9-VECTOR-NEXT: blr 90; 91; CHECK-P9-LABEL: teste0: 92; CHECK-P9: # %bb.0: 93; CHECK-P9-NEXT: lfd f1, 0(r3) 94; CHECK-P9-NEXT: blr 95 %v = load <2 x double>, <2 x double>* %p1 96 %r = extractelement <2 x double> %v, i32 0 97 ret double %r 98 99 100} 101 102define double @teste1(<2 x double>* %p1) { 103; CHECK-LABEL: teste1: 104; CHECK: # %bb.0: 105; CHECK-NEXT: lxvd2x vs0, 0, r3 106; CHECK-NEXT: xxswapd vs1, vs0 107; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1 108; CHECK-NEXT: blr 109; 110; CHECK-P9-VECTOR-LABEL: teste1: 111; CHECK-P9-VECTOR: # %bb.0: 112; CHECK-P9-VECTOR-NEXT: lxvd2x vs0, 0, r3 113; CHECK-P9-VECTOR-NEXT: xxswapd vs1, vs0 114; CHECK-P9-VECTOR-NEXT: # kill: def $f1 killed $f1 killed $vsl1 115; CHECK-P9-VECTOR-NEXT: blr 116; 117; CHECK-P9-LABEL: teste1: 118; CHECK-P9: # %bb.0: 119; CHECK-P9-NEXT: lfd f1, 8(r3) 120; CHECK-P9-NEXT: blr 121 %v = load <2 x double>, <2 x double>* %p1 122 %r = extractelement <2 x double> %v, i32 1 123 ret double %r 124 125 126} 127