From f7bfa2e435c78917bd6df0c80e7e488751dac58c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Sep 2015 23:36:26 -0400 Subject: 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. --- lisc/lisc.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lisc/lisc.h') 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 *); -- cgit 1.4.1