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

4.104.114.84.95
Last change on this file since cbb09503 was dc300df, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 3, 1997 at 6:37:40 PM

new file

  • Property mode set to 100644
File size: 3.8 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--  Copyright assigned to U.S. Government, 1994.
18--
19--  The license and distribution terms for this file may in
20--  the file LICENSE in this distribution or at
21--  http://www.OARcorp.com/rtems/license.html.
22--
23--  $Id$
24
25--
26-- private definitions for macro use
27--
28
29-- macro usage EPSILON()
30define(`EPSILON',`0.0005')
31
32-- macro usage FP_CHECK_ONE( value, base, factor )
33define(`FP_CHECK_ONE',`
34  if ( $1 - ( $2 + $3 ) ) > EPSILON or else ( $1 - ( $2 + $3 ) ) < - EPSILON then
35     UNSIGNED32_IO.PUT( TASK_INDEX );
36     TEXT_IO.PUT( ": $1 wrong -- (" );
37     FLOAT_IO.PUT( $1 );
38     TEXT_IO.PUT( " not " );
39     FLOAT_IO.PUT( $2 + $3 );
40     TEXT_IO.PUT_LINE( ")" );
41  end if
42'
43)
44
45-- macro usage FP_DECLARE
46define(`FP_DECLARE', `
47  FP01 : FLOAT :=  1.0;
48  FP02 : FLOAT :=  2.0;
49  FP03 : FLOAT :=  3.0;
50  FP04 : FLOAT :=  4.0;
51  FP05 : FLOAT :=  5.0;
52  FP06 : FLOAT :=  6.0;
53  FP07 : FLOAT :=  7.0;
54  FP08 : FLOAT :=  8.0;
55  FP09 : FLOAT :=  9.0;
56  FP10 : FLOAT := 10.0;
57  FP11 : FLOAT := 11.0;
58  FP12 : FLOAT := 12.0;
59  FP13 : FLOAT := 13.0;
60  FP14 : FLOAT := 14.0;
61  FP15 : FLOAT := 15.0;
62  FP16 : FLOAT := 16.0;
63  FP17 : FLOAT := 17.0;
64  FP18 : FLOAT := 18.0;
65  FP19 : FLOAT := 19.0;
66  FP20 : FLOAT := 20.0;
67  FP21 : FLOAT := 21.0;
68  FP22 : FLOAT := 22.0;
69  FP23 : FLOAT := 23.0;
70  FP24 : FLOAT := 24.0;
71  FP25 : FLOAT := 25.0;
72  FP26 : FLOAT := 26.0;
73  FP27 : FLOAT := 27.0;
74  FP28 : FLOAT := 28.0;
75  FP29 : FLOAT := 29.0;
76  FP30 : FLOAT := 30.0;
77  FP31 : FLOAT := 31.0;
78  FP32 : FLOAT := 32.0
79'
80)
81
82
83-- macro usage FP_LOAD( factor )
84define(`FP_LOAD',`
85  FP01 := FP01 + $1;
86  FP02 := FP02 + $1;
87  FP03 := FP03 + $1;
88  FP04 := FP04 + $1;
89  FP05 := FP05 + $1;
90  FP06 := FP06 + $1;
91  FP07 := FP07 + $1;
92  FP08 := FP08 + $1;
93  FP09 := FP09 + $1;
94  FP10 := FP10 + $1;
95  FP11 := FP11 + $1;
96  FP12 := FP12 + $1;
97  FP13 := FP13 + $1;
98  FP14 := FP14 + $1;
99  FP15 := FP15 + $1;
100  FP16 := FP16 + $1;
101  FP17 := FP17 + $1;
102  FP18 := FP18 + $1;
103  FP19 := FP19 + $1;
104  FP20 := FP20 + $1;
105  FP21 := FP21 + $1;
106  FP22 := FP22 + $1;
107  FP23 := FP23 + $1;
108  FP24 := FP24 + $1;
109  FP25 := FP25 + $1;
110  FP26 := FP26 + $1;
111  FP27 := FP27 + $1;
112  FP28 := FP28 + $1;
113  FP29 := FP29 + $1;
114  FP30 := FP30 + $1;
115  FP31 := FP31 + $1;
116  FP32 := FP32 + $1
117')
118
119-- macro usage FP_CHECK( factor )
120define(`FP_CHECK',`
121  FP_CHECK_ONE( FP01,  1.0, $1 );
122  FP_CHECK_ONE( FP02,  2.0, $1 );
123  FP_CHECK_ONE( FP03,  3.0, $1 );
124  FP_CHECK_ONE( FP04,  4.0, $1 );
125  FP_CHECK_ONE( FP05,  5.0, $1 );
126  FP_CHECK_ONE( FP06,  6.0, $1 );
127  FP_CHECK_ONE( FP07,  7.0, $1 );
128  FP_CHECK_ONE( FP08,  8.0, $1 );
129  FP_CHECK_ONE( FP09,  9.0, $1 );
130  FP_CHECK_ONE( FP10, 10.0, $1 );
131  FP_CHECK_ONE( FP11, 11.0, $1 );
132  FP_CHECK_ONE( FP12, 12.0, $1 );
133  FP_CHECK_ONE( FP13, 13.0, $1 );
134  FP_CHECK_ONE( FP14, 14.0, $1 );
135  FP_CHECK_ONE( FP15, 15.0, $1 );
136  FP_CHECK_ONE( FP16, 16.0, $1 );
137  FP_CHECK_ONE( FP17, 17.0, $1 );
138  FP_CHECK_ONE( FP18, 18.0, $1 );
139  FP_CHECK_ONE( FP19, 19.0, $1 );
140  FP_CHECK_ONE( FP20, 20.0, $1 );
141  FP_CHECK_ONE( FP21, 21.0, $1 );
142  FP_CHECK_ONE( FP22, 22.0, $1 );
143  FP_CHECK_ONE( FP23, 23.0, $1 );
144  FP_CHECK_ONE( FP24, 24.0, $1 );
145  FP_CHECK_ONE( FP25, 25.0, $1 );
146  FP_CHECK_ONE( FP26, 26.0, $1 );
147  FP_CHECK_ONE( FP27, 27.0, $1 );
148  FP_CHECK_ONE( FP28, 28.0, $1 );
149  FP_CHECK_ONE( FP29, 29.0, $1 );
150  FP_CHECK_ONE( FP30, 30.0, $1 );
151  FP_CHECK_ONE( FP31, 31.0, $1 );
152  FP_CHECK_ONE( FP32, 32.0, $1 )
153'
154)
Note: See TracBrowser for help on using the repository browser.