1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \ 3; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s 4; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-unknown \ 5; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \ 6; RUN: --check-prefix=CHECK-BE 7; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \ 8; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \ 9; RUN: --check-prefix=CHECK-P9 10; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-unknown \ 11; RUN: -ppc-asm-full-reg-names -verify-machineinstrs -O2 < %s | FileCheck %s \ 12; RUN: --check-prefix=CHECK-P9-BE 13 14define <2 x i64> @testllv(<2 x i64> returned %a, <2 x i64> %b, i64* nocapture %ap, i64 %Idx) local_unnamed_addr #0 { 15; CHECK-LABEL: testllv: 16; CHECK: # %bb.0: # %entry 17; CHECK-NEXT: xxswapd vs0, vs34 18; CHECK-NEXT: sldi r3, r8, 3 19; CHECK-NEXT: stfdx f0, r7, r3 20; CHECK-NEXT: blr 21; 22; CHECK-BE-LABEL: testllv: 23; CHECK-BE: # %bb.0: # %entry 24; CHECK-BE-NEXT: sldi r3, r8, 3 25; CHECK-BE-NEXT: stxsdx vs34, r7, r3 26; CHECK-BE-NEXT: blr 27; 28; CHECK-P9-LABEL: testllv: 29; CHECK-P9: # %bb.0: # %entry 30; CHECK-P9-NEXT: xxswapd vs0, vs34 31; CHECK-P9-NEXT: sldi r3, r8, 3 32; CHECK-P9-NEXT: stfdx f0, r7, r3 33; CHECK-P9-NEXT: blr 34; 35; CHECK-P9-BE-LABEL: testllv: 36; CHECK-P9-BE: # %bb.0: # %entry 37; CHECK-P9-BE-NEXT: sldi r3, r8, 3 38; CHECK-P9-BE-NEXT: stxsdx vs34, r7, r3 39; CHECK-P9-BE-NEXT: blr 40entry: 41 %vecext = extractelement <2 x i64> %a, i32 0 42 %arrayidx = getelementptr inbounds i64, i64* %ap, i64 %Idx 43 store i64 %vecext, i64* %arrayidx, align 8 44 ret <2 x i64> %a 45} 46 47define <2 x i64> @testll0(<2 x i64> returned %a, <2 x i64> %b, i64* nocapture %ap) local_unnamed_addr #0 { 48; CHECK-LABEL: testll0: 49; CHECK: # %bb.0: # %entry 50; CHECK-NEXT: xxswapd vs0, vs34 51; CHECK-NEXT: stfd f0, 24(r7) 52; CHECK-NEXT: blr 53; 54; CHECK-BE-LABEL: testll0: 55; CHECK-BE: # %bb.0: # %entry 56; CHECK-BE-NEXT: addi r3, r7, 24 57; CHECK-BE-NEXT: stxsdx vs34, 0, r3 58; CHECK-BE-NEXT: blr 59; 60; CHECK-P9-LABEL: testll0: 61; CHECK-P9: # %bb.0: # %entry 62; CHECK-P9-NEXT: xxswapd vs0, vs34 63; CHECK-P9-NEXT: stfd f0, 24(r7) 64; CHECK-P9-NEXT: blr 65; 66; CHECK-P9-BE-LABEL: testll0: 67; CHECK-P9-BE: # %bb.0: # %entry 68; CHECK-P9-BE-NEXT: stxsd v2, 24(r7) 69; CHECK-P9-BE-NEXT: blr 70entry: 71 %vecext = extractelement <2 x i64> %a, i32 0 72 %arrayidx = getelementptr inbounds i64, i64* %ap, i64 3 73 store i64 %vecext, i64* %arrayidx, align 8 74 ret <2 x i64> %a 75} 76 77; Function Attrs: norecurse nounwind writeonly 78define <2 x i64> @testll1(<2 x i64> returned %a, i64 %b, i64* nocapture %ap) local_unnamed_addr #0 { 79; CHECK-LABEL: testll1: 80; CHECK: # %bb.0: # %entry 81; CHECK-NEXT: addi r3, r6, 24 82; CHECK-NEXT: stxsdx vs34, 0, r3 83; CHECK-NEXT: blr 84; 85; CHECK-BE-LABEL: testll1: 86; CHECK-BE: # %bb.0: # %entry 87; CHECK-BE-NEXT: xxswapd vs0, vs34 88; CHECK-BE-NEXT: stfd f0, 24(r6) 89; CHECK-BE-NEXT: blr 90; 91; CHECK-P9-LABEL: testll1: 92; CHECK-P9: # %bb.0: # %entry 93; CHECK-P9-NEXT: stxsd v2, 24(r6) 94; CHECK-P9-NEXT: blr 95; 96; CHECK-P9-BE-LABEL: testll1: 97; CHECK-P9-BE: # %bb.0: # %entry 98; CHECK-P9-BE-NEXT: xxswapd vs0, vs34 99; CHECK-P9-BE-NEXT: stfd f0, 24(r6) 100; CHECK-P9-BE-NEXT: blr 101entry: 102 %vecext = extractelement <2 x i64> %a, i32 1 103 %arrayidx = getelementptr inbounds i64, i64* %ap, i64 3 104 store i64 %vecext, i64* %arrayidx, align 8 105 ret <2 x i64> %a 106} 107 108define <2 x double> @testdv(<2 x double> returned %a, <2 x double> %b, double* nocapture %ap, i64 %Idx) local_unnamed_addr #0 { 109; CHECK-LABEL: testdv: 110; CHECK: # %bb.0: # %entry 111; CHECK-NEXT: xxswapd vs0, vs34 112; CHECK-NEXT: sldi r3, r8, 3 113; CHECK-NEXT: stfdx f0, r7, r3 114; CHECK-NEXT: blr 115; 116; CHECK-BE-LABEL: testdv: 117; CHECK-BE: # %bb.0: # %entry 118; CHECK-BE-NEXT: sldi r3, r8, 3 119; CHECK-BE-NEXT: stxsdx vs34, r7, r3 120; CHECK-BE-NEXT: blr 121; 122; CHECK-P9-LABEL: testdv: 123; CHECK-P9: # %bb.0: # %entry 124; CHECK-P9-NEXT: xxswapd vs0, vs34 125; CHECK-P9-NEXT: sldi r3, r8, 3 126; CHECK-P9-NEXT: stfdx f0, r7, r3 127; CHECK-P9-NEXT: blr 128; 129; CHECK-P9-BE-LABEL: testdv: 130; CHECK-P9-BE: # %bb.0: # %entry 131; CHECK-P9-BE-NEXT: sldi r3, r8, 3 132; CHECK-P9-BE-NEXT: stxsdx vs34, r7, r3 133; CHECK-P9-BE-NEXT: blr 134entry: 135 %vecext = extractelement <2 x double> %a, i32 0 136 %arrayidx = getelementptr inbounds double, double* %ap, i64 %Idx 137 store double %vecext, double* %arrayidx, align 8 138 ret <2 x double> %a 139} 140 141define <2 x double> @testd0(<2 x double> returned %a, <2 x double> %b, double* nocapture %ap) local_unnamed_addr #0 { 142; CHECK-LABEL: testd0: 143; CHECK: # %bb.0: # %entry 144; CHECK-NEXT: xxswapd vs0, vs34 145; CHECK-NEXT: stfd f0, 24(r7) 146; CHECK-NEXT: blr 147; 148; CHECK-BE-LABEL: testd0: 149; CHECK-BE: # %bb.0: # %entry 150; CHECK-BE-NEXT: addi r3, r7, 24 151; CHECK-BE-NEXT: stxsdx vs34, 0, r3 152; CHECK-BE-NEXT: blr 153; 154; CHECK-P9-LABEL: testd0: 155; CHECK-P9: # %bb.0: # %entry 156; CHECK-P9-NEXT: xxswapd vs0, vs34 157; CHECK-P9-NEXT: stfd f0, 24(r7) 158; CHECK-P9-NEXT: blr 159; 160; CHECK-P9-BE-LABEL: testd0: 161; CHECK-P9-BE: # %bb.0: # %entry 162; CHECK-P9-BE-NEXT: stxsd v2, 24(r7) 163; CHECK-P9-BE-NEXT: blr 164entry: 165 %vecext = extractelement <2 x double> %a, i32 0 166 %arrayidx = getelementptr inbounds double, double* %ap, i64 3 167 store double %vecext, double* %arrayidx, align 8 168 ret <2 x double> %a 169} 170 171; Function Attrs: norecurse nounwind writeonly 172define <2 x double> @testd1(<2 x double> returned %a, <2 x double> %b, double* nocapture %ap) local_unnamed_addr #0 { 173; CHECK-LABEL: testd1: 174; CHECK: # %bb.0: # %entry 175; CHECK-NEXT: addi r3, r7, 24 176; CHECK-NEXT: stxsdx vs34, 0, r3 177; CHECK-NEXT: blr 178; 179; CHECK-BE-LABEL: testd1: 180; CHECK-BE: # %bb.0: # %entry 181; CHECK-BE-NEXT: xxswapd vs0, vs34 182; CHECK-BE-NEXT: stfd f0, 24(r7) 183; CHECK-BE-NEXT: blr 184; 185; CHECK-P9-LABEL: testd1: 186; CHECK-P9: # %bb.0: # %entry 187; CHECK-P9-NEXT: stxsd v2, 24(r7) 188; CHECK-P9-NEXT: blr 189; 190; CHECK-P9-BE-LABEL: testd1: 191; CHECK-P9-BE: # %bb.0: # %entry 192; CHECK-P9-BE-NEXT: xxswapd vs0, vs34 193; CHECK-P9-BE-NEXT: stfd f0, 24(r7) 194; CHECK-P9-BE-NEXT: blr 195entry: 196 %vecext = extractelement <2 x double> %a, i32 1 197 %arrayidx = getelementptr inbounds double, double* %ap, i64 3 198 store double %vecext, double* %arrayidx, align 8 199 ret <2 x double> %a 200} 201 202; Function Attrs: norecurse nounwind writeonly 203define <4 x float> @testf0(<4 x float> returned %a, <4 x float> %b, float* nocapture %ap) local_unnamed_addr #0 { 204; CHECK-LABEL: testf0: 205; CHECK: # %bb.0: # %entry 206; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2 207; CHECK-NEXT: addi r3, r7, 12 208; CHECK-NEXT: stfiwx f0, 0, r3 209; CHECK-NEXT: blr 210; 211; CHECK-BE-LABEL: testf0: 212; CHECK-BE: # %bb.0: # %entry 213; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 214; CHECK-BE-NEXT: addi r3, r7, 12 215; CHECK-BE-NEXT: stfiwx f0, 0, r3 216; CHECK-BE-NEXT: blr 217; 218; CHECK-P9-LABEL: testf0: 219; CHECK-P9: # %bb.0: # %entry 220; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2 221; CHECK-P9-NEXT: addi r3, r7, 12 222; CHECK-P9-NEXT: stfiwx f0, 0, r3 223; CHECK-P9-NEXT: blr 224; 225; CHECK-P9-BE-LABEL: testf0: 226; CHECK-P9-BE: # %bb.0: # %entry 227; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 228; CHECK-P9-BE-NEXT: addi r3, r7, 12 229; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 230; CHECK-P9-BE-NEXT: blr 231entry: 232 %vecext = extractelement <4 x float> %a, i32 0 233 %arrayidx = getelementptr inbounds float, float* %ap, i64 3 234 store float %vecext, float* %arrayidx, align 4 235 ret <4 x float> %a 236} 237 238; Function Attrs: norecurse nounwind writeonly 239define <4 x float> @testf1(<4 x float> returned %a, <4 x float> %b, float* nocapture %ap) local_unnamed_addr #0 { 240; CHECK-LABEL: testf1: 241; CHECK: # %bb.0: # %entry 242; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1 243; CHECK-NEXT: addi r3, r7, 12 244; CHECK-NEXT: stfiwx f0, 0, r3 245; CHECK-NEXT: blr 246; 247; CHECK-BE-LABEL: testf1: 248; CHECK-BE: # %bb.0: # %entry 249; CHECK-BE-NEXT: addi r3, r7, 12 250; CHECK-BE-NEXT: stxsiwx vs34, 0, r3 251; CHECK-BE-NEXT: blr 252; 253; CHECK-P9-LABEL: testf1: 254; CHECK-P9: # %bb.0: # %entry 255; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1 256; CHECK-P9-NEXT: addi r3, r7, 12 257; CHECK-P9-NEXT: stfiwx f0, 0, r3 258; CHECK-P9-NEXT: blr 259; 260; CHECK-P9-BE-LABEL: testf1: 261; CHECK-P9-BE: # %bb.0: # %entry 262; CHECK-P9-BE-NEXT: addi r3, r7, 12 263; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r3 264; CHECK-P9-BE-NEXT: blr 265entry: 266 %vecext = extractelement <4 x float> %a, i32 1 267 %arrayidx = getelementptr inbounds float, float* %ap, i64 3 268 store float %vecext, float* %arrayidx, align 4 269 ret <4 x float> %a 270} 271 272; Function Attrs: norecurse nounwind writeonly 273define <4 x float> @testf2(<4 x float> returned %a, <4 x float> %b, float* nocapture %ap) local_unnamed_addr #0 { 274; CHECK-LABEL: testf2: 275; CHECK: # %bb.0: # %entry 276; CHECK-NEXT: addi r3, r7, 12 277; CHECK-NEXT: stxsiwx vs34, 0, r3 278; CHECK-NEXT: blr 279; 280; CHECK-BE-LABEL: testf2: 281; CHECK-BE: # %bb.0: # %entry 282; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 283; CHECK-BE-NEXT: addi r3, r7, 12 284; CHECK-BE-NEXT: stfiwx f0, 0, r3 285; CHECK-BE-NEXT: blr 286; 287; CHECK-P9-LABEL: testf2: 288; CHECK-P9: # %bb.0: # %entry 289; CHECK-P9-NEXT: addi r3, r7, 12 290; CHECK-P9-NEXT: stxsiwx vs34, 0, r3 291; CHECK-P9-NEXT: blr 292; 293; CHECK-P9-BE-LABEL: testf2: 294; CHECK-P9-BE: # %bb.0: # %entry 295; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 296; CHECK-P9-BE-NEXT: addi r3, r7, 12 297; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 298; CHECK-P9-BE-NEXT: blr 299entry: 300 %vecext = extractelement <4 x float> %a, i32 2 301 %arrayidx = getelementptr inbounds float, float* %ap, i64 3 302 store float %vecext, float* %arrayidx, align 4 303 ret <4 x float> %a 304} 305 306; Function Attrs: norecurse nounwind writeonly 307define <4 x float> @testf3(<4 x float> returned %a, <4 x float> %b, float* nocapture %ap) local_unnamed_addr #0 { 308; CHECK-LABEL: testf3: 309; CHECK: # %bb.0: # %entry 310; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3 311; CHECK-NEXT: addi r3, r7, 12 312; CHECK-NEXT: stfiwx f0, 0, r3 313; CHECK-NEXT: blr 314; 315; CHECK-BE-LABEL: testf3: 316; CHECK-BE: # %bb.0: # %entry 317; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 318; CHECK-BE-NEXT: addi r3, r7, 12 319; CHECK-BE-NEXT: stfiwx f0, 0, r3 320; CHECK-BE-NEXT: blr 321; 322; CHECK-P9-LABEL: testf3: 323; CHECK-P9: # %bb.0: # %entry 324; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3 325; CHECK-P9-NEXT: addi r3, r7, 12 326; CHECK-P9-NEXT: stfiwx f0, 0, r3 327; CHECK-P9-NEXT: blr 328; 329; CHECK-P9-BE-LABEL: testf3: 330; CHECK-P9-BE: # %bb.0: # %entry 331; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 332; CHECK-P9-BE-NEXT: addi r3, r7, 12 333; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 334; CHECK-P9-BE-NEXT: blr 335entry: 336 %vecext = extractelement <4 x float> %a, i32 3 337 %arrayidx = getelementptr inbounds float, float* %ap, i64 3 338 store float %vecext, float* %arrayidx, align 4 339 ret <4 x float> %a 340} 341 342; Function Attrs: norecurse nounwind writeonly 343define <4 x i32> @testi0(<4 x i32> returned %a, <4 x i32> %b, i32* nocapture %ap) local_unnamed_addr #0 { 344; CHECK-LABEL: testi0: 345; CHECK: # %bb.0: # %entry 346; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2 347; CHECK-NEXT: addi r3, r7, 12 348; CHECK-NEXT: stfiwx f0, 0, r3 349; CHECK-NEXT: blr 350; 351; CHECK-BE-LABEL: testi0: 352; CHECK-BE: # %bb.0: # %entry 353; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 354; CHECK-BE-NEXT: addi r3, r7, 12 355; CHECK-BE-NEXT: stfiwx f0, 0, r3 356; CHECK-BE-NEXT: blr 357; 358; CHECK-P9-LABEL: testi0: 359; CHECK-P9: # %bb.0: # %entry 360; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2 361; CHECK-P9-NEXT: addi r3, r7, 12 362; CHECK-P9-NEXT: stfiwx f0, 0, r3 363; CHECK-P9-NEXT: blr 364; 365; CHECK-P9-BE-LABEL: testi0: 366; CHECK-P9-BE: # %bb.0: # %entry 367; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 368; CHECK-P9-BE-NEXT: addi r3, r7, 12 369; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 370; CHECK-P9-BE-NEXT: blr 371entry: 372 %vecext = extractelement <4 x i32> %a, i32 0 373 %arrayidx = getelementptr inbounds i32, i32* %ap, i64 3 374 store i32 %vecext, i32* %arrayidx, align 4 375 ret <4 x i32> %a 376} 377 378; Function Attrs: norecurse nounwind writeonly 379define <4 x i32> @testi1(<4 x i32> returned %a, <4 x i32> %b, i32* nocapture %ap) local_unnamed_addr #0 { 380; CHECK-LABEL: testi1: 381; CHECK: # %bb.0: # %entry 382; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1 383; CHECK-NEXT: addi r3, r7, 12 384; CHECK-NEXT: stfiwx f0, 0, r3 385; CHECK-NEXT: blr 386; 387; CHECK-BE-LABEL: testi1: 388; CHECK-BE: # %bb.0: # %entry 389; CHECK-BE-NEXT: addi r3, r7, 12 390; CHECK-BE-NEXT: stxsiwx vs34, 0, r3 391; CHECK-BE-NEXT: blr 392; 393; CHECK-P9-LABEL: testi1: 394; CHECK-P9: # %bb.0: # %entry 395; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1 396; CHECK-P9-NEXT: addi r3, r7, 12 397; CHECK-P9-NEXT: stfiwx f0, 0, r3 398; CHECK-P9-NEXT: blr 399; 400; CHECK-P9-BE-LABEL: testi1: 401; CHECK-P9-BE: # %bb.0: # %entry 402; CHECK-P9-BE-NEXT: addi r3, r7, 12 403; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r3 404; CHECK-P9-BE-NEXT: blr 405entry: 406 %vecext = extractelement <4 x i32> %a, i32 1 407 %arrayidx = getelementptr inbounds i32, i32* %ap, i64 3 408 store i32 %vecext, i32* %arrayidx, align 4 409 ret <4 x i32> %a 410} 411 412; Function Attrs: norecurse nounwind writeonly 413define <4 x i32> @testi2(<4 x i32> returned %a, <4 x i32> %b, i32* nocapture %ap) local_unnamed_addr #0 { 414; CHECK-LABEL: testi2: 415; CHECK: # %bb.0: # %entry 416; CHECK-NEXT: addi r3, r7, 12 417; CHECK-NEXT: stxsiwx vs34, 0, r3 418; CHECK-NEXT: blr 419; 420; CHECK-BE-LABEL: testi2: 421; CHECK-BE: # %bb.0: # %entry 422; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 423; CHECK-BE-NEXT: addi r3, r7, 12 424; CHECK-BE-NEXT: stfiwx f0, 0, r3 425; CHECK-BE-NEXT: blr 426; 427; CHECK-P9-LABEL: testi2: 428; CHECK-P9: # %bb.0: # %entry 429; CHECK-P9-NEXT: addi r3, r7, 12 430; CHECK-P9-NEXT: stxsiwx vs34, 0, r3 431; CHECK-P9-NEXT: blr 432; 433; CHECK-P9-BE-LABEL: testi2: 434; CHECK-P9-BE: # %bb.0: # %entry 435; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 436; CHECK-P9-BE-NEXT: addi r3, r7, 12 437; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 438; CHECK-P9-BE-NEXT: blr 439entry: 440 %vecext = extractelement <4 x i32> %a, i32 2 441 %arrayidx = getelementptr inbounds i32, i32* %ap, i64 3 442 store i32 %vecext, i32* %arrayidx, align 4 443 ret <4 x i32> %a 444} 445 446; Function Attrs: norecurse nounwind writeonly 447define <4 x i32> @testi3(<4 x i32> returned %a, <4 x i32> %b, i32* nocapture %ap) local_unnamed_addr #0 { 448; CHECK-LABEL: testi3: 449; CHECK: # %bb.0: # %entry 450; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3 451; CHECK-NEXT: addi r3, r7, 12 452; CHECK-NEXT: stfiwx f0, 0, r3 453; CHECK-NEXT: blr 454; 455; CHECK-BE-LABEL: testi3: 456; CHECK-BE: # %bb.0: # %entry 457; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 458; CHECK-BE-NEXT: addi r3, r7, 12 459; CHECK-BE-NEXT: stfiwx f0, 0, r3 460; CHECK-BE-NEXT: blr 461; 462; CHECK-P9-LABEL: testi3: 463; CHECK-P9: # %bb.0: # %entry 464; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3 465; CHECK-P9-NEXT: addi r3, r7, 12 466; CHECK-P9-NEXT: stfiwx f0, 0, r3 467; CHECK-P9-NEXT: blr 468; 469; CHECK-P9-BE-LABEL: testi3: 470; CHECK-P9-BE: # %bb.0: # %entry 471; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 472; CHECK-P9-BE-NEXT: addi r3, r7, 12 473; CHECK-P9-BE-NEXT: stfiwx f0, 0, r3 474; CHECK-P9-BE-NEXT: blr 475entry: 476 %vecext = extractelement <4 x i32> %a, i32 3 477 %arrayidx = getelementptr inbounds i32, i32* %ap, i64 3 478 store i32 %vecext, i32* %arrayidx, align 4 479 ret <4 x i32> %a 480} 481 482define dso_local void @test_consecutive_i32(<4 x i32> %a, i32* nocapture %b) local_unnamed_addr #0 { 483; CHECK-LABEL: test_consecutive_i32: 484; CHECK: # %bb.0: # %entry 485; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2 486; CHECK-NEXT: li r3, 4 487; CHECK-NEXT: stxsiwx vs34, r5, r3 488; CHECK-NEXT: stfiwx f0, 0, r5 489; CHECK-NEXT: blr 490; 491; CHECK-BE-LABEL: test_consecutive_i32: 492; CHECK-BE: # %bb.0: # %entry 493; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 494; CHECK-BE-NEXT: xxsldwi vs1, vs34, vs34, 1 495; CHECK-BE-NEXT: li r3, 4 496; CHECK-BE-NEXT: stfiwx f0, 0, r5 497; CHECK-BE-NEXT: stfiwx f1, r5, r3 498; CHECK-BE-NEXT: blr 499; 500; CHECK-P9-LABEL: test_consecutive_i32: 501; CHECK-P9: # %bb.0: # %entry 502; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2 503; CHECK-P9-NEXT: li r3, 4 504; CHECK-P9-NEXT: stxsiwx vs34, r5, r3 505; CHECK-P9-NEXT: stfiwx f0, 0, r5 506; CHECK-P9-NEXT: blr 507; 508; CHECK-P9-BE-LABEL: test_consecutive_i32: 509; CHECK-P9-BE: # %bb.0: # %entry 510; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 511; CHECK-P9-BE-NEXT: li r3, 4 512; CHECK-P9-BE-NEXT: stfiwx f0, 0, r5 513; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 514; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3 515; CHECK-P9-BE-NEXT: blr 516entry: 517 518 %vecext = extractelement <4 x i32> %a, i32 0 519 store i32 %vecext, i32* %b, align 4 520 %vecext1 = extractelement <4 x i32> %a, i32 2 521 %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 1 522 store i32 %vecext1, i32* %arrayidx2, align 4 523 ret void 524} 525 526define dso_local void @test_consecutive_float(<4 x float> %a, float* nocapture %b) local_unnamed_addr #0 { 527; CHECK-LABEL: test_consecutive_float: 528; CHECK: # %bb.0: # %entry 529; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 1 530; CHECK-NEXT: xxsldwi vs1, vs34, vs34, 3 531; CHECK-NEXT: li r3, 4 532; CHECK-NEXT: stfiwx f0, 0, r5 533; CHECK-NEXT: stfiwx f1, r5, r3 534; CHECK-NEXT: blr 535; 536; CHECK-BE-LABEL: test_consecutive_float: 537; CHECK-BE: # %bb.0: # %entry 538; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 539; CHECK-BE-NEXT: li r3, 4 540; CHECK-BE-NEXT: stxsiwx vs34, 0, r5 541; CHECK-BE-NEXT: stfiwx f0, r5, r3 542; CHECK-BE-NEXT: blr 543; 544; CHECK-P9-LABEL: test_consecutive_float: 545; CHECK-P9: # %bb.0: # %entry 546; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1 547; CHECK-P9-NEXT: li r3, 4 548; CHECK-P9-NEXT: stfiwx f0, 0, r5 549; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3 550; CHECK-P9-NEXT: stfiwx f0, r5, r3 551; CHECK-P9-NEXT: blr 552; 553; CHECK-P9-BE-LABEL: test_consecutive_float: 554; CHECK-P9-BE: # %bb.0: # %entry 555; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 556; CHECK-P9-BE-NEXT: li r3, 4 557; CHECK-P9-BE-NEXT: stxsiwx vs34, 0, r5 558; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3 559; CHECK-P9-BE-NEXT: blr 560entry: 561 %vecext = extractelement <4 x float> %a, i32 1 562 store float %vecext, float* %b, align 4 563 %vecext1 = extractelement <4 x float> %a, i32 3 564 %arrayidx2 = getelementptr inbounds float, float* %b, i64 1 565 store float %vecext1, float* %arrayidx2, align 4 566 ret void 567} 568 569define dso_local void @test_stores_exceed_vec_size(<4 x i32> %a, i32* nocapture %b) local_unnamed_addr #0 { 570; CHECK-LABEL: test_stores_exceed_vec_size: 571; CHECK: # %bb.0: # %entry 572; CHECK-NEXT: addis r3, r2, .LCPI16_0@toc@ha 573; CHECK-NEXT: xxsldwi vs1, vs34, vs34, 1 574; CHECK-NEXT: li r4, 20 575; CHECK-NEXT: addi r3, r3, .LCPI16_0@toc@l 576; CHECK-NEXT: lvx v3, 0, r3 577; CHECK-NEXT: li r3, 16 578; CHECK-NEXT: vperm v3, v2, v2, v3 579; CHECK-NEXT: xxswapd vs0, vs35 580; CHECK-NEXT: stxvd2x vs0, 0, r5 581; CHECK-NEXT: stfiwx f1, r5, r3 582; CHECK-NEXT: stxsiwx vs34, r5, r4 583; CHECK-NEXT: blr 584; 585; CHECK-BE-LABEL: test_stores_exceed_vec_size: 586; CHECK-BE: # %bb.0: # %entry 587; CHECK-BE-NEXT: xxspltw vs0, vs34, 0 588; CHECK-BE-NEXT: xxsldwi vs1, vs34, vs34, 1 589; CHECK-BE-NEXT: li r3, 16 590; CHECK-BE-NEXT: li r4, 20 591; CHECK-BE-NEXT: stxsiwx vs34, r5, r3 592; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs0, 2 593; CHECK-BE-NEXT: stfiwx f1, r5, r4 594; CHECK-BE-NEXT: stxvw4x vs0, 0, r5 595; CHECK-BE-NEXT: blr 596; 597; CHECK-P9-LABEL: test_stores_exceed_vec_size: 598; CHECK-P9: # %bb.0: # %entry 599; CHECK-P9-NEXT: addis r3, r2, .LCPI16_0@toc@ha 600; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 1 601; CHECK-P9-NEXT: addi r3, r3, .LCPI16_0@toc@l 602; CHECK-P9-NEXT: lxvx vs35, 0, r3 603; CHECK-P9-NEXT: li r3, 16 604; CHECK-P9-NEXT: stfiwx f0, r5, r3 605; CHECK-P9-NEXT: li r3, 20 606; CHECK-P9-NEXT: stxsiwx vs34, r5, r3 607; CHECK-P9-NEXT: vperm v3, v2, v2, v3 608; CHECK-P9-NEXT: stxv vs35, 0(r5) 609; CHECK-P9-NEXT: blr 610; 611; CHECK-P9-BE-LABEL: test_stores_exceed_vec_size: 612; CHECK-P9-BE: # %bb.0: # %entry 613; CHECK-P9-BE-NEXT: xxspltw vs0, vs34, 0 614; CHECK-P9-BE-NEXT: li r3, 16 615; CHECK-P9-BE-NEXT: stxsiwx vs34, r5, r3 616; CHECK-P9-BE-NEXT: li r3, 20 617; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs0, 2 618; CHECK-P9-BE-NEXT: stxv vs0, 0(r5) 619; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 1 620; CHECK-P9-BE-NEXT: stfiwx f0, r5, r3 621; CHECK-P9-BE-NEXT: blr 622entry: 623 %vecext = extractelement <4 x i32> %a, i32 2 624 store i32 %vecext, i32* %b, align 4 625 %vecext1 = extractelement <4 x i32> %a, i32 3 626 %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 1 627 store i32 %vecext1, i32* %arrayidx2, align 4 628 %vecext3 = extractelement <4 x i32> %a, i32 0 629 %arrayidx4 = getelementptr inbounds i32, i32* %b, i64 2 630 store i32 %vecext3, i32* %arrayidx4, align 4 631 %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 3 632 store i32 %vecext3, i32* %arrayidx6, align 4 633 %vecext7 = extractelement <4 x i32> %a, i32 1 634 %arrayidx8 = getelementptr inbounds i32, i32* %b, i64 4 635 store i32 %vecext7, i32* %arrayidx8, align 4 636 %arrayidx10 = getelementptr inbounds i32, i32* %b, i64 5 637 store i32 %vecext, i32* %arrayidx10, align 4 638 ret void 639} 640 641define void @test_5_consecutive_stores_of_bytes(<16 x i8> %a, i8* nocapture %b) local_unnamed_addr #0 { 642; CHECK-LABEL: test_5_consecutive_stores_of_bytes: 643; CHECK: # %bb.0: # %entry 644; CHECK-NEXT: xxswapd vs0, vs34 645; CHECK-NEXT: mfvsrd r3, vs34 646; CHECK-NEXT: rldicl r6, r3, 32, 56 647; CHECK-NEXT: rldicl r3, r3, 56, 56 648; CHECK-NEXT: mffprd r4, f0 649; CHECK-NEXT: stb r6, 1(r5) 650; CHECK-NEXT: stb r3, 2(r5) 651; CHECK-NEXT: rldicl r6, r4, 32, 56 652; CHECK-NEXT: rldicl r3, r4, 8, 56 653; CHECK-NEXT: rldicl r4, r4, 16, 56 654; CHECK-NEXT: stb r6, 0(r5) 655; CHECK-NEXT: stb r3, 3(r5) 656; CHECK-NEXT: stb r4, 4(r5) 657; CHECK-NEXT: blr 658; 659; CHECK-BE-LABEL: test_5_consecutive_stores_of_bytes: 660; CHECK-BE: # %bb.0: # %entry 661; CHECK-BE-NEXT: xxswapd vs0, vs34 662; CHECK-BE-NEXT: mfvsrd r3, vs34 663; CHECK-BE-NEXT: rldicl r6, r3, 40, 56 664; CHECK-BE-NEXT: mffprd r4, f0 665; CHECK-BE-NEXT: stb r6, 0(r5) 666; CHECK-BE-NEXT: rldicl r6, r4, 40, 56 667; CHECK-BE-NEXT: rldicl r4, r4, 16, 56 668; CHECK-BE-NEXT: stb r6, 1(r5) 669; CHECK-BE-NEXT: clrldi r6, r3, 56 670; CHECK-BE-NEXT: rldicl r3, r3, 56, 56 671; CHECK-BE-NEXT: stb r4, 2(r5) 672; CHECK-BE-NEXT: stb r6, 3(r5) 673; CHECK-BE-NEXT: stb r3, 4(r5) 674; CHECK-BE-NEXT: blr 675; 676; CHECK-P9-LABEL: test_5_consecutive_stores_of_bytes: 677; CHECK-P9: # %bb.0: # %entry 678; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4 679; CHECK-P9-NEXT: li r3, 1 680; CHECK-P9-NEXT: stxsibx vs35, 0, r5 681; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12 682; CHECK-P9-NEXT: stxsibx vs35, r5, r3 683; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15 684; CHECK-P9-NEXT: li r3, 2 685; CHECK-P9-NEXT: stxsibx vs35, r5, r3 686; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1 687; CHECK-P9-NEXT: li r3, 3 688; CHECK-P9-NEXT: vsldoi v2, v2, v2, 2 689; CHECK-P9-NEXT: stxsibx vs35, r5, r3 690; CHECK-P9-NEXT: li r3, 4 691; CHECK-P9-NEXT: stxsibx vs34, r5, r3 692; CHECK-P9-NEXT: blr 693; 694; CHECK-P9-BE-LABEL: test_5_consecutive_stores_of_bytes: 695; CHECK-P9-BE: # %bb.0: # %entry 696; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13 697; CHECK-P9-BE-NEXT: li r3, 1 698; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5 699; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5 700; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 701; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2 702; CHECK-P9-BE-NEXT: li r3, 2 703; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 704; CHECK-P9-BE-NEXT: li r3, 3 705; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3 706; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 15 707; CHECK-P9-BE-NEXT: li r3, 4 708; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3 709; CHECK-P9-BE-NEXT: blr 710entry: 711 %vecext = extractelement <16 x i8> %a, i32 4 712 store i8 %vecext, i8* %b, align 1 713 %vecext1 = extractelement <16 x i8> %a, i32 12 714 %arrayidx2 = getelementptr inbounds i8, i8* %b, i64 1 715 store i8 %vecext1, i8* %arrayidx2, align 1 716 %vecext3 = extractelement <16 x i8> %a, i32 9 717 %arrayidx4 = getelementptr inbounds i8, i8* %b, i64 2 718 store i8 %vecext3, i8* %arrayidx4, align 1 719 %vecext5 = extractelement <16 x i8> %a, i32 7 720 %arrayidx6 = getelementptr inbounds i8, i8* %b, i64 3 721 store i8 %vecext5, i8* %arrayidx6, align 1 722 %vecext7 = extractelement <16 x i8> %a, i32 6 723 %arrayidx8 = getelementptr inbounds i8, i8* %b, i64 4 724 store i8 %vecext7, i8* %arrayidx8, align 1 725 ret void 726} 727 728define void @test_13_consecutive_stores_of_bytes(<16 x i8> %a, i8* nocapture %b) local_unnamed_addr #0 { 729; CHECK-LABEL: test_13_consecutive_stores_of_bytes: 730; CHECK: # %bb.0: # %entry 731; CHECK-NEXT: xxswapd vs0, vs34 732; CHECK-NEXT: mfvsrd r3, vs34 733; CHECK-NEXT: rldicl r4, r3, 32, 56 734; CHECK-NEXT: rldicl r6, r3, 56, 56 735; CHECK-NEXT: stb r4, 1(r5) 736; CHECK-NEXT: rldicl r4, r3, 40, 56 737; CHECK-NEXT: mffprd r7, f0 738; CHECK-NEXT: stb r6, 2(r5) 739; CHECK-NEXT: rldicl r6, r3, 24, 56 740; CHECK-NEXT: stb r4, 6(r5) 741; CHECK-NEXT: rldicl r4, r3, 8, 56 742; CHECK-NEXT: stb r6, 7(r5) 743; CHECK-NEXT: rldicl r3, r3, 16, 56 744; CHECK-NEXT: stb r4, 9(r5) 745; CHECK-NEXT: rldicl r4, r7, 32, 56 746; CHECK-NEXT: rldicl r6, r7, 8, 56 747; CHECK-NEXT: stb r3, 12(r5) 748; CHECK-NEXT: stb r4, 0(r5) 749; CHECK-NEXT: rldicl r4, r7, 16, 56 750; CHECK-NEXT: stb r6, 3(r5) 751; CHECK-NEXT: clrldi r6, r7, 56 752; CHECK-NEXT: stb r4, 4(r5) 753; CHECK-NEXT: rldicl r4, r7, 48, 56 754; CHECK-NEXT: stb r6, 5(r5) 755; CHECK-NEXT: rldicl r6, r7, 56, 56 756; CHECK-NEXT: stb r4, 8(r5) 757; CHECK-NEXT: rldicl r4, r7, 24, 56 758; CHECK-NEXT: stb r6, 10(r5) 759; CHECK-NEXT: stb r4, 11(r5) 760; CHECK-NEXT: blr 761; 762; CHECK-BE-LABEL: test_13_consecutive_stores_of_bytes: 763; CHECK-BE: # %bb.0: # %entry 764; CHECK-BE-NEXT: mfvsrd r3, vs34 765; CHECK-BE-NEXT: xxswapd vs0, vs34 766; CHECK-BE-NEXT: rldicl r4, r3, 40, 56 767; CHECK-BE-NEXT: clrldi r6, r3, 56 768; CHECK-BE-NEXT: stb r4, 0(r5) 769; CHECK-BE-NEXT: rldicl r4, r3, 56, 56 770; CHECK-BE-NEXT: mffprd r7, f0 771; CHECK-BE-NEXT: stb r6, 3(r5) 772; CHECK-BE-NEXT: rldicl r6, r3, 8, 56 773; CHECK-BE-NEXT: stb r4, 4(r5) 774; CHECK-BE-NEXT: rldicl r4, r3, 24, 56 775; CHECK-BE-NEXT: stb r6, 5(r5) 776; CHECK-BE-NEXT: rldicl r6, r3, 16, 56 777; CHECK-BE-NEXT: stb r4, 8(r5) 778; CHECK-BE-NEXT: rldicl r4, r7, 40, 56 779; CHECK-BE-NEXT: stb r6, 10(r5) 780; CHECK-BE-NEXT: rldicl r6, r7, 16, 56 781; CHECK-BE-NEXT: stb r4, 1(r5) 782; CHECK-BE-NEXT: rldicl r4, r7, 32, 56 783; CHECK-BE-NEXT: stb r6, 2(r5) 784; CHECK-BE-NEXT: rldicl r6, r7, 48, 56 785; CHECK-BE-NEXT: stb r4, 6(r5) 786; CHECK-BE-NEXT: clrldi r4, r7, 56 787; CHECK-BE-NEXT: stb r6, 7(r5) 788; CHECK-BE-NEXT: rldicl r3, r3, 48, 56 789; CHECK-BE-NEXT: rldicl r6, r7, 56, 56 790; CHECK-BE-NEXT: stb r4, 9(r5) 791; CHECK-BE-NEXT: stb r3, 11(r5) 792; CHECK-BE-NEXT: stb r6, 12(r5) 793; CHECK-BE-NEXT: blr 794; 795; CHECK-P9-LABEL: test_13_consecutive_stores_of_bytes: 796; CHECK-P9: # %bb.0: # %entry 797; CHECK-P9-NEXT: vsldoi v3, v2, v2, 12 798; CHECK-P9-NEXT: li r3, 1 799; CHECK-P9-NEXT: stxsibx vs35, r5, r3 800; CHECK-P9-NEXT: vsldoi v3, v2, v2, 15 801; CHECK-P9-NEXT: li r3, 2 802; CHECK-P9-NEXT: stxsibx vs35, r5, r3 803; CHECK-P9-NEXT: vsldoi v3, v2, v2, 1 804; CHECK-P9-NEXT: li r3, 3 805; CHECK-P9-NEXT: stxsibx vs35, r5, r3 806; CHECK-P9-NEXT: vsldoi v3, v2, v2, 2 807; CHECK-P9-NEXT: li r3, 4 808; CHECK-P9-NEXT: stxsibx vs35, r5, r3 809; CHECK-P9-NEXT: vsldoi v3, v2, v2, 4 810; CHECK-P9-NEXT: li r3, 5 811; CHECK-P9-NEXT: stxsibx vs35, 0, r5 812; CHECK-P9-NEXT: vsldoi v3, v2, v2, 8 813; CHECK-P9-NEXT: stxsibx vs35, r5, r3 814; CHECK-P9-NEXT: vsldoi v3, v2, v2, 13 815; CHECK-P9-NEXT: li r3, 6 816; CHECK-P9-NEXT: stxsibx vs35, r5, r3 817; CHECK-P9-NEXT: vsldoi v3, v2, v2, 11 818; CHECK-P9-NEXT: li r3, 7 819; CHECK-P9-NEXT: stxsibx vs35, r5, r3 820; CHECK-P9-NEXT: vsldoi v3, v2, v2, 6 821; CHECK-P9-NEXT: li r3, 8 822; CHECK-P9-NEXT: stxsibx vs35, r5, r3 823; CHECK-P9-NEXT: vsldoi v3, v2, v2, 9 824; CHECK-P9-NEXT: li r3, 9 825; CHECK-P9-NEXT: stxsibx vs35, r5, r3 826; CHECK-P9-NEXT: vsldoi v3, v2, v2, 7 827; CHECK-P9-NEXT: li r3, 10 828; CHECK-P9-NEXT: stxsibx vs35, r5, r3 829; CHECK-P9-NEXT: vsldoi v3, v2, v2, 3 830; CHECK-P9-NEXT: li r3, 11 831; CHECK-P9-NEXT: vsldoi v2, v2, v2, 10 832; CHECK-P9-NEXT: stxsibx vs35, r5, r3 833; CHECK-P9-NEXT: li r3, 12 834; CHECK-P9-NEXT: stxsibx vs34, r5, r3 835; CHECK-P9-NEXT: blr 836; 837; CHECK-P9-BE-LABEL: test_13_consecutive_stores_of_bytes: 838; CHECK-P9-BE: # %bb.0: # %entry 839; CHECK-P9-BE-NEXT: li r3, 3 840; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 5 841; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3 842; CHECK-P9-BE-NEXT: li r3, 1 843; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 844; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 2 845; CHECK-P9-BE-NEXT: li r3, 2 846; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 847; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 15 848; CHECK-P9-BE-NEXT: li r3, 4 849; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 850; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 13 851; CHECK-P9-BE-NEXT: li r3, 5 852; CHECK-P9-BE-NEXT: stxsibx vs35, 0, r5 853; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 9 854; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 855; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 4 856; CHECK-P9-BE-NEXT: li r3, 6 857; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 858; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 6 859; CHECK-P9-BE-NEXT: li r3, 7 860; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 861; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 11 862; CHECK-P9-BE-NEXT: li r3, 8 863; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 864; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 8 865; CHECK-P9-BE-NEXT: li r3, 9 866; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 867; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 10 868; CHECK-P9-BE-NEXT: li r3, 10 869; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 870; CHECK-P9-BE-NEXT: vsldoi v3, v2, v2, 14 871; CHECK-P9-BE-NEXT: li r3, 11 872; CHECK-P9-BE-NEXT: vsldoi v2, v2, v2, 7 873; CHECK-P9-BE-NEXT: stxsibx vs35, r5, r3 874; CHECK-P9-BE-NEXT: li r3, 12 875; CHECK-P9-BE-NEXT: stxsibx vs34, r5, r3 876; CHECK-P9-BE-NEXT: blr 877entry: 878 %vecext = extractelement <16 x i8> %a, i32 4 879 store i8 %vecext, i8* %b, align 1 880 %vecext1 = extractelement <16 x i8> %a, i32 12 881 %arrayidx2 = getelementptr inbounds i8, i8* %b, i64 1 882 store i8 %vecext1, i8* %arrayidx2, align 1 883 %vecext3 = extractelement <16 x i8> %a, i32 9 884 %arrayidx4 = getelementptr inbounds i8, i8* %b, i64 2 885 store i8 %vecext3, i8* %arrayidx4, align 1 886 %vecext5 = extractelement <16 x i8> %a, i32 7 887 %arrayidx6 = getelementptr inbounds i8, i8* %b, i64 3 888 store i8 %vecext5, i8* %arrayidx6, align 1 889 %vecext7 = extractelement <16 x i8> %a, i32 6 890 %arrayidx8 = getelementptr inbounds i8, i8* %b, i64 4 891 store i8 %vecext7, i8* %arrayidx8, align 1 892 %vecext9 = extractelement <16 x i8> %a, i32 0 893 %arrayidx10 = getelementptr inbounds i8, i8* %b, i64 5 894 store i8 %vecext9, i8* %arrayidx10, align 1 895 %vecext11 = extractelement <16 x i8> %a, i32 11 896 %arrayidx12 = getelementptr inbounds i8, i8* %b, i64 6 897 store i8 %vecext11, i8* %arrayidx12, align 1 898 %vecext13 = extractelement <16 x i8> %a, i32 13 899 %arrayidx14 = getelementptr inbounds i8, i8* %b, i64 7 900 store i8 %vecext13, i8* %arrayidx14, align 1 901 %vecext15 = extractelement <16 x i8> %a, i32 2 902 %arrayidx16 = getelementptr inbounds i8, i8* %b, i64 8 903 store i8 %vecext15, i8* %arrayidx16, align 1 904 %vecext17 = extractelement <16 x i8> %a, i32 15 905 %arrayidx18 = getelementptr inbounds i8, i8* %b, i64 9 906 store i8 %vecext17, i8* %arrayidx18, align 1 907 %vecext19 = extractelement <16 x i8> %a, i32 1 908 %arrayidx20 = getelementptr inbounds i8, i8* %b, i64 10 909 store i8 %vecext19, i8* %arrayidx20, align 1 910 %vecext21 = extractelement <16 x i8> %a, i32 5 911 %arrayidx22 = getelementptr inbounds i8, i8* %b, i64 11 912 store i8 %vecext21, i8* %arrayidx22, align 1 913 %vecext23 = extractelement <16 x i8> %a, i32 14 914 %arrayidx24 = getelementptr inbounds i8, i8* %b, i64 12 915 store i8 %vecext23, i8* %arrayidx24, align 1 916 ret void 917} 918 919define void @test_elements_from_two_vec(<4 x i32> %a, <4 x i32> %b, i32* nocapture %c) local_unnamed_addr #0 { 920; CHECK-LABEL: test_elements_from_two_vec: 921; CHECK: # %bb.0: # %entry 922; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 2 923; CHECK-NEXT: xxsldwi vs1, vs35, vs35, 1 924; CHECK-NEXT: li r3, 4 925; CHECK-NEXT: stfiwx f0, r7, r3 926; CHECK-NEXT: stfiwx f1, 0, r7 927; CHECK-NEXT: blr 928; 929; CHECK-BE-LABEL: test_elements_from_two_vec: 930; CHECK-BE: # %bb.0: # %entry 931; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 932; CHECK-BE-NEXT: li r3, 4 933; CHECK-BE-NEXT: stxsiwx vs35, 0, r7 934; CHECK-BE-NEXT: stfiwx f0, r7, r3 935; CHECK-BE-NEXT: blr 936; 937; CHECK-P9-LABEL: test_elements_from_two_vec: 938; CHECK-P9: # %bb.0: # %entry 939; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 2 940; CHECK-P9-NEXT: li r3, 4 941; CHECK-P9-NEXT: stfiwx f0, r7, r3 942; CHECK-P9-NEXT: xxsldwi vs0, vs35, vs35, 1 943; CHECK-P9-NEXT: stfiwx f0, 0, r7 944; CHECK-P9-NEXT: blr 945; 946; CHECK-P9-BE-LABEL: test_elements_from_two_vec: 947; CHECK-P9-BE: # %bb.0: # %entry 948; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 3 949; CHECK-P9-BE-NEXT: li r3, 4 950; CHECK-P9-BE-NEXT: stxsiwx vs35, 0, r7 951; CHECK-P9-BE-NEXT: stfiwx f0, r7, r3 952; CHECK-P9-BE-NEXT: blr 953entry: 954 %vecext = extractelement <4 x i32> %a, i32 0 955 %arrayidx = getelementptr inbounds i32, i32* %c, i64 1 956 store i32 %vecext, i32* %arrayidx, align 4 957 %vecext1 = extractelement <4 x i32> %b, i32 1 958 store i32 %vecext1, i32* %c, align 4 959 ret void 960} 961 962define dso_local void @test_elements_from_three_vec(<4 x float> %a, <4 x float> %b, <4 x float> %c, float* nocapture %d) local_unnamed_addr #0 { 963; CHECK-LABEL: test_elements_from_three_vec: 964; CHECK: # %bb.0: # %entry 965; CHECK-NEXT: xxsldwi vs0, vs34, vs34, 3 966; CHECK-NEXT: xxsldwi vs1, vs36, vs36, 1 967; CHECK-NEXT: li r3, 4 968; CHECK-NEXT: li r4, 8 969; CHECK-NEXT: stxsiwx vs35, r9, r3 970; CHECK-NEXT: stfiwx f0, 0, r9 971; CHECK-NEXT: stfiwx f1, r9, r4 972; CHECK-NEXT: blr 973; 974; CHECK-BE-LABEL: test_elements_from_three_vec: 975; CHECK-BE: # %bb.0: # %entry 976; CHECK-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 977; CHECK-BE-NEXT: xxsldwi vs1, vs35, vs35, 1 978; CHECK-BE-NEXT: li r3, 4 979; CHECK-BE-NEXT: li r4, 8 980; CHECK-BE-NEXT: stxsiwx vs36, r9, r4 981; CHECK-BE-NEXT: stfiwx f1, r9, r3 982; CHECK-BE-NEXT: stfiwx f0, 0, r9 983; CHECK-BE-NEXT: blr 984; 985; CHECK-P9-LABEL: test_elements_from_three_vec: 986; CHECK-P9: # %bb.0: # %entry 987; CHECK-P9-NEXT: xxsldwi vs0, vs34, vs34, 3 988; CHECK-P9-NEXT: li r3, 4 989; CHECK-P9-NEXT: stxsiwx vs35, r9, r3 990; CHECK-P9-NEXT: li r3, 8 991; CHECK-P9-NEXT: stfiwx f0, 0, r9 992; CHECK-P9-NEXT: xxsldwi vs0, vs36, vs36, 1 993; CHECK-P9-NEXT: stfiwx f0, r9, r3 994; CHECK-P9-NEXT: blr 995; 996; CHECK-P9-BE-LABEL: test_elements_from_three_vec: 997; CHECK-P9-BE: # %bb.0: # %entry 998; CHECK-P9-BE-NEXT: xxsldwi vs0, vs34, vs34, 2 999; CHECK-P9-BE-NEXT: li r3, 4 1000; CHECK-P9-BE-NEXT: stfiwx f0, 0, r9 1001; CHECK-P9-BE-NEXT: xxsldwi vs0, vs35, vs35, 1 1002; CHECK-P9-BE-NEXT: stfiwx f0, r9, r3 1003; CHECK-P9-BE-NEXT: li r3, 8 1004; CHECK-P9-BE-NEXT: stxsiwx vs36, r9, r3 1005; CHECK-P9-BE-NEXT: blr 1006entry: 1007 %vecext = extractelement <4 x float> %a, i32 3 1008 store float %vecext, float* %d, align 4 1009 %vecext1 = extractelement <4 x float> %b, i32 2 1010 %arrayidx2 = getelementptr inbounds float, float* %d, i64 1 1011 store float %vecext1, float* %arrayidx2, align 4 1012 %vecext3 = extractelement <4 x float> %c, i32 1 1013 %arrayidx4 = getelementptr inbounds float, float* %d, i64 2 1014 store float %vecext3, float* %arrayidx4, align 4 1015 ret void 1016} 1017