Files
Stefan Pintilie 98864f40a3 [PowerPC] Emit xscpsgndp instead of xxlor when copying floating point scalar registers for P9
This patch will address using the xscpsgndp instruction to copy floating point
scalar registers instead of the xxlor (specifically XXLORf) instruction that is
currently used. Additionally, this patch of utilizing xscpsgndp will apply to
P9, while pre-P9 will still use xxlor.

Patch by amyk

Differential Revision: https://reviews.llvm.org/D50004

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340643 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 20:00:24 +00:00

49 lines
1.4 KiB
LLVM

; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64le-unknown-linux-gnu -ppc-asm-full-reg-names < %s \
; RUN: | FileCheck %s
; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=+vsx -ppc-vsr-nums-as-vr \
; RUN: -mtriple=powerpc64-unknown-linux-gnu -ppc-asm-full-reg-names < %s \
; RUN: | FileCheck -check-prefix=CHECK-BE %s
; Function Attrs: norecurse nounwind readnone
define double @cp_fp1(<2 x double> %v) {
; CHECK-LABEL: cp_fp1:
; CHECK: xscpsgndp f1, v2, v2
; CHECK: blr
; CHECK-BE-LABEL: cp_fp1:
; CHECK-BE: xxswapd vs1, v2
; CHECK-BE: blr
entry:
%vecext = extractelement <2 x double> %v, i32 1
ret double %vecext
}
; Function Attrs: norecurse nounwind readnone
define double @cp_fp2(<2 x double> %v) {
; CHECK-LABEL: cp_fp2:
; CHECK: xxswapd vs1, v2
; CHECK: blr
; CHECK-BE-LABEL: cp_fp2:
; CHECK-BE: xscpsgndp f1, v2, v2
; CHECK-BE: blr
entry:
%vecext = extractelement <2 x double> %v, i32 0
ret double %vecext
}
; Function Attrs: norecurse nounwind readnone
define <2 x double> @cp_fp3(double %v) {
; CHECK-LABEL: cp_fp3:
; CHECK: xxspltd v2, vs1, 0
; CHECK: blr
; CHECK-BE-LABEL: cp_fp3:
; CHECK-BE: xscpsgndp v2, f1, f1
; CHECK-BE: blr
entry:
%vecins = insertelement <2 x double> undef, double %v, i32 0
ret <2 x double> %vecins
}