; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix-xcoff \
; RUN: -fp-contract=fast -mattr=+vsx -disable-ppc-vsx-fma-mutation=false \
; RUN: -mcpu=pwr7 -vec-extabi | FileCheck -check-prefix=CHECK-VSX %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpcspe-linux-unknown-gnu \
+; RUN: | FileCheck -check-prefix=CHECK-SPE %s
define double @test_FMADD_ASSOC1(double %A, double %B, double %C,
; CHECK-LABEL: test_FMADD_ASSOC1:
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xsadddp 1, 0, 5
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdadd 4, 3, 5
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul double %A, %B ; <double> [#uses=1]
%G = fmul double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xsadddp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdadd 4, 5, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul double %A, %B ; <double> [#uses=1]
%G = fmul double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xssubdp 1, 0, 5
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 3, 5
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul double %A, %B ; <double> [#uses=1]
%G = fmul double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xssubdp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 5, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul double %A, %B ; <double> [#uses=1]
%G = fmul double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC_EXT1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdadd 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC_EXT2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdadd 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fmul float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC_EXT3:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdadd 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMADD_ASSOC_EXT4:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdadd 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fmul float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 3, 4
; CHECK-VSX-NEXT: xssubdp 1, 0, 5
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC_EXT1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdsub 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: fmadds 0, 1, 2, 0
; CHECK-VSX-NEXT: xssubdp 1, 0, 5
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC_EXT2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdsub 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fmul float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 3, 4
; CHECK-VSX-NEXT: xssubdp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC_EXT3:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: fmadds 0, 1, 2, 0
; CHECK-VSX-NEXT: xssubdp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_FMSUB_ASSOC_EXT4:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul float %A, %B ; <float> [#uses=1]
%G = fmul float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdadd 4, 3, 5
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdadd 4, 5, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xssubdp 1, 0, 5
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 3, 5
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC11:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 3, 5
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul contract reassoc double %A, %B ; <double> [#uses=1]
%G = fmul contract reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xssubdp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 5, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: xssubdp 1, 5, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_fast_FMSUB_ASSOC2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: evmergelo 9, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: evmergelo 3, 3, 4
+; CHECK-SPE-NEXT: efdmul 4, 7, 9
+; CHECK-SPE-NEXT: efdmul 3, 3, 5
+; CHECK-SPE-NEXT: evldd 5, 8(1)
+; CHECK-SPE-NEXT: efdadd 3, 3, 4
+; CHECK-SPE-NEXT: efdsub 4, 5, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc double %A, %B ; <double> [#uses=1]
%G = fmul reassoc double %C, %D ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC_EXT1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdadd 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC_EXT2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdadd 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fmul reassoc float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC_EXT3:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdadd 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMADD_ASSOC_EXT4:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdadd 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fmul reassoc float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmsubmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC_EXT1:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdsub 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsmaddadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC_EXT2:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdsub 4, 3, 4
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fmul reassoc float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsmaddmdp 1, 2, 5
; CHECK-VSX-NEXT: xsmaddadp 1, 0, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC_EXT3:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fpext float %F to double ; <double> [#uses=1]
; CHECK-VSX-NEXT: xsnmsubmdp 1, 2, 5
; CHECK-VSX-NEXT: xsnmsubadp 1, 3, 4
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_fast_FMSUB_ASSOC_EXT3:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 9, 10
+; CHECK-SPE-NEXT: evmergelo 7, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: evmergelo 5, 5, 6
+; CHECK-SPE-NEXT: efdmul 5, 5, 7
+; CHECK-SPE-NEXT: efdadd 3, 5, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
double %D, double %E) {
%F = fmul reassoc float %A, %B
%G = fpext float %F to double
; CHECK-VSX-NEXT: xsmaddadp 0, 1, 2
; CHECK-VSX-NEXT: fmr 1, 0
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_reassoc_FMSUB_ASSOC_EXT4:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul reassoc float %A, %B ; <float> [#uses=1]
%G = fmul reassoc float %C, %D ; <float> [#uses=1]
; CHECK-VSX-NEXT: xsnmsubadp 3, 1, 2
; CHECK-VSX-NEXT: fmr 1, 3
; CHECK-VSX-NEXT: blr
+;
+; CHECK-SPE-LABEL: test_fast_FMSUB_ASSOC_EXT4:
+; CHECK-SPE: # %bb.0:
+; CHECK-SPE-NEXT: efsmul 3, 3, 4
+; CHECK-SPE-NEXT: efsmul 4, 5, 6
+; CHECK-SPE-NEXT: efsadd 3, 3, 4
+; CHECK-SPE-NEXT: evmergelo 4, 7, 8
+; CHECK-SPE-NEXT: efdcfs 3, 3
+; CHECK-SPE-NEXT: efdsub 4, 4, 3
+; CHECK-SPE-NEXT: evmergehi 3, 4, 4
+; CHECK-SPE-NEXT: # kill: def $r4 killed $r4 killed $s4
+; CHECK-SPE-NEXT: # kill: def $r3 killed $r3 killed $s3
+; CHECK-SPE-NEXT: blr
float %D, double %E) {
%F = fmul reassoc float %A, %B
%G = fmul reassoc float %C, %D