Subversion Repositories tendra.SVN

Rev

Details | 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
/**********************************************************************
32
$Author: release $
33
$Date: 1998/01/17 15:56:06 $
34
$Revision: 1.1.1.1 $
35
$Log: regable.c,v $
36
 * Revision 1.1.1.1  1998/01/17  15:56:06  release
37
 * First version to be checked into rolling release.
38
 *
39
 * Revision 1.3  1995/12/12  09:02:19  currie
40
 * out_pars not regable
41
 *
42
 * Revision 1.2  1995/09/22  15:49:17  currie
43
 * added outpar
44
 *
45
 * Revision 1.1  1995/04/13  09:08:06  currie
46
 * Initial revision
47
 *
48
***********************************************************************/
49
/******************************************************************
50
		regable.c
51
 
52
******************************************************************/
53
 
54
 
55
#include "config.h"
56
#include "expmacs.h"
57
#include "common_types.h"
58
#include "shapemacs.h"
59
#include "tags.h"
60
#include "regable.h"
61
 
62
/***************************************************************
63
	fixregable
64
 
65
determines whether the exp e can fit in a single fixed point register. Uses
66
macros isvis, isglob, iscaonly from expmacs.h which examine the props
67
field. The iscaonly bit is set by proc independent if the tag is only used
68
by the contents operator or as the left hand side of an assignment. The
69
procedure also uses the macro is_floating from shapemacs.h which checks
70
the shape number is in the range for floating point shapes.
71
****************************************************************/
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)) {	/* check shape to see if floating point */
80
    return 0;
81
  }
82
  else {
83
    ash a;
84
    a = ashof (s);		/* get ash corresponding to shape of e */
85
 
86
/* ALTERATION #1 */
87
    return (a.ashsize <=32  && n!=cpdhd && n!= nofhd && n!=tophd);
88
 
89
  }
90
}
91
 
92
bool fixregable
93
    PROTO_N ( (e) )
94
    PROTO_T ( exp e )
95
{
96
  if (!isvis (e) && !isoutpar(e) && !isglob (e)
97
		&& name(son(e)) != caller_name_tag) {
98
    shape s = sh (son (e));	/* son of ident exp is def */
99
    return valregable (s);
100
  }
101
  else {
102
    return 0;
103
  }
104
}
105
 
106
/***************************************************************
107
	floatregable
108
 
109
determines whether the exp e can fit in a floating point register, single
110
or double.
111
***************************************************************/
112
 
113
bool floatregable
114
    PROTO_N ( (e) )
115
    PROTO_T ( exp e )
116
{
117
  if (!isvis (e) && !isoutpar(e) && !isglob (e)
118
	&& name(son(e)) != caller_name_tag) {
119
    shape s = sh (son (e));
120
    if is_floating
121
      (name (s)) {
122
      return 1;
123
      }
124
    else {
125
      return 0;
126
    }
127
  }
128
  else {
129
    return 0;
130
  }
131
}