1
2 #ifndef l_fma_4
3 #define l_fma_4
4
5 void __attribute__((sseregparm))
test_noneg_add_noneg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)6 test_noneg_add_noneg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
7 {
8 int i;
9 for (i = 0; i < n; i++)
10 d[i] = ((a[i] * b[i]) + c[i]) * b[i] + c[i];
11 }
12
13 void __attribute__((sseregparm))
test_noneg_add_noneg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)14 test_noneg_add_noneg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
15 {
16 int i;
17 for (i = 0; i < n; i++)
18 d[i] = ((a[i] * b[i]) + c[i]) * b[i] - c[i];
19 }
20
21 void __attribute__((sseregparm))
test_noneg_add_neg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)22 test_noneg_add_neg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
23 {
24 int i;
25 for (i = 0; i < n; i++)
26 d[i] = -((a[i] * b[i]) + c[i]) * b[i] + c[i];
27 }
28
29 void __attribute__((sseregparm))
test_noneg_add_neg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)30 test_noneg_add_neg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
31 {
32 int i;
33 for (i = 0; i < n; i++)
34 d[i] = -((a[i] * b[i]) + c[i]) * b[i] - c[i];
35 }
36
37 void __attribute__((sseregparm))
test_noneg_sub_noneg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)38 test_noneg_sub_noneg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
39 {
40 int i;
41 for (i = 0; i < n; i++)
42 d[i] = ((a[i] * b[i]) - c[i]) * b[i] + c[i];
43 }
44
45 void __attribute__((sseregparm))
test_noneg_sub_noneg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)46 test_noneg_sub_noneg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
47 {
48 int i;
49 for (i = 0; i < n; i++)
50 d[i] = ((a[i] * b[i]) - c[i]) * b[i] - c[i];
51 }
52
53 void __attribute__((sseregparm))
test_noneg_sub_neg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)54 test_noneg_sub_neg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
55 {
56 int i;
57 for (i = 0; i < n; i++)
58 d[i] = -((a[i] * b[i]) - c[i]) * b[i] + c[i];
59 }
60
61 void __attribute__((sseregparm))
test_noneg_sub_neg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)62 test_noneg_sub_neg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
63 {
64 int i;
65 for (i = 0; i < n; i++)
66 d[i] = -((a[i] * b[i]) - c[i]) * b[i] - c[i];
67 }
68
69 void __attribute__((sseregparm))
test_neg_add_noneg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)70 test_neg_add_noneg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
71 {
72 int i;
73 for (i = 0; i < n; i++)
74 d[i] = (-(a[i] * b[i]) + c[i]) * b[i] + c[i];
75 }
76
77 void __attribute__((sseregparm))
test_neg_add_noneg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)78 test_neg_add_noneg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
79 {
80 int i;
81 for (i = 0; i < n; i++)
82 d[i] = (-(a[i] * b[i]) + c[i]) * b[i] - c[i];
83 }
84
85 void __attribute__((sseregparm))
test_neg_add_neg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)86 test_neg_add_neg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
87 {
88 int i;
89 for (i = 0; i < n; i++)
90 d[i] = -(-(a[i] * b[i]) + c[i]) * b[i] + c[i];
91 }
92
93 void __attribute__((sseregparm))
test_neg_add_neg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)94 test_neg_add_neg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
95 {
96 int i;
97 for (i = 0; i < n; i++)
98 d[i] = -(-(a[i] * b[i]) + c[i]) * b[i] - c[i];
99 }
100
101 void __attribute__((sseregparm))
test_neg_sub_noneg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)102 test_neg_sub_noneg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
103 {
104 int i;
105 for (i = 0; i < n; i++)
106 d[i] = (-(a[i] * b[i]) - c[i]) * b[i] + c[i];
107 }
108
109 void __attribute__((sseregparm))
test_neg_sub_noneg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)110 test_neg_sub_noneg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
111 {
112 int i;
113 for (i = 0; i < n; i++)
114 d[i] = (-(a[i] * b[i]) - c[i]) * b[i] - c[i];
115 }
116
117 void __attribute__((sseregparm))
test_neg_sub_neg_add(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)118 test_neg_sub_neg_add (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
119 {
120 int i;
121 for (i = 0; i < n; i++)
122 d[i] = -(-(a[i] * b[i]) - c[i]) * b[i] + c[i];
123 }
124
125 void __attribute__((sseregparm))
test_neg_sub_neg_sub(TYPE * a,TYPE * b,TYPE * c,TYPE * d,int n)126 test_neg_sub_neg_sub (TYPE *a, TYPE *b, TYPE *c, TYPE *d, int n)
127 {
128 int i;
129 for (i = 0; i < n; i++)
130 d[i] = -(-(a[i] * b[i]) - c[i]) * b[i] - c[i];
131 }
132
133 #endif
134