use general as pointer flag added
This commit is contained in:
parent
15449606d1
commit
23f2646704
|
@ -4,6 +4,7 @@ pointersize: 2
|
|||
general registers: 2
|
||||
address registers: 0
|
||||
floating point registers: 0
|
||||
use general as pointer: yes
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
|
|
@ -4,6 +4,7 @@ pointersize: 4
|
|||
general registers: 5
|
||||
address registers: 4
|
||||
floating point registers: 0
|
||||
use general as pointer: no
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
@ -69,7 +70,7 @@ opening cost parameters:
|
|||
register save costs:
|
||||
(11 cases)
|
||||
0 -> (0,0)
|
||||
1 -> (12,4)
|
||||
1 -> (12,6)
|
||||
2 -> (24,8)
|
||||
3 -> (34,8)
|
||||
4 -> (42,8)
|
||||
|
@ -102,4 +103,4 @@ do not eliminate sli if index on shiftcounts: 1 2 3 -1
|
|||
1 2 3 -1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: no
|
||||
global stack pollution allowed?: yes
|
||||
|
|
|
@ -4,6 +4,7 @@ pointersize: 4
|
|||
general registers: 5
|
||||
address registers: 4
|
||||
floating point registers: 0
|
||||
use general as pointer: no
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
|
|
@ -4,6 +4,7 @@ pointersize: 4
|
|||
general registers: 5
|
||||
address registers: 4
|
||||
floating point registers: 0
|
||||
use general as pointer: no
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
|
|
@ -4,6 +4,7 @@ pointersize: 2
|
|||
general registers: 2
|
||||
address registers: 0
|
||||
floating point registers: 0
|
||||
use general as pointer: yes
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
|
|
@ -4,6 +4,7 @@ pointersize: 4
|
|||
general registers: 8
|
||||
address registers: 0
|
||||
floating point registers: 0
|
||||
use general as pointer: yes
|
||||
|
||||
register score parameters:
|
||||
local variable:
|
||||
|
|
|
@ -52,6 +52,8 @@ short regs_available[] = {
|
|||
0 /* reg_float */
|
||||
} ;
|
||||
|
||||
short use_any_as_pointer = 0;
|
||||
|
||||
STATIC cond_p getcondtab(f)
|
||||
FILE *f;
|
||||
{
|
||||
|
@ -114,6 +116,7 @@ STATIC ra_machinit(f)
|
|||
fscanf(f,"%hd",®s_available[reg_any]);
|
||||
fscanf(f,"%hd",®s_available[reg_pointer]);
|
||||
fscanf(f,"%hd",®s_available[reg_float]);
|
||||
fscanf(f,"%hd",&use_any_as_pointer);
|
||||
get_atab(f,alocaltab);
|
||||
get_atab(f,alocaddrtab);
|
||||
aconsttab = getcondtab(f);
|
||||
|
|
|
@ -36,6 +36,9 @@ typedef struct time *time_p;
|
|||
|
||||
|
||||
extern short regs_available[]; /* contains #registers of every type */
|
||||
extern short use_any_as_pointer;/* indicates whether general registers
|
||||
can be used as pointers
|
||||
*/
|
||||
|
||||
|
||||
/* A thing that can be put in a register is called an "item". The are several
|
||||
|
|
|
@ -65,7 +65,7 @@ allocscore(itemtyp,localtyp,size,off,totyp,time_out,space_out)
|
|||
offset off;
|
||||
short *time_out, *space_out;
|
||||
{
|
||||
cond_p m;
|
||||
cond_p m = (cond_p) 0;
|
||||
|
||||
if (localtyp == reg_loop) localtyp = reg_any;
|
||||
if (size == ws || size ==ps && totyp == reg_pointer) {
|
||||
|
@ -74,7 +74,8 @@ allocscore(itemtyp,localtyp,size,off,totyp,time_out,space_out)
|
|||
m = alocaltab[localtyp][totyp];
|
||||
break;
|
||||
case LOCAL_ADDR:
|
||||
m = alocaddrtab[localtyp][totyp];
|
||||
if (use_any_as_pointer || totyp == reg_pointer)
|
||||
m = alocaddrtab[localtyp][totyp];
|
||||
break;
|
||||
case CONST:
|
||||
m = aconsttab;
|
||||
|
@ -83,14 +84,14 @@ allocscore(itemtyp,localtyp,size,off,totyp,time_out,space_out)
|
|||
m = aconsttab;
|
||||
break;
|
||||
case GLOBL_ADDR:
|
||||
m = aglobaltab;
|
||||
if (use_any_as_pointer || totyp == reg_pointer)
|
||||
m = aglobaltab;
|
||||
break;
|
||||
case PROC_ADDR:
|
||||
m = aproctab;
|
||||
if (use_any_as_pointer || totyp == reg_pointer)
|
||||
m = aproctab;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
m = (cond_p) 0;
|
||||
}
|
||||
*time_out = (m == (cond_p) 0 ? -1 : map_value(m,off,TRUE));
|
||||
*space_out = (m == (cond_p) 0 ? -1 : map_value(m,off,FALSE));
|
||||
|
|
Loading…
Reference in a new issue