• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -O3 < %s | FileCheck %s
2
3; These tests verify that VSX swap optimization works for various
4; manipulations of <2 x double> vectors.
5
6@x = global <2 x double> <double 9.970000e+01, double -1.032220e+02>, align 16
7@z = global <2 x double> <double 2.332000e+01, double 3.111111e+01>, align 16
8
9define void @bar0(double %y) {
10entry:
11  %0 = load <2 x double>, <2 x double>* @x, align 16
12  %vecins = insertelement <2 x double> %0, double %y, i32 0
13  store <2 x double> %vecins, <2 x double>* @z, align 16
14  ret void
15}
16
17; CHECK-LABEL: @bar0
18; CHECK-DAG: lxvd2x [[REG1:[0-9]+]]
19; CHECK-DAG: xxspltd [[REG2:[0-9]+]]
20; CHECK: xxpermdi [[REG3:[0-9]+]], [[REG2]], [[REG1]], 1
21; CHECK: stxvd2x [[REG3]]
22; CHECK-NOT: xxswapd
23
24define void @bar1(double %y) {
25entry:
26  %0 = load <2 x double>, <2 x double>* @x, align 16
27  %vecins = insertelement <2 x double> %0, double %y, i32 1
28  store <2 x double> %vecins, <2 x double>* @z, align 16
29  ret void
30}
31
32; CHECK-LABEL: @bar1
33; CHECK-DAG: lxvd2x [[REG1:[0-9]+]]
34; CHECK-DAG: xxspltd [[REG2:[0-9]+]]
35; CHECK: xxmrghd [[REG3:[0-9]+]], [[REG1]], [[REG2]]
36; CHECK: stxvd2x [[REG3]]
37; CHECK-NOT: xxswapd
38
39define void @baz0() {
40entry:
41  %0 = load <2 x double>, <2 x double>* @z, align 16
42  %1 = load <2 x double>, <2 x double>* @x, align 16
43  %vecins = shufflevector <2 x double> %0, <2 x double> %1, <2 x i32> <i32 0, i32 2>
44  store <2 x double> %vecins, <2 x double>* @z, align 16
45  ret void
46}
47
48; CHECK-LABEL: @baz0
49; CHECK: lxvd2x
50; CHECK: lxvd2x
51; CHECK: xxmrghd
52; CHECK: stxvd2x
53; CHECK-NOT: xxswapd
54
55define void @baz1() {
56entry:
57  %0 = load <2 x double>, <2 x double>* @z, align 16
58  %1 = load <2 x double>, <2 x double>* @x, align 16
59  %vecins = shufflevector <2 x double> %0, <2 x double> %1, <2 x i32> <i32 3, i32 1>
60  store <2 x double> %vecins, <2 x double>* @z, align 16
61  ret void
62}
63
64; CHECK-LABEL: @baz1
65; CHECK: lxvd2x
66; CHECK: lxvd2x
67; CHECK: xxmrgld
68; CHECK: stxvd2x
69; CHECK-NOT: xxswapd
70
71