2016-09-22 17:52:19 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -mcpu=pwr8 \
|
|
|
|
; RUN: -mtriple=powerpc64le-unknown-linux-gnu -O3 < %s | FileCheck %s
|
|
|
|
|
|
|
|
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -O3 \
|
|
|
|
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-P9 \
|
|
|
|
; RUN: --implicit-check-not xxswapd
|
|
|
|
|
|
|
|
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -O3 \
|
|
|
|
; RUN: -verify-machineinstrs -mattr=-power9-vector < %s | FileCheck %s
|
2015-07-22 05:40:17 +08:00
|
|
|
|
|
|
|
; These tests verify that VSX swap optimization works when loading a scalar
|
|
|
|
; into a vector register.
|
|
|
|
|
|
|
|
|
|
|
|
@x = global <2 x double> <double 9.970000e+01, double -1.032220e+02>, align 16
|
|
|
|
@z = global <2 x double> <double 2.332000e+01, double 3.111111e+01>, align 16
|
|
|
|
@y = global double 1.780000e+00, align 8
|
|
|
|
|
|
|
|
define void @bar0() {
|
|
|
|
entry:
|
|
|
|
%0 = load <2 x double>, <2 x double>* @x, align 16
|
|
|
|
%1 = load double, double* @y, align 8
|
|
|
|
%vecins = insertelement <2 x double> %0, double %1, i32 0
|
|
|
|
store <2 x double> %vecins, <2 x double>* @z, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @bar0
|
|
|
|
; CHECK-DAG: lxvd2x [[REG1:[0-9]+]]
|
2018-05-24 11:20:28 +08:00
|
|
|
; CHECK-DAG: lfdx [[REG2:[0-9]+]]
|
2015-11-11 05:38:26 +08:00
|
|
|
; CHECK: xxspltd [[REG4:[0-9]+]], [[REG2]], 0
|
2015-07-22 05:40:17 +08:00
|
|
|
; CHECK: xxpermdi [[REG5:[0-9]+]], [[REG4]], [[REG1]], 1
|
|
|
|
; CHECK: stxvd2x [[REG5]]
|
|
|
|
|
2016-09-22 17:52:19 +08:00
|
|
|
; CHECK-P9-LABEL: @bar0
|
2017-07-14 02:17:10 +08:00
|
|
|
; CHECK-P9-DAG: lxvx [[REG1:[0-9]+]]
|
2016-10-04 19:25:52 +08:00
|
|
|
; CHECK-P9-DAG: lfd [[REG2:[0-9]+]], 0(3)
|
2016-09-22 17:52:19 +08:00
|
|
|
; CHECK-P9: xxspltd [[REG4:[0-9]+]], [[REG2]], 0
|
2016-10-04 19:25:52 +08:00
|
|
|
; CHECK-P9: xxpermdi [[REG5:[0-9]+]], [[REG1]], [[REG4]], 1
|
2017-07-14 02:17:10 +08:00
|
|
|
; CHECK-P9: stxvx [[REG5]]
|
2016-09-22 17:52:19 +08:00
|
|
|
|
2015-07-22 05:40:17 +08:00
|
|
|
define void @bar1() {
|
|
|
|
entry:
|
|
|
|
%0 = load <2 x double>, <2 x double>* @x, align 16
|
|
|
|
%1 = load double, double* @y, align 8
|
|
|
|
%vecins = insertelement <2 x double> %0, double %1, i32 1
|
|
|
|
store <2 x double> %vecins, <2 x double>* @z, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @bar1
|
|
|
|
; CHECK-DAG: lxvd2x [[REG1:[0-9]+]]
|
2018-05-24 11:20:28 +08:00
|
|
|
; CHECK-DAG: lfdx [[REG2:[0-9]+]]
|
2015-11-11 05:38:26 +08:00
|
|
|
; CHECK: xxspltd [[REG4:[0-9]+]], [[REG2]], 0
|
2015-07-22 05:40:17 +08:00
|
|
|
; CHECK: xxmrghd [[REG5:[0-9]+]], [[REG1]], [[REG4]]
|
|
|
|
; CHECK: stxvd2x [[REG5]]
|
|
|
|
|
2016-09-22 17:52:19 +08:00
|
|
|
; CHECK-P9-LABEL: @bar1
|
2017-07-14 02:17:10 +08:00
|
|
|
; CHECK-P9-DAG: lxvx [[REG1:[0-9]+]]
|
2016-10-04 19:25:52 +08:00
|
|
|
; CHECK-P9-DAG: lfd [[REG2:[0-9]+]], 0(3)
|
2016-09-22 17:52:19 +08:00
|
|
|
; CHECK-P9: xxspltd [[REG4:[0-9]+]], [[REG2]], 0
|
2016-10-04 19:25:52 +08:00
|
|
|
; CHECK-P9: xxmrgld [[REG5:[0-9]+]], [[REG4]], [[REG1]]
|
2017-07-14 02:17:10 +08:00
|
|
|
; CHECK-P9: stxvx [[REG5]]
|
2016-09-22 17:52:19 +08:00
|
|
|
|