diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-14 23:36:26 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:33 -0400 |
commit | f7bfa2e435c78917bd6df0c80e7e488751dac58c (patch) | |
tree | ff55a42ecc560ccde7af547b59c71b94afe6844b /lisc/lisc.h | |
parent | bad74e6dce897df9f21cea5bf0a32df298856351 (diff) | |
download | roux-f7bfa2e435c78917bd6df0c80e7e488751dac58c.tar.gz |
heavy modification of call handling
The IR generated by calls was very bulky because two instructions were used for marking the live range of a clobber. This patch attempts to store the information of what registers are use/def/clobber in the call instruction itself, this leads to more compact code (even more when we'll have SSE registers). However, I find that the amount of extra code needed is not really easonable. Fortunately it is not too invasive, thus if the complexity creeps in, it should be easy to revert.
Diffstat (limited to 'lisc/lisc.h')
-rw-r--r-- | lisc/lisc.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h index c85c521..ff80900 100644 --- a/lisc/lisc.h +++ b/lisc/lisc.h @@ -43,7 +43,8 @@ enum Reg { Tmp0, /* first non-reg temporary */ - NReg = R12 - RAX + 1 + NReg = R12 - RAX + 1, + NRSave = 9, }; enum { @@ -76,7 +77,8 @@ enum { RTmp, RCon, RSlot, - RTyp, + RAlt, + RCallm = 0x1000, NRef = (1<<14) - 1 }; @@ -85,7 +87,8 @@ enum { #define CON(x) (Ref){RCon, x} #define CON_Z CON(0) /* reserved zero constant */ #define SLOT(x) (Ref){RSlot, x} -#define TYP(x) (Ref){RTyp, x} +#define TYP(x) (Ref){RAlt, x} +#define CALL(x) (Ref){RAlt, x|RCallm} static inline int req(Ref a, Ref b) { return a.type == b.type && a.val == b.val; } @@ -274,6 +277,10 @@ void ssafix(Fn *, int); void filllive(Fn *); /* isel.c */ +extern int rsave[NRSave]; +uint64_t calldef(Ins, int *); +uint64_t calluse(Ins, int *); +uint64_t callclb(Ins, int *); int slota(int, int, int *); void isel(Fn *); |