version 1.6, 2000/04/29 13:07:34
|
version 1.7, 2000/06/15 09:37:56
|
Line 100 typedef short Int16;
|
Line 100 typedef short Int16;
|
code gcc produces for the cpu_dep routine. |
code gcc produces for the cpu_dep routine. |
*/ |
*/ |
|
|
#define CPU_DEP2 register Label _alpha_docol asm("$9")=&&docol; \ |
/* if you change this, also change _DOCOL_LABEL below */ |
|
#define DO_BASE (&&docol) |
|
|
|
#define CPU_DEP2 register Label _alpha_docol asm("$9")=DO_BASE; \ |
register Label _alpha_ca; |
register Label _alpha_ca; |
|
|
#define CPU_DEP3 cpu_dep: asm("lda %0, 500(%1)":"=r"(_alpha_ca):"r"(_alpha_docol)); goto *_alpha_ca; |
#define CPU_DEP3 cpu_dep: asm("lda %0, 500(%1)":"=r"(_alpha_ca):"r"(_alpha_docol)); goto *_alpha_ca; |
Line 109 typedef short Int16;
|
Line 112 typedef short Int16;
|
|
|
|
|
/* CODE_ADDRESS is the address of the code jumped to through the code field */ |
/* CODE_ADDRESS is the address of the code jumped to through the code field */ |
#define CODE_ADDRESS(wa) ({Int32 *_wa=(Int32 *)(wa); \ |
#define CODE_ADDRESS(wa) ({ \ |
(_wa[0]&0xfc000000)==0x68000000 ? /*JMP?*/\ |
Int32 *_wa=(Int32 *)(wa); \ |
&&docol : \ |
(_wa[0]&0xfc000000)==0x68000000 ? /*JMP?*/\ |
&&docol+((Int16 *)_wa)[0]; }) |
DO_BASE : \ |
|
((((_wa[0]^((Int32 *)_CPU_DEP_LABEL)[0]) & 0xffff0000)==0 && \ |
|
((_wa[1]^((Int32 *)_CPU_DEP_LABEL)[1]) & 0xffffc000)==0 ) ? \ |
|
(DO_BASE+((Int16 *)_wa)[0]) : \ |
|
(Label)_wa); }) |
|
|
#define _CPU_DEP_LABEL (symbols[DOESJUMP]) |
#define _CPU_DEP_LABEL (symbols[DOESJUMP]) |
#define _DOCOL_LABEL (symbols[DOCOL]) |
#define _DOCOL_LABEL (symbols[DOCOL]) |
|
|
/* MAKE_CF creates an appropriate code field at the wa; ca is the code |
/* MAKE_CF creates an appropriate code field at the wa; ca is the code |
address. For the Alpha, this is a lda followed by a jmp (or just a |
address. For the Alpha, this is a lda followed by a jmp (or just a |
jmp, if ca==&&docol). We patch the jmp with a good hint (on the |
jmp, if ca==DO_BASE). We patch the jmp with a good hint (on the |
21064A this saves 5 cycles!) */ |
21064A this saves 5 cycles!) */ |
#define MAKE_CF(wa,ca) ({ \ |
#define MAKE_CF(wa,ca) ({ \ |
Int32 *_wa=(Int32 *)(wa); \ |
Int32 *_wa=(Int32 *)(wa); \ |
Label _ca=(Label)(ca); \ |
Label _ca=(Label)(ca); \ |
if (_ca==_DOCOL_LABEL) \ |
if (_ca==_DOCOL_LABEL) \ |
_wa[0]=(((0x1a<<26)|(31<<21)|(9<<16))| \ |
_wa[0]=(((0x1a<<26)|(31<<21)|(9<<16))| \ |
(((((Cell)_ca)-((Cell)_wa)-4) & 0xffff)>>2)); \ |
(((((Cell)_ca)-((Cell)_wa)-4) & 0xffff)>>2)); \ |
else { \ |
else { \ |
_wa[0]=((((Int32 *)_CPU_DEP_LABEL)[0] & 0xffff0000)| \ |
_wa[0]=((((Int32 *)_CPU_DEP_LABEL)[0] & 0xffff0000)| \ |
((((Cell)_ca)-((Cell)_DOCOL_LABEL)) & 0xffff)); \ |
((((Cell)_ca)-((Cell)_DOCOL_LABEL)) & 0xffff)); \ |
_wa[1]=((((Int32 *)_CPU_DEP_LABEL)[1] & 0xffffc000)| \ |
_wa[1]=((((Int32 *)_CPU_DEP_LABEL)[1] & 0xffffc000)| \ |
(((((Cell)_ca)-((Cell)_wa)-8) & 0xffff)>>2)); \ |
(((((Cell)_ca)-((Cell)_wa)-8) & 0xffff)>>2)); \ |
} \ |
} \ |
}) |
}) |
|
|
/* this is the point where the does code for the word with the xt cfa |
/* this is the point where the does code for the word with the xt cfa |
starts. Because the jump to the code field takes only one cell on |
starts. Because the jump to the code field takes only one cell on |
Line 142 typedef short Int16;
|
Line 149 typedef short Int16;
|
#define DOES_CODE(cfa) \ |
#define DOES_CODE(cfa) \ |
({ Int32 *_wa=(cfa); \ |
({ Int32 *_wa=(cfa); \ |
(_wa[0] == ((((Int32 *)_CPU_DEP_LABEL)[0] & 0xffff0000)| \ |
(_wa[0] == ((((Int32 *)_CPU_DEP_LABEL)[0] & 0xffff0000)| \ |
((((Cell)&&dodoes)-((Cell)&&docol)) & 0xffff)) && \ |
((((Cell)&&dodoes)-((Cell)DO_BASE)) & 0xffff)) && \ |
(_wa[1]&0xffffc000) == (((Int32 *)_CPU_DEP_LABEL)[1] & 0xffffc000)) \ |
(_wa[1]&0xffffc000) == (((Int32 *)_CPU_DEP_LABEL)[1] & 0xffffc000)) \ |
? DOES_CODE1(_wa) : 0; }) |
? DOES_CODE1(_wa) : 0; }) |
|
|