OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c45531n.dep] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C45531N.DEP
2
 
3
--                             Grant of Unlimited Rights
4
--
5
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7
--     unlimited rights in the software and documentation contained herein.
8
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
9
--     this public release, the Government intends to confer upon all
10
--     recipients unlimited rights  equal to those held by the Government.
11
--     These rights include rights to use, duplicate, release or disclose the
12
--     released technical data and computer software in whole or in part, in
13
--     any manner and for any purpose whatsoever, and to have or permit others
14
--     to do so.
15
--
16
--                                    DISCLAIMER
17
--
18
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23
--     PARTICULAR PURPOSE OF SAID MATERIAL.
24
--*
25
-- OBJECTIVE:
26
--     CHECK THAT THE OPERATOR "/" PRODUCES CORRECT RESULTS
27
--     FOR MIXED FIXED POINT AND INTEGER TYPES USING 3 SUBTESTS.
28
--       THIS TEST REQUIRES MIN_WORD_LENGTH = 48.
29
--       THIS TEST USES VALUES OF DELTA WHICH ARE LESS THAN 0.5.
30
--
31
--     TEST CASES ARE:
32
--       A) FIXED / INTEGER WHEN ALL VALUES ARE MODEL NUMBERS.
33
--       B) FIXED / INTEGER WITH NUMERATOR MODEL NUMBER AND RESULT NOT.
34
--       C) FIXED / INTEGER FOR NON-MODEL NUMBERS.
35
--
36
--     REPEAT FOR MINIMUM REQUIRED WORD LENGTHS OF 12, 16, 32 AND 48,
37
--     WITH RANGE <, =, AND > THAN 1.0 AND
38
--     WITH DELTA <, =, AND > THAN 1.0.
39
 
40
-- APPLICABILITY CRITERIA:
41
--     THIS TEST IS APPLICABLE FOR IMPLEMENTATIONS WHICH HAVE A
42
--     'MAX_MANTISSA OF 47 OR GREATER.
43
 
44
--     IF 'MAX_MANTISSA >= 47 IS NOT SUPPORTED THEN THE DECLARATION OF
45
--     'TYPE FX_OP5' MUST BE REJECTED.
46
 
47
-- HISTORY:
48
--     NTW 09/08/86 CREATED ORIGINAL TEST.
49
--     RJW 11/05/86 REVISED COMMENTS.
50
--     DHH 01/13/88 ADDED APPLICABILITY CRITERIA AND STANDARD HEADER.
51
--     BCB 04/27/90 REVISED APPLICABILITY CRITERIA.
52
 
53
 
54
WITH REPORT;
55
PROCEDURE C45531N IS
56
 
57
     USE REPORT;
58
 
59
     MIN_WORD_LENGTH : CONSTANT := 48;
60
     FULL_SCALE      : CONSTANT := 2 ** (MIN_WORD_LENGTH - 1);
61
     FORTH           : CONSTANT := FULL_SCALE / 4;
62
     DEL1            : CONSTANT := 0.5 / FULL_SCALE;
63
     DEL2            : CONSTANT := 2.0 * DEL1;
64
     DEL4            : CONSTANT := 4.0 * DEL1;
65
     TYPE FX_0P5 IS DELTA DEL1 * 1 RANGE -0.5 .. 0.5 - DEL1 * 1;
66
                                                        -- N/A => ERROR.
67
     TYPE FX_1   IS DELTA DEL1 * 2 RANGE -1.0 .. 1.0 - DEL1 * 2;
68
     TYPE FX_2   IS DELTA DEL1 * 4 RANGE -2.0 .. 2.0 - DEL1 * 4;
69
 
70
BEGIN TEST ("C45531N", "MIXED FIXED POINT AND INTEGER ""/"" "
71
                     & "FOR RANGE <, =, > 1.0");
72
 
73
     --------------------------------------------------
74
 
75
     -- CASE A) FIXED / INTEGER WHEN ALL VALUES ARE MODEL NUMBERS.
76
 
77
A:   DECLARE
78
          A              : FX_0P5  := 0.0;
79
          B              : INTEGER := 0;
80
          RESULT_VALUE   : FX_0P5  := 0.0;
81
          LOWEST_ACCEPTABLE_VALUE  : FX_0P5 := FX_0P5 (3 * DEL1);
82
          HIGHEST_ACCEPTABLE_VALUE : FX_0P5 := FX_0P5 (3 * DEL1);
83
     BEGIN
84
          IF EQUAL (3, 3) THEN
85
               A := FX_0P5 (15 * DEL1);           -- A MODEL NUMBER
86
               B := 5;
87
          END IF;
88
 
89
          RESULT_VALUE := A / B;
90
 
91
          IF    (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
92
             OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
93
               FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL "
94
                    &  "FOR FIXED / INTEGER "
95
                    &  "WHEN ALL VALUES ARE MODEL NUMBERS");
96
          END IF;
97
     END A;
98
 
99
     --------------------------------------------------
100
 
101
     -- CASE B) FIXED / INTEGER WITH NUMERATOR MODEL NUMBER, RESULT NOT
102
 
103
B:   DECLARE
104
          A              : FX_1    := 0.0;
105
          B              : INTEGER := 0;
106
          RESULT_VALUE   : FX_1    := 0.0;
107
          LOWEST_ACCEPTABLE_VALUE  :  FX_1
108
                                   := FX_1 (DEL2 * FORTH );
109
          HIGHEST_ACCEPTABLE_VALUE :  FX_1
110
                                   := FX_1 (DEL2 * (FORTH + 1) );
111
     BEGIN
112
          IF EQUAL (3, 3) THEN                    -- A IS A MODEL NUMBER
113
               A := FX_1 (DEL2 * (3 * FORTH + 1) );
114
               B := 3;
115
          END IF;
116
 
117
          RESULT_VALUE := A / B;
118
 
119
          IF    (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
120
             OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
121
               FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL "
122
                    &  "FOR FIXED / INTEGER WITH NUMERATOR MODEL "
123
                    &  "NUMBER, RESULT NOT");
124
 
125
          END IF;
126
     END B;
127
 
128
     --------------------------------------------------
129
 
130
     -- CASE C) FIXED / INTEGER FOR NON-MODEL NUMBERS
131
 
132
C:   DECLARE
133
          A              : FX_2    := 0.0;
134
          B              : INTEGER := 0;
135
          RESULT_VALUE   : FX_2    := 0.0;
136
          LOWEST_ACCEPTABLE_VALUE  :  FX_2
137
                                   := FX_2 (DEL4 * FORTH );
138
          HIGHEST_ACCEPTABLE_VALUE :  FX_2
139
                                   := FX_2 (DEL4 * (FORTH + 1) );
140
     BEGIN
141
          IF EQUAL (3, 3) THEN                    -- A NOT MODEL NUMBER
142
               A := FX_2 (3 * (DEL4 * FORTH + DEL1) );
143
               B := 3;
144
          END IF;
145
 
146
          RESULT_VALUE := A / B;
147
 
148
          IF    (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
149
             OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
150
               FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL "
151
                    &  "FOR FIXED / INTEGER FOR NON-MODEL NUMBERS");
152
          END IF;
153
     END C;
154
 
155
     --------------------------------------------------
156
 
157
 
158
     RESULT;
159
 
160
END C45531N;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.