Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/* 	$Id: regable.c,v 1.1.1.1 1998/01/17 15:56:01 release Exp $	 */
32
 
33
#ifndef lint
34
static char vcid[] = "$Id: regable.c,v 1.1.1.1 1998/01/17 15:56:01 release Exp $";
35
#endif /* lint */
36
 
37
 
38
/*
39
   regable.c
40
*/
41
 
42
/*
43
$Log: regable.c,v $
44
 * Revision 1.1.1.1  1998/01/17  15:56:01  release
45
 * First version to be checked into rolling release.
46
 *
47
 * Revision 1.4  1996/01/17  09:30:47  john
48
 * Change for new caller access method
49
 *
50
 * Revision 1.3  1995/09/29  09:45:41  john
51
 * Added outpar
52
 *
53
 * Revision 1.2  1995/05/16  10:54:51  john
54
 * Cosmetic changes
55
 *
56
 * Revision 1.1.1.1  1995/03/23  10:39:19  john
57
 * Entered into CVS
58
 *
59
 * Revision 1.3  1995/03/17  10:12:11  john
60
 * Changed valregable, so bitfields can now be put into registers.
61
 *
62
*/
63
 
64
 
65
 
66
#include "config.h"
67
#include "expmacs.h"
68
#include "common_types.h"
69
#include "shapemacs.h"
70
#include "regable.h"
71
#include "tags.h"
72
 
73
 
74
bool valregable
75
    PROTO_N ( ( s ) )
76
    PROTO_T ( shape s )
77
{
78
  int n = name(s);
79
  if (is_floating (n)) {	
80
    /* check shape to see if floating point */
81
    return 0;
82
  }		
83
  else {
84
    ash a;
85
    a = ashof (s);		/* get ash corresponding to shape of e */
86
    return (a.ashsize <=64 && n!=cpdhd && n!= nofhd);
87
  }
88
}
89
 
90
 
91
/*
92
  fixregable
93
 
94
  determines whether the exp e can fit in a single fixed point 
95
  register. Uses macros isvis, isglob from expmacs.h which examine 
96
  the props field. 
97
*/
98
 
99
bool fixregable
100
    PROTO_N ( ( e ) )
101
    PROTO_T ( exp e )
102
{
103
  if (!isvis (e) && !isglob (e) && !isoutpar(e) && 
104
      name(son(e))!=caller_name_tag) {
105
    shape s = sh (son (e));	/* son of ident exp is def */
106
    return valregable (s);
107
  }		
108
  else {
109
    return 0;
110
  }
111
}
112
 
113
 
114
/*
115
  floatregable
116
 
117
  determines whether the exp e can fit in a floating point 
118
  register, single or double.
119
*/
120
bool floatregable
121
    PROTO_N ( ( e ) )
122
    PROTO_T ( exp e )
123
{
124
  if (!isvis (e) && !isglob (e) && !isoutpar(e) &&
125
      name(son(e))!=caller_name_tag) {
126
    shape s = sh (son (e));
127
    if (is_floating(name (s))) {
128
      return 1;
129
    }
130
    else {
131
      return 0;
132
    }	
133
  }	
134
  else {
135
    return 0;
136
  }	
137
}
138
 
139
 
140