source: rtems/c/src/ada-tests/support/fp.inc @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1--
2--  fp.inc
3--
4--  Macros to produce a large number of LOCAL floating point variables.  This
5--  preprocessing is necessary to insure that the variables are
6--  scoped properly and to avoid duplicating hundreds of lines
7--  of code.
8--
9--
10-- DEFICIENCIES: 
11--
12-- 1.  This currently does not address whether or not the CPU
13--     actually has hardware floating point.  It just does the work.
14--
15--  COPYRIGHT (c) 1989-1997.
16--  On-Line Applications Research Corporation (OAR).
17--
18--  The license and distribution terms for this file may in
19--  the file LICENSE in this distribution or at
20--  http://www.rtems.org/license/LICENSE.
21
22--
23-- private definitions for macro use
24--
25
26-- macro usage EPSILON()
27define(`EPSILON',`0.0005')
28
29-- macro usage FP_CHECK_ONE( value, base, factor )
30define(`FP_CHECK_ONE',`
31  if ( $1 - ( $2 + $3 ) ) > EPSILON or else ( $1 - ( $2 + $3 ) ) < - EPSILON then
32     UNSIGNED32_IO.PUT( TASK_INDEX );
33     TEXT_IO.PUT( ": $1 wrong -- (" );
34     FLOAT_IO.PUT( $1 );
35     TEXT_IO.PUT( " not " );
36     FLOAT_IO.PUT( $2 + $3 );
37     TEXT_IO.PUT_LINE( ")" );
38  end if
39'
40)
41
42-- macro usage FP_DECLARE
43define(`FP_DECLARE', `
44  FP01 : FLOAT :=  1.0;
45  FP02 : FLOAT :=  2.0;
46  FP03 : FLOAT :=  3.0;
47  FP04 : FLOAT :=  4.0;
48  FP05 : FLOAT :=  5.0;
49  FP06 : FLOAT :=  6.0;
50  FP07 : FLOAT :=  7.0;
51  FP08 : FLOAT :=  8.0;
52  FP09 : FLOAT :=  9.0;
53  FP10 : FLOAT := 10.0;
54  FP11 : FLOAT := 11.0;
55  FP12 : FLOAT := 12.0;
56  FP13 : FLOAT := 13.0;
57  FP14 : FLOAT := 14.0;
58  FP15 : FLOAT := 15.0;
59  FP16 : FLOAT := 16.0;
60  FP17 : FLOAT := 17.0;
61  FP18 : FLOAT := 18.0;
62  FP19 : FLOAT := 19.0;
63  FP20 : FLOAT := 20.0;
64  FP21 : FLOAT := 21.0;
65  FP22 : FLOAT := 22.0;
66  FP23 : FLOAT := 23.0;
67  FP24 : FLOAT := 24.0;
68  FP25 : FLOAT := 25.0;
69  FP26 : FLOAT := 26.0;
70  FP27 : FLOAT := 27.0;
71  FP28 : FLOAT := 28.0;
72  FP29 : FLOAT := 29.0;
73  FP30 : FLOAT := 30.0;
74  FP31 : FLOAT := 31.0;
75  FP32 : FLOAT := 32.0
76'
77)
78
79
80-- macro usage FP_LOAD( factor )
81define(`FP_LOAD',`
82  FP01 := FP01 + $1;
83  FP02 := FP02 + $1;
84  FP03 := FP03 + $1;
85  FP04 := FP04 + $1;
86  FP05 := FP05 + $1;
87  FP06 := FP06 + $1;
88  FP07 := FP07 + $1;
89  FP08 := FP08 + $1;
90  FP09 := FP09 + $1;
91  FP10 := FP10 + $1;
92  FP11 := FP11 + $1;
93  FP12 := FP12 + $1;
94  FP13 := FP13 + $1;
95  FP14 := FP14 + $1;
96  FP15 := FP15 + $1;
97  FP16 := FP16 + $1;
98  FP17 := FP17 + $1;
99  FP18 := FP18 + $1;
100  FP19 := FP19 + $1;
101  FP20 := FP20 + $1;
102  FP21 := FP21 + $1;
103  FP22 := FP22 + $1;
104  FP23 := FP23 + $1;
105  FP24 := FP24 + $1;
106  FP25 := FP25 + $1;
107  FP26 := FP26 + $1;
108  FP27 := FP27 + $1;
109  FP28 := FP28 + $1;
110  FP29 := FP29 + $1;
111  FP30 := FP30 + $1;
112  FP31 := FP31 + $1;
113  FP32 := FP32 + $1
114')
115
116-- macro usage FP_CHECK( factor )
117define(`FP_CHECK',`
118  FP_CHECK_ONE( FP01,  1.0, $1 );
119  FP_CHECK_ONE( FP02,  2.0, $1 );
120  FP_CHECK_ONE( FP03,  3.0, $1 );
121  FP_CHECK_ONE( FP04,  4.0, $1 );
122  FP_CHECK_ONE( FP05,  5.0, $1 );
123  FP_CHECK_ONE( FP06,  6.0, $1 );
124  FP_CHECK_ONE( FP07,  7.0, $1 );
125  FP_CHECK_ONE( FP08,  8.0, $1 );
126  FP_CHECK_ONE( FP09,  9.0, $1 );
127  FP_CHECK_ONE( FP10, 10.0, $1 );
128  FP_CHECK_ONE( FP11, 11.0, $1 );
129  FP_CHECK_ONE( FP12, 12.0, $1 );
130  FP_CHECK_ONE( FP13, 13.0, $1 );
131  FP_CHECK_ONE( FP14, 14.0, $1 );
132  FP_CHECK_ONE( FP15, 15.0, $1 );
133  FP_CHECK_ONE( FP16, 16.0, $1 );
134  FP_CHECK_ONE( FP17, 17.0, $1 );
135  FP_CHECK_ONE( FP18, 18.0, $1 );
136  FP_CHECK_ONE( FP19, 19.0, $1 );
137  FP_CHECK_ONE( FP20, 20.0, $1 );
138  FP_CHECK_ONE( FP21, 21.0, $1 );
139  FP_CHECK_ONE( FP22, 22.0, $1 );
140  FP_CHECK_ONE( FP23, 23.0, $1 );
141  FP_CHECK_ONE( FP24, 24.0, $1 );
142  FP_CHECK_ONE( FP25, 25.0, $1 );
143  FP_CHECK_ONE( FP26, 26.0, $1 );
144  FP_CHECK_ONE( FP27, 27.0, $1 );
145  FP_CHECK_ONE( FP28, 28.0, $1 );
146  FP_CHECK_ONE( FP29, 29.0, $1 );
147  FP_CHECK_ONE( FP30, 30.0, $1 );
148  FP_CHECK_ONE( FP31, 31.0, $1 );
149  FP_CHECK_ONE( FP32, 32.0, $1 )
150'
151)
Note: See TracBrowser for help on using the repository browser.