Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/PowerPC/fma.ll @ 83:60c9769439b8 LLVM3.7
LLVM 3.7
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Feb 2015 14:55:36 +0900 |
parents | 95c75e76d11b |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
78:af83660cff7b | 83:60c9769439b8 |
---|---|
1 ; RUN: llc < %s -march=ppc32 -fp-contract=fast | FileCheck %s | 1 ; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx | FileCheck %s |
2 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 | FileCheck -check-prefix=CHECK-VSX %s | |
3 | |
4 declare double @dummy1(double) #0 | |
5 declare double @dummy2(double, double) #0 | |
6 declare double @dummy3(double, double, double) #0 | |
2 | 7 |
3 define double @test_FMADD1(double %A, double %B, double %C) { | 8 define double @test_FMADD1(double %A, double %B, double %C) { |
4 %D = fmul double %A, %B ; <double> [#uses=1] | 9 %D = fmul double %A, %B ; <double> [#uses=1] |
5 %E = fadd double %D, %C ; <double> [#uses=1] | 10 %E = fadd double %C, %D ; <double> [#uses=1] |
6 ret double %E | 11 ret double %E |
7 ; CHECK-LABEL: test_FMADD1: | 12 ; CHECK-LABEL: test_FMADD1: |
8 ; CHECK: fmadd | 13 ; CHECK: fmadd |
9 ; CHECK-NEXT: blr | 14 ; CHECK-NEXT: blr |
15 | |
16 ; CHECK-VSX-LABEL: test_FMADD1: | |
17 ; CHECK-VSX: xsmaddmdp | |
18 ; CHECK-VSX-NEXT: blr | |
10 } | 19 } |
11 | 20 |
12 define double @test_FMADD2(double %A, double %B, double %C) { | 21 define double @test_FMADD2(double %A, double %B, double %C) { |
13 %D = fmul double %A, %B ; <double> [#uses=1] | 22 %D = fmul double %A, %B ; <double> [#uses=1] |
14 %E = fadd double %D, %C ; <double> [#uses=1] | 23 %E = fadd double %D, %C ; <double> [#uses=1] |
15 ret double %E | 24 ret double %E |
16 ; CHECK-LABEL: test_FMADD2: | 25 ; CHECK-LABEL: test_FMADD2: |
17 ; CHECK: fmadd | 26 ; CHECK: fmadd |
18 ; CHECK-NEXT: blr | 27 ; CHECK-NEXT: blr |
28 | |
29 ; CHECK-VSX-LABEL: test_FMADD2: | |
30 ; CHECK-VSX: xsmaddmdp | |
31 ; CHECK-VSX-NEXT: blr | |
19 } | 32 } |
20 | 33 |
21 define double @test_FMSUB(double %A, double %B, double %C) { | 34 define double @test_FMSUB1(double %A, double %B, double %C) { |
22 %D = fmul double %A, %B ; <double> [#uses=1] | 35 %D = fmul double %A, %B ; <double> [#uses=1] |
23 %E = fsub double %D, %C ; <double> [#uses=1] | 36 %E = fsub double %D, %C ; <double> [#uses=1] |
24 ret double %E | 37 ret double %E |
25 ; CHECK-LABEL: test_FMSUB: | 38 ; CHECK-LABEL: test_FMSUB1: |
26 ; CHECK: fmsub | 39 ; CHECK: fmsub |
27 ; CHECK-NEXT: blr | 40 ; CHECK-NEXT: blr |
41 | |
42 ; CHECK-VSX-LABEL: test_FMSUB1: | |
43 ; CHECK-VSX: xsmsubmdp | |
44 ; CHECK-VSX-NEXT: blr | |
45 } | |
46 | |
47 define double @test_FMSUB2(double %A, double %B, double %C, double %D) { | |
48 %E = fmul double %A, %B ; <double> [#uses=2] | |
49 %F = fadd double %E, %C ; <double> [#uses=1] | |
50 %G = fsub double %E, %D ; <double> [#uses=1] | |
51 %H = call double @dummy2(double %F, double %G) ; <double> [#uses=1] | |
52 ret double %H | |
53 ; CHECK-LABEL: test_FMSUB2: | |
54 ; CHECK: fmadd | |
55 ; CHECK-NEXT: fmsub | |
56 | |
57 ; CHECK-VSX-LABEL: test_FMSUB2: | |
58 ; CHECK-VSX: xsmaddadp | |
59 ; CHECK-VSX-NEXT: xsmsubmdp | |
28 } | 60 } |
29 | 61 |
30 define double @test_FNMADD1(double %A, double %B, double %C) { | 62 define double @test_FNMADD1(double %A, double %B, double %C) { |
31 %D = fmul double %A, %B ; <double> [#uses=1] | 63 %D = fmul double %A, %B ; <double> [#uses=1] |
32 %E = fadd double %D, %C ; <double> [#uses=1] | 64 %E = fadd double %D, %C ; <double> [#uses=1] |
33 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] | 65 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] |
34 ret double %F | 66 ret double %F |
35 ; CHECK-LABEL: test_FNMADD1: | 67 ; CHECK-LABEL: test_FNMADD1: |
36 ; CHECK: fnmadd | 68 ; CHECK: fnmadd |
37 ; CHECK-NEXT: blr | 69 ; CHECK-NEXT: blr |
70 | |
71 ; CHECK-VSX-LABEL: test_FNMADD1: | |
72 ; CHECK-VSX: xsnmaddmdp | |
73 ; CHECK-VSX-NEXT: blr | |
38 } | 74 } |
39 | 75 |
40 define double @test_FNMADD2(double %A, double %B, double %C) { | 76 define double @test_FNMADD2(double %A, double %B, double %C) { |
41 %D = fmul double %A, %B ; <double> [#uses=1] | 77 %D = fmul double %A, %B ; <double> [#uses=1] |
42 %E = fadd double %C, %D ; <double> [#uses=1] | 78 %E = fadd double %C, %D ; <double> [#uses=1] |
43 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] | 79 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] |
44 ret double %F | 80 ret double %F |
45 ; CHECK-LABEL: test_FNMADD2: | 81 ; CHECK-LABEL: test_FNMADD2: |
46 ; CHECK: fnmadd | 82 ; CHECK: fnmadd |
47 ; CHECK-NEXT: blr | 83 ; CHECK-NEXT: blr |
84 | |
85 ; CHECK-VSX-LABEL: test_FNMADD2: | |
86 ; CHECK-VSX: xsnmaddmdp | |
87 ; CHECK-VSX-NEXT: blr | |
48 } | 88 } |
49 | 89 |
50 define double @test_FNMSUB1(double %A, double %B, double %C) { | 90 define double @test_FNMSUB1(double %A, double %B, double %C) { |
51 %D = fmul double %A, %B ; <double> [#uses=1] | 91 %D = fmul double %A, %B ; <double> [#uses=1] |
52 %E = fsub double %C, %D ; <double> [#uses=1] | 92 %E = fsub double %C, %D ; <double> [#uses=1] |
53 ret double %E | 93 ret double %E |
54 ; CHECK-LABEL: test_FNMSUB1: | 94 ; CHECK-LABEL: test_FNMSUB1: |
55 ; CHECK: fnmsub | 95 ; CHECK: fnmsub |
56 ; CHECK-NEXT: blr | 96 ; CHECK-NEXT: blr |
97 | |
98 ; CHECK-VSX-LABEL: test_FNMSUB1: | |
99 ; CHECK-VSX: xsnmsubmdp | |
57 } | 100 } |
58 | 101 |
59 define double @test_FNMSUB2(double %A, double %B, double %C) { | 102 define double @test_FNMSUB2(double %A, double %B, double %C) { |
60 %D = fmul double %A, %B ; <double> [#uses=1] | 103 %D = fmul double %A, %B ; <double> [#uses=1] |
61 %E = fsub double %D, %C ; <double> [#uses=1] | 104 %E = fsub double %D, %C ; <double> [#uses=1] |
62 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] | 105 %F = fsub double -0.000000e+00, %E ; <double> [#uses=1] |
63 ret double %F | 106 ret double %F |
64 ; CHECK-LABEL: test_FNMSUB2: | 107 ; CHECK-LABEL: test_FNMSUB2: |
65 ; CHECK: fnmsub | 108 ; CHECK: fnmsub |
66 ; CHECK-NEXT: blr | 109 ; CHECK-NEXT: blr |
110 | |
111 ; CHECK-VSX-LABEL: test_FNMSUB2: | |
112 ; CHECK-VSX: xsnmsubmdp | |
113 ; CHECK-VSX-NEXT: blr | |
67 } | 114 } |
68 | 115 |
69 define float @test_FNMSUBS(float %A, float %B, float %C) { | 116 define float @test_FNMSUBS(float %A, float %B, float %C) { |
70 %D = fmul float %A, %B ; <float> [#uses=1] | 117 %D = fmul float %A, %B ; <float> [#uses=1] |
71 %E = fsub float %D, %C ; <float> [#uses=1] | 118 %E = fsub float %D, %C ; <float> [#uses=1] |
72 %F = fsub float -0.000000e+00, %E ; <float> [#uses=1] | 119 %F = fsub float -0.000000e+00, %E ; <float> [#uses=1] |
73 ret float %F | 120 ret float %F |
74 ; CHECK-LABEL: test_FNMSUBS: | 121 ; CHECK-LABEL: test_FNMSUBS: |
75 ; CHECK: fnmsubs | 122 ; CHECK: fnmsubs |
76 ; CHECK-NEXT: blr | 123 ; CHECK-NEXT: blr |
124 | |
125 ; CHECK-VSX-LABEL: test_FNMSUBS: | |
126 ; CHECK-VSX: fnmsubs | |
127 ; CHECK-VSX-NEXT: blr | |
77 } | 128 } |