Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.4
 
1.5
 
MAIN:ragge:20090522081802
 
macdefs.h
_>125125 
 126126 /* Definitions mostly used in pass2 */
 127127 
<>128 -#define BYTEOFF(x)      ((x)&03)
  128+#define BYTEOFF(x)      ((x)&07)
129129 #define wdal(k)         (BYTEOFF(k)==0)
 130130 #define BITOOR(x)       (x)     /* bit offset to oreg offset XXX die! */
 131131 
     
 !
134134 #define STOSTARG(p)
 135135 #define genfcall(a,b)   gencall(a,b)
 136136 
<>137 -#define szty(t) (((t) == DOUBLE || (t) == FLOAT || (t) == LONG || \
 138 -        (t) == ULONG || (t) == LONGLONG || (t) == ULONGLONG) ? 2 : \
 139 -        (t) == LDOUBLE ? 4 : 1)
  137+/* How many integer registers are needed? */
  138+#define szty(t) (t == LDOUBLE ? 2 : 1)
140139 
 141140 /*
<>142 - * The x86 has a bunch of register classes, most of them interfering
 143 - * with each other.  All registers are given a sequential number to
  141+ * The amd64 architecture has a much cleaner interface to its registers
  142+ * than the x86, even though a part of the register block comes from
  143+ * the x86 architectureTherefore currently only two non-overlapping
  144+ * register classes are used; integer and xmm registers.
  145+ *
  146+ * All registers are given a sequential number to
144147  * identify it which must match rnames[] in local2.c.
<>145 - * Class membership and overlaps are defined in the macros RSTATUS
 146 - * and ROVERLAP below.
147148  *
<>148 - * The classes used on x86 are:
 149 - *      A - short and int regs
 150 - *      B - char regs
 151 - *      C - long long regs
 152 - *      D - floating point
  149+ * The classes used on amd64 are:
  150+ *      A - integer registers
  151+ *      B - xmm registers
153152  */
<>154 -#define EAX     000     /* Scratch and return register */
 155 -#define EDX     001     /* Scratch and secondary return register */
 156 -#define ECX     002     /* Scratch (and shift count) register */
 157 -#define EBX     003     /* GDT pointer or callee-saved temporary register */
 158 -#define ESI     004     /* Callee-saved temporary register */
 159 -#define EDI     005     /* Callee-saved temporary register */
 160 -#define EBP     006     /* Frame pointer */
 161 -#define ESP     007     /* Stack pointer */
  153+#define RAX     000
  154+#define RDX     001
  155+#define RCX     002
  156+#define RBX     003
  157+#define RSI     004
  158+#define RDI     005
  159+#define RBP     006
  160+#define RSP     007
  161+#define R08     010
  162+#define R09     011
  163+#define R10     012
  164+#define R11     013
  165+#define R12     014
  166+#define R13     015
  167+#define R14     016
  168+#define R15     017
162169 
<>163 -#define AL      010
 164 -#define AH      011
 165 -#define DL      012
 166 -#define DH      013
 167 -#define CL      014
 168 -#define CH      015
 169 -#define BL      016
 170 -#define BH      017
  170+#define XMM0    020
  171+#define XMM1    021
  172+#define XMM2    022
  173+#define XMM3    023
  174+#define XMM4    024
  175+#define XMM5    025
  176+#define XMM6    026
  177+#define XMM7    027
  178+#define XMM8    030
  179+#define XMM9    031
  180+#define XMM10   032
  181+#define XMM11   033
  182+#define XMM12   034
  183+#define XMM13   035
  184+#define XMM14   036
  185+#define XMM15   037
171186 
<>172 -#define RAX     020
 173 -#define RDX     021
 174 -#define RCX     022
 175 -#define RBX     023
 176 -#define RSI     024
 177 -#define RDI     025
 178 -#define RBP     026
 179 -#define RSP     027
 180 -#define R08     030
 181 -#define R09     031
 182 -#define R10     032
 183 -#define R11     033
 184 -#define R12     034
 185 -#define R13     035
 186 -#define R14     036
 187 -#define R15     037
  187+#define MAXREGS 040     /* 32 registers */
188188 
<>189 -#define EAXEDX  040
 190 -
 191 -/* The 8 math registers in class D lacks names */
 192 -
 193 -#define MAXREGS 051     /* 41 registers */
 194 -
195189 #define RSTATUS \
 196190         SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, SAREG|PERMREG,     \
 197191         SAREG|TEMPREG, SAREG|TEMPREG, 0, 0,                             \
<>198 -        SBREG, SBREG, SBREG, SBREG, SBREG, SBREG, SBREG, SBREG,         \
 199 -        SCREG, SCREG, SCREG, SCREG, SCREG, SCREG, 0, 0,                 \
 200 -        SCREG|TEMPREG, SCREG|TEMPREG, SCREG|TEMPREG, SCREG|TEMPREG,     \
 201 -        SCREG|PERMREG, SCREG|PERMREG, SCREG|PERMREG, SCREG|PERMREG,     \
 202 -        SCREG,                                                          \
 203 -        SDREG, SDREG, SDREG, SDREG,  SDREG, SDREG, SDREG, SDREG,
  192+        SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG,     \
  193+        SAREG|PERMREG, SAREG|PERMREG, SAREG|PERMREG, SAREG|PERMREG,     \
  194+        SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG,     \
  195+        SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG,     \
  196+        SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG,     \
  197+        SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG, SBREG|TEMPREG,
204198 
<> 199+/* no overlapping registers at all */
205200 #define ROVERLAP \
<>206 -        /* 8 basic registers */\
 207 -        { AL, AH, RAX, EAXEDX, -1 },\
 208 -        { DL, DH, RDX, EAXEDX, -1 },\
 209 -        { CL, CH, RCX, -1 },\
 210 -        { BL, BH, RBX, -1 },\
 211 -        { RSI, -1 },\
 212 -        { RDI, -1 },\
 213 -        { RBP, -1 },\
 214 -        { RSP, -1 },\
 215 -\
 216 -        /* 8 char registers */\
 217 -        { EAX, RAX, EAXEDX, -1 },\
 218 -        { EAX, RAX, EAXEDX, -1 },\
 219 -        { EDX, RDX, EAXEDX, -1 },\
 220 -        { EDX, RDX, EAXEDX, -1 },\
 221 -        { ECX, RCX, -1 },\
 222 -        { ECX, RCX, -1 },\
 223 -        { EBX, RBX, -1 },\
 224 -        { EBX, RBX, -1 },\
 225 -\
 226 -        /* 16 long-long registers */\
 227 -        { EAX, AL, AH, EAXEDX, -1 },\
 228 -        { EDX, DL, DH, EAXEDX, -1 },\
 229 -        { ECX, CL, CH, -1 },\
 230 -        { EBX, BL, BH, -1 },\
 231 -        { ESI, -1 },\
 232 -        { EDI, -1 },\
 233 -        { EBP, -1 },\
 234 -        { ESP, -1 },\
 235 -        { -1 },\
 236 -        { -1 },\
 237 -        { -1 },\
 238 -        { -1 },\
 239 -        { -1 },\
 240 -        { -1 },\
 241 -        { -1 },\
 242 -        { -1 },\
 243 -        { AL, AH, DL, DH, EAX, EDX, RAX, RDX },\
 244 -\
 245 -        /* The fp registers do not overlap with anything */\
 246 -        { -1 },\
 247 -        { -1 },\
 248 -        { -1 },\
 249 -        { -1 },\
 250 -        { -1 },\
 251 -        { -1 },\
 252 -        { -1 },\
 253 -        { -1 },
  201+        { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, \
  202+        { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, \
  203+        { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, \
  204+        { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 },
254205 
 255206 
 256207 /* Return a register class based on the type of the node */
<>257 -#define PCLASS(p) (p->n_type <= UCHAR ? SBREG : \
 258 -                  (p->n_type == LONG || p->n_type == ULONG || \
 259 -                   p->n_type == LONGLONG || p->n_type == ULONGLONG ? SCREG : \
 260 -                  (p->n_type >= FLOAT && p->n_type <= LDOUBLE ? SDREG : SAREG)))
  208+#define PCLASS(p) (p->n_type >= FLOAT && p->n_type <= LDOUBLE ? SBREG : SAREG)
261209 
<>262 -#define NUMCLASS        4       /* highest number of reg classes used */
  210+#define NUMCLASS        2       /* highest number of reg classes used */
263211 
 264212 int COLORMAP(int c, int *r);
<>265 -#define GCLASS(x) (x < 8 ? CLASSA : x < 16 ? CLASSB : x < 32 ? CLASSC : CLASSD)
  213+#define GCLASS(x) (x < 16 ? CLASSA : CLASSB)
266214 #define DECRA(x,y)      (((x) >> (y*8)) & 255)  /* decode encoded regs */
 267215 #define ENCRD(x)        (x)             /* Encode dest reg in n_reg */
 268216 #define ENCRA1(x)       ((x) << 8)      /* A1 */
 269217 #define ENCRA2(x)       ((x) << 16)     /* A2 */
 270218 #define ENCRA(x,y)      ((x) << (8+y*8))        /* encode regs in int */
<>271 -/* XXX - return char in al? */
 272 -#define RETREG(x)       (x == CHAR || x == UCHAR ? AL : \
 273 -                         x == LONG || x == ULONG || \
 274 -                         x == LONGLONG || x == ULONGLONG ? RAX : \
 275 -                         x == FLOAT || x == DOUBLE || x == LDOUBLE ? 32 : EAX)
276219 
<>277 -//#define R2REGS        1       /* permit double indexing */
  220+#define RETREG(x)       (x == FLOAT || x == DOUBLE || x == LDOUBLE ? XMM0 : RAX)
<_278221 
 279222 /* XXX - to die */
 280223 #define FPREG   RBP     /* frame pointer */
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-30 13:51 +0200