2 |
7u83 |
1 |
/*
|
|
|
2 |
Copyright (c) 1993 Open Software Foundation, Inc.
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
All Rights Reserved
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
Permission to use, copy, modify, and distribute this software
|
|
|
9 |
and its documentation for any purpose and without fee is hereby
|
|
|
10 |
granted, provided that the above copyright notice appears in all
|
|
|
11 |
copies and that both the copyright notice and this permission
|
|
|
12 |
notice appear in supporting documentation.
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
|
|
|
16 |
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
|
17 |
PARTICULAR PURPOSE.
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
|
|
|
21 |
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
22 |
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
|
|
|
23 |
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
|
|
24 |
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
25 |
*/
|
|
|
26 |
|
|
|
27 |
/*
|
|
|
28 |
Crown Copyright (c) 1997
|
|
|
29 |
|
|
|
30 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
31 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
32 |
acting through the Defence Evaluation and Research Agency
|
|
|
33 |
(DERA). It is made available to Recipients with a
|
|
|
34 |
royalty-free licence for its use, reproduction, transfer
|
|
|
35 |
to other parties and amendment for any purpose not excluding
|
|
|
36 |
product development provided that any such use et cetera
|
|
|
37 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
38 |
|
|
|
39 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
40 |
reproduced upon any copies or amended versions of it;
|
|
|
41 |
|
|
|
42 |
(2) Any amended version of it shall be clearly marked to
|
|
|
43 |
show both the nature of and the organisation responsible
|
|
|
44 |
for the relevant amendment or amendments;
|
|
|
45 |
|
|
|
46 |
(3) Its onward transfer from a recipient to another
|
|
|
47 |
party shall be deemed to be that party's acceptance of
|
|
|
48 |
these conditions;
|
|
|
49 |
|
|
|
50 |
(4) DERA gives no warranty or assurance as to its
|
|
|
51 |
quality or suitability for any purpose and DERA accepts
|
|
|
52 |
no liability whatsoever in relation to any use to which
|
|
|
53 |
it may be put.
|
|
|
54 |
*/
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
/**********************************************************************
|
|
|
59 |
$Author: release $
|
|
|
60 |
$Date: 1998/02/04 15:49:05 $
|
|
|
61 |
$Revision: 1.2 $
|
|
|
62 |
$Log: record_bit.c,v $
|
|
|
63 |
* Revision 1.2 1998/02/04 15:49:05 release
|
|
|
64 |
* Added OSF copyright message.
|
|
|
65 |
*
|
|
|
66 |
* Revision 1.1.1.1 1998/01/17 15:55:57 release
|
|
|
67 |
* First version to be checked into rolling release.
|
|
|
68 |
*
|
|
|
69 |
* Revision 1.2 1996/10/04 16:03:46 pwe
|
|
|
70 |
* add banners and mod for PWE ownership
|
|
|
71 |
*
|
|
|
72 |
**********************************************************************/
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
#include "config.h"
|
|
|
76 |
#include "memtdf.h"
|
|
|
77 |
#include "codegen.h"
|
|
|
78 |
#include "geninst.h"
|
|
|
79 |
|
|
|
80 |
#include "myassert.h"
|
|
|
81 |
#include "maxminmacs.h"
|
|
|
82 |
#include "comment.h"
|
|
|
83 |
#include "muldvrem.h"
|
|
|
84 |
#include "proc.h"
|
|
|
85 |
#include "flags.h"
|
|
|
86 |
#include "translat.h"
|
|
|
87 |
#include "eval.h"
|
|
|
88 |
|
|
|
89 |
#include "makecode.h"
|
|
|
90 |
#include "frames.h"
|
|
|
91 |
#include "stack.h"
|
|
|
92 |
#include "label_ops.h"
|
|
|
93 |
#include "instruct.h"
|
|
|
94 |
#include "installglob.h"
|
|
|
95 |
#include "externs.h"
|
|
|
96 |
#include "tempdecs.h"
|
|
|
97 |
#include "diag_fns.h"
|
|
|
98 |
#include "oprators.h"
|
|
|
99 |
#include "record_bit.h"
|
|
|
100 |
|
|
|
101 |
#define CASE_RECORD_BIT and_tag:case plus_tag:case shr_tag
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
void try_record_bit PROTO_N ((e)) PROTO_T (exp e)
|
|
|
105 |
{
|
|
|
106 |
/* Tries to see if record bit can be used in this test_tag*/
|
|
|
107 |
exp l = son(e);
|
|
|
108 |
exp r = bro(l);
|
|
|
109 |
bool sgned = is_signed(sh(l));
|
|
|
110 |
|
|
|
111 |
if (name(r)==val_tag && optop(l) &&
|
|
|
112 |
no(r)==0 &&
|
|
|
113 |
!is_floating(name(sh(l))) &&
|
|
|
114 |
(sgned||test_number(e)==TEST_NE || test_number(e)==TEST_EQ)
|
|
|
115 |
/* The record bit is set as if the comparison where algebraic
|
|
|
116 |
however we can use TEST_NE and TEST_EQ as well since the
|
|
|
117 |
concept of equality is the same for signed and unsigned numbers
|
|
|
118 |
*/
|
|
|
119 |
)
|
|
|
120 |
{
|
|
|
121 |
switch(name(l))
|
|
|
122 |
{
|
|
|
123 |
case CASE_RECORD_BIT:
|
|
|
124 |
setrecordbit(l);
|
|
|
125 |
}
|
|
|
126 |
}
|
|
|
127 |
return;
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
bool record_bit_set PROTO_N ((e)) PROTO_T (exp e)
|
|
|
131 |
{
|
|
|
132 |
switch(name(e))
|
|
|
133 |
{
|
|
|
134 |
case CASE_RECORD_BIT:
|
|
|
135 |
return isrecordbit(e);
|
|
|
136 |
}
|
|
|
137 |
return 0;
|
|
|
138 |
}
|
|
|
139 |
|