xref: /llvm-project/llvm/test/CodeGen/PowerPC/p9_copy_fp.ll (revision f3846067991e30b38c3a42ee060a5251e04eb764)
1*f3846067SStefan Pintilie; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx -ppc-vsr-nums-as-vr \
2*f3846067SStefan Pintilie; RUN:     -mtriple=powerpc64le-unknown-linux-gnu -ppc-asm-full-reg-names < %s \
3*f3846067SStefan Pintilie; RUN:     | FileCheck %s
4*f3846067SStefan Pintilie; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx -ppc-vsr-nums-as-vr \
5*f3846067SStefan Pintilie; RUN:     -mtriple=powerpc64-unknown-linux-gnu -ppc-asm-full-reg-names < %s \
6*f3846067SStefan Pintilie; RUN:     | FileCheck -check-prefix=CHECK-BE %s
7*f3846067SStefan Pintilie
8*f3846067SStefan Pintilie; Function Attrs: norecurse nounwind readnone
9*f3846067SStefan Pintiliedefine double @cp_fp1(<2 x double> %v) {
10*f3846067SStefan Pintilie  ; CHECK-LABEL: cp_fp1:
11*f3846067SStefan Pintilie  ; CHECK: xscpsgndp f1, v2, v2
12*f3846067SStefan Pintilie  ; CHECK: blr
13*f3846067SStefan Pintilie
14*f3846067SStefan Pintilie  ; CHECK-BE-LABEL: cp_fp1:
15*f3846067SStefan Pintilie  ; CHECK-BE: xxswapd vs1, v2
16*f3846067SStefan Pintilie  ; CHECK-BE: blr
17*f3846067SStefan Pintilie  entry:
18*f3846067SStefan Pintilie    %vecext = extractelement <2 x double> %v, i32 1
19*f3846067SStefan Pintilie      ret double %vecext
20*f3846067SStefan Pintilie}
21*f3846067SStefan Pintilie
22*f3846067SStefan Pintilie; Function Attrs: norecurse nounwind readnone
23*f3846067SStefan Pintiliedefine double @cp_fp2(<2 x double> %v) {
24*f3846067SStefan Pintilie  ; CHECK-LABEL: cp_fp2:
25*f3846067SStefan Pintilie  ; CHECK:    xxswapd vs1, v2
26*f3846067SStefan Pintilie  ; CHECK:    blr
27*f3846067SStefan Pintilie
28*f3846067SStefan Pintilie  ; CHECK-BE-LABEL: cp_fp2:
29*f3846067SStefan Pintilie  ; CHECK-BE: xscpsgndp f1, v2, v2
30*f3846067SStefan Pintilie  ; CHECK-BE: blr
31*f3846067SStefan Pintilie  entry:
32*f3846067SStefan Pintilie    %vecext = extractelement <2 x double> %v, i32 0
33*f3846067SStefan Pintilie      ret double %vecext
34*f3846067SStefan Pintilie}
35*f3846067SStefan Pintilie
36*f3846067SStefan Pintilie; Function Attrs: norecurse nounwind readnone
37*f3846067SStefan Pintiliedefine <2 x double> @cp_fp3(double %v) {
38*f3846067SStefan Pintilie  ; CHECK-LABEL: cp_fp3:
39*f3846067SStefan Pintilie  ; CHECK:    xxspltd v2, vs1, 0
40*f3846067SStefan Pintilie  ; CHECK:    blr
41*f3846067SStefan Pintilie
42*f3846067SStefan Pintilie  ; CHECK-BE-LABEL: cp_fp3:
43*f3846067SStefan Pintilie  ; CHECK-BE: xscpsgndp v2, f1, f1
44*f3846067SStefan Pintilie  ; CHECK-BE: blr
45*f3846067SStefan Pintilie  entry:
46*f3846067SStefan Pintilie    %vecins = insertelement <2 x double> undef, double %v, i32 0
47*f3846067SStefan Pintilie      ret <2 x double> %vecins
48*f3846067SStefan Pintilie}
49