1 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -fp-contract=fast -mattr=-vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-VSX %s
4 define double @test_FMADD_EXT1(float %A, float %B, double %C) {
5 %D = fmul float %A, %B ; <float> [#uses=1]
6 %E = fpext float %D to double ; <double> [#uses=1]
7 %F = fadd double %E, %C ; <double> [#uses=1]
9 ; CHECK-LABEL: test_FMADD_EXT1:
13 ; CHECK-VSX-LABEL: test_FMADD_EXT1:
14 ; CHECK-VSX: xsmaddmdp
18 define double @test_FMADD_EXT2(float %A, float %B, double %C) {
19 %D = fmul float %A, %B ; <float> [#uses=1]
20 %E = fpext float %D to double ; <double> [#uses=1]
21 %F = fadd double %C, %E ; <double> [#uses=1]
23 ; CHECK-LABEL: test_FMADD_EXT2:
27 ; CHECK-VSX-LABEL: test_FMADD_EXT2:
28 ; CHECK-VSX: xsmaddmdp
32 define double @test_FMSUB_EXT1(float %A, float %B, double %C) {
33 %D = fmul float %A, %B ; <float> [#uses=1]
34 %E = fpext float %D to double ; <double> [#uses=1]
35 %F = fsub double %E, %C ; <double> [#uses=1]
37 ; CHECK-LABEL: test_FMSUB_EXT1:
41 ; CHECK-VSX-LABEL: test_FMSUB_EXT1:
42 ; CHECK-VSX: xsmsubmdp
46 define double @test_FMSUB_EXT2(float %A, float %B, double %C) {
47 %D = fmul float %A, %B ; <float> [#uses=1]
48 %E = fpext float %D to double ; <double> [#uses=1]
49 %F = fsub double %C, %E ; <double> [#uses=1]
51 ; CHECK-LABEL: test_FMSUB_EXT2:
55 ; CHECK-VSX-LABEL: test_FMSUB_EXT2:
56 ; CHECK-VSX: xsnmsubmdp
61 define double @test_FMSUB_EXT3(float %A, float %B, double %C) {
62 %D = fmul float %A, %B ; <float> [#uses=1]
63 %E = fsub float -0.000000e+00, %D ; <float> [#uses=1]
64 %F = fpext float %E to double ; <double> [#uses=1]
65 %G = fsub double %F, %C ; <double> [#uses=1]
67 ; CHECK-LABEL: test_FMSUB_EXT3:
72 ; CHECK-VSX-LABEL: test_FMSUB_EXT3:
73 ; CHECK-VSX: xsnmaddmdp
78 define double @test_FMSUB_EXT4(float %A, float %B, double %C) {
79 %D = fmul float %A, %B ; <float> [#uses=1]
80 %E = fpext float %D to double ; <double> [#uses=1]
81 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1]
82 %G = fsub double %F, %C ; <double> [#uses=1]
84 ; CHECK-LABEL: test_FMSUB_EXT4:
89 ; CHECK-VSX-LABEL: test_FMSUB_EXT4:
90 ; CHECK-VSX: xsnmaddmdp