1; RUN: llc -mcpu=pwr8 -mattr=+vsx -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s 2 3define <2 x double> @test00(<2 x double>* %p1, <2 x double>* %p2) { 4 %v1 = load <2 x double>, <2 x double>* %p1 5 %v2 = load <2 x double>, <2 x double>* %p2 6 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 0> 7 ret <2 x double> %v3 8 9; CHECK-LABEL: test00 10; CHECK: lxvd2x 0, 0, 3 11; CHECK: xxspltd 34, 0, 0 12} 13 14define <2 x double> @test01(<2 x double>* %p1, <2 x double>* %p2) { 15 %v1 = load <2 x double>, <2 x double>* %p1 16 %v2 = load <2 x double>, <2 x double>* %p2 17 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 1> 18 ret <2 x double> %v3 19 20; CHECK-LABEL: test01 21; CHECK: lxvd2x 0, 0, 3 22; CHECK: xxswapd 34, 0 23} 24 25define <2 x double> @test02(<2 x double>* %p1, <2 x double>* %p2) { 26 %v1 = load <2 x double>, <2 x double>* %p1 27 %v2 = load <2 x double>, <2 x double>* %p2 28 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 2> 29 ret <2 x double> %v3 30 31; CHECK-LABEL: @test02 32; CHECK: lxvd2x 0, 0, 3 33; CHECK: lxvd2x 1, 0, 4 34; CHECK: xxswapd 0, 0 35; CHECK: xxswapd 1, 1 36; CHECK: xxmrgld 34, 1, 0 37} 38 39define <2 x double> @test03(<2 x double>* %p1, <2 x double>* %p2) { 40 %v1 = load <2 x double>, <2 x double>* %p1 41 %v2 = load <2 x double>, <2 x double>* %p2 42 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 0, i32 3> 43 ret <2 x double> %v3 44 45; CHECK-LABEL: @test03 46; CHECK: lxvd2x 0, 0, 3 47; CHECK: lxvd2x 1, 0, 4 48; CHECK: xxswapd 0, 0 49; CHECK: xxswapd 1, 1 50; CHECK: xxpermdi 34, 1, 0, 1 51} 52 53define <2 x double> @test10(<2 x double>* %p1, <2 x double>* %p2) { 54 %v1 = load <2 x double>, <2 x double>* %p1 55 %v2 = load <2 x double>, <2 x double>* %p2 56 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 0> 57 ret <2 x double> %v3 58 59; CHECK-LABEL: @test10 60; CHECK: lxvd2x 34, 0, 3 61} 62 63define <2 x double> @test11(<2 x double>* %p1, <2 x double>* %p2) { 64 %v1 = load <2 x double>, <2 x double>* %p1 65 %v2 = load <2 x double>, <2 x double>* %p2 66 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 1> 67 ret <2 x double> %v3 68 69; CHECK-LABEL: @test11 70; CHECK: lxvd2x 0, 0, 3 71; CHECK: xxspltd 34, 0, 1 72} 73 74define <2 x double> @test12(<2 x double>* %p1, <2 x double>* %p2) { 75 %v1 = load <2 x double>, <2 x double>* %p1 76 %v2 = load <2 x double>, <2 x double>* %p2 77 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 2> 78 ret <2 x double> %v3 79 80; CHECK-LABEL: @test12 81; CHECK: lxvd2x 0, 0, 3 82; CHECK: lxvd2x 1, 0, 4 83; CHECK: xxswapd 0, 0 84; CHECK: xxswapd 1, 1 85; CHECK: xxpermdi 34, 1, 0, 2 86} 87 88define <2 x double> @test13(<2 x double>* %p1, <2 x double>* %p2) { 89 %v1 = load <2 x double>, <2 x double>* %p1 90 %v2 = load <2 x double>, <2 x double>* %p2 91 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 1, i32 3> 92 ret <2 x double> %v3 93 94; CHECK-LABEL: @test13 95; CHECK: lxvd2x 0, 0, 3 96; CHECK: lxvd2x 1, 0, 4 97; CHECK: xxswapd 0, 0 98; CHECK: xxswapd 1, 1 99; CHECK: xxmrghd 34, 1, 0 100} 101 102define <2 x double> @test20(<2 x double>* %p1, <2 x double>* %p2) { 103 %v1 = load <2 x double>, <2 x double>* %p1 104 %v2 = load <2 x double>, <2 x double>* %p2 105 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 0> 106 ret <2 x double> %v3 107 108; CHECK-LABEL: @test20 109; CHECK: lxvd2x 0, 0, 3 110; CHECK: lxvd2x 1, 0, 4 111; CHECK: xxswapd 0, 0 112; CHECK: xxswapd 1, 1 113; CHECK: xxmrgld 34, 0, 1 114} 115 116define <2 x double> @test21(<2 x double>* %p1, <2 x double>* %p2) { 117 %v1 = load <2 x double>, <2 x double>* %p1 118 %v2 = load <2 x double>, <2 x double>* %p2 119 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 1> 120 ret <2 x double> %v3 121 122; CHECK-LABEL: @test21 123; CHECK: lxvd2x 0, 0, 3 124; CHECK: lxvd2x 1, 0, 4 125; CHECK: xxswapd 0, 0 126; CHECK: xxswapd 1, 1 127; CHECK: xxpermdi 34, 0, 1, 1 128} 129 130define <2 x double> @test22(<2 x double>* %p1, <2 x double>* %p2) { 131 %v1 = load <2 x double>, <2 x double>* %p1 132 %v2 = load <2 x double>, <2 x double>* %p2 133 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 2> 134 ret <2 x double> %v3 135 136; CHECK-LABEL: @test22 137; CHECK: lxvd2x 0, 0, 4 138; CHECK: xxspltd 34, 0, 0 139} 140 141define <2 x double> @test23(<2 x double>* %p1, <2 x double>* %p2) { 142 %v1 = load <2 x double>, <2 x double>* %p1 143 %v2 = load <2 x double>, <2 x double>* %p2 144 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 2, i32 3> 145 ret <2 x double> %v3 146 147; CHECK-LABEL: @test23 148; CHECK: lxvd2x 0, 0, 4 149; CHECK: xxswapd 34, 0 150} 151 152define <2 x double> @test30(<2 x double>* %p1, <2 x double>* %p2) { 153 %v1 = load <2 x double>, <2 x double>* %p1 154 %v2 = load <2 x double>, <2 x double>* %p2 155 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 0> 156 ret <2 x double> %v3 157 158; CHECK-LABEL: @test30 159; CHECK: lxvd2x 0, 0, 3 160; CHECK: lxvd2x 1, 0, 4 161; CHECK: xxswapd 0, 0 162; CHECK: xxswapd 1, 1 163; CHECK: xxpermdi 34, 0, 1, 2 164} 165 166define <2 x double> @test31(<2 x double>* %p1, <2 x double>* %p2) { 167 %v1 = load <2 x double>, <2 x double>* %p1 168 %v2 = load <2 x double>, <2 x double>* %p2 169 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 1> 170 ret <2 x double> %v3 171 172; CHECK-LABEL: @test31 173; CHECK: lxvd2x 0, 0, 3 174; CHECK: lxvd2x 1, 0, 4 175; CHECK: xxswapd 0, 0 176; CHECK: xxswapd 1, 1 177; CHECK: xxmrghd 34, 0, 1 178} 179 180define <2 x double> @test32(<2 x double>* %p1, <2 x double>* %p2) { 181 %v1 = load <2 x double>, <2 x double>* %p1 182 %v2 = load <2 x double>, <2 x double>* %p2 183 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 2> 184 ret <2 x double> %v3 185 186; CHECK-LABEL: @test32 187; CHECK: lxvd2x 34, 0, 4 188} 189 190define <2 x double> @test33(<2 x double>* %p1, <2 x double>* %p2) { 191 %v1 = load <2 x double>, <2 x double>* %p1 192 %v2 = load <2 x double>, <2 x double>* %p2 193 %v3 = shufflevector <2 x double> %v1, <2 x double> %v2, <2 x i32> < i32 3, i32 3> 194 ret <2 x double> %v3 195 196; CHECK-LABEL: @test33 197; CHECK: lxvd2x 0, 0, 4 198; CHECK: xxspltd 34, 0, 1 199} 200