Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 606

Show
Ignore:
Timestamp:
08/09/10 03:53:24 (14 years ago)
Author:
walter
Message:

more 64

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/backend/cgen.c

    r596 r606  
    279279 * Generate a MOV to,from register instruction. 
    280280 * Smart enough to dump redundant register moves, and segment 
    281281 * register moves. 
    282282 */ 
    283283 
    284284code *genmovreg(code *c,unsigned to,unsigned from) 
    285285{ 
    286286#if DEBUG 
    287287        if (to > ES || from > ES) 
    288288                printf("genmovreg(c = %p, to = %d, from = %d)\n",c,to,from); 
    289289#endif 
    290290        assert(to <= ES && from <= ES); 
    291291        if (to != from) 
    292292        { 
    293293                if (to == ES) 
    294294                        c = genregs(c,0x8E,0,from); 
    295295                else if (from == ES) 
    296296                        c = genregs(c,0x8C,0,to); 
    297297                else 
    298298                        c = genregs(c,0x89,from,to); 
     299                if (I64) 
     300                        code_orrex(c, REX_W); 
    299301        } 
    300302        return c; 
    301303} 
    302304 
    303305/************************** 
    304306 * Generate a jump instruction. 
    305307 */ 
    306308 
    307309code *genjmp(code *c,unsigned op,unsigned fltarg,block *targ) 
    308310{   code cs; 
    309311    code *cj; 
    310312    code *cnop; 
    311313 
    312314    cs.Iop = op & 0xFF; 
    313315    cs.Iflags = 0; 
    314316    cs.Irex = 0; 
    315317    if (op != JMP)                      /* if not already long branch   */ 
    316318          cs.Iflags = CFjmp16;          /* assume long branch for op = 0x7x */ 
    317319    cs.IFL2 = fltarg;                   /* FLblock (or FLcode)          */ 
    318320    cs.IEV2.Vblock = targ;              /* target block (or code)       */ 
  • branches/dmd-1.x/src/backend/cod1.c

    r596 r606  
    28042804                        {   /* Then symbol must be allocated on stack */ 
    28052805                            needframe = TRUE; 
    28062806                            break; 
    28072807                        } 
    28082808                    } 
    28092809                    else 
    28102810                    {   if (mfuncreg == 0)      /* if no registers left */ 
    28112811                        {   needframe = TRUE; 
    28122812                            break; 
    28132813                        } 
    28142814                    } 
    28152815                } 
    28162816            } 
    28172817        } 
    28182818  } 
    28192819#endif 
    28202820 
    28212821    retregs = regmask(e->Ety, tym1); 
    28222822 
    28232823    // If stack needs cleanup 
    2824     if (OTbinary(e->Eoper) && !typfunc(tym1) && 
     2824    if (OTbinary(e->Eoper) && 
     2825        (!typfunc(tym1) || I64) && 
    28252826      !(s && s->Sflags & SFLexit)) 
    28262827    { 
    28272828        if (tym1 == TYhfunc) 
    28282829        {   // Hidden parameter is popped off by the callee 
    28292830            c = genadjesp(c, -4); 
    28302831            stackpush -= 4; 
    28312832            if (numpara + numalign > 4) 
    28322833                c = genstackclean(c, numpara + numalign - 4, retregs); 
    28332834        } 
    28342835        else 
    28352836            c = genstackclean(c,numpara + numalign,retregs); 
    28362837    } 
    28372838    else 
    28382839    { 
    28392840        c = genadjesp(c,-numpara); 
    28402841        stackpush -= numpara; 
    28412842        if (numalign) 
    28422843            c = genstackclean(c,numalign,retregs); 
    28432844    } 
    28442845 
  • branches/dmd-1.x/src/backend/cod3.c

    r596 r606  
    20032003        } 
    20042004        else if (xlocalsize == REGSIZE && (!I16 || b->BC == BCret)) 
    20052005        {   mfuncreg &= ~mask[regx]; 
    20062006            c = gen1(c,0x58 + regx);                    // POP regx 
    20072007        } 
    20082008        else if (xlocalsize) 
    20092009        { 
    20102010            c = genc2(c,0x81,modregrm(3,0,SP),xlocalsize);      // ADD SP,xlocalsize 
    20112011            if (I64) 
    20122012                code_orrex(c, REX_W); 
    20132013        } 
    20142014    } 
    20152015    if (b->BC == BCret || b->BC == BCretexp) 
    20162016    { 
    20172017Lret: 
    20182018        op = tyfarfunc(tym) ? 0xCA : 0xC2; 
    20192019        if (tym == TYhfunc) 
    20202020        { 
    20212021            c = genc2(c,0xC2,0,4);                      // RET 4 
    20222022        } 
    2023         else if (!typfunc(tym) || Poffset == 0
     2023        else if (!typfunc(tym) || Poffset == 0 || I64
    20242024        {   op++;                                       // to a regular RET 
    20252025            c = gen1(c,op); 
    20262026        } 
    20272027        else 
    20282028        {   // Stack is always aligned on register size boundary 
    20292029            Poffset = (Poffset + (REGSIZE - 1)) & ~(REGSIZE - 1); 
    20302030            c = genc2(c,op,0,Poffset);          // RET Poffset 
    20312031        } 
    20322032    } 
    20332033 
    20342034Lopt: 
    20352035    // If last instruction in ce is ADD SP,imm, and first instruction 
    20362036    // in c sets SP, we can dump the ADD. 
    20372037    cr = code_last(ce); 
    20382038    if (cr && c && !I64) 
    20392039    { 
    20402040        if (cr->Iop == 0x81 && cr->Irm == modregrm(3,0,SP))     // if ADD SP,imm 
    20412041        { 
    20422042            if ( 
    20432043                c->Iop == 0xC9 ||                                  // LEAVE 
  • branches/dmd-1.x/src/backend/iasm.h

    r577 r606  
    1919// 
    2020// 
    2121 
    2222// This is for when the reg field of modregrm specifies which instruction it is 
    2323#define NUM_MASK        0x7 
    2424#define _0      (0x0 | _modrm)          // insure that some _modrm bit is set 
    2525#define _1      0x1                     // with _0 
    2626#define _2      0x2 
    2727#define _3      0x3 
    2828#define _4      0x4 
    2929#define _5      0x5 
    3030#define _6      0x6 
    3131#define _7      0x7 
    3232 
    3333#define _modrm  0x10 
    3434 
    3535#define _r      _modrm 
    3636#define _cb     _modrm 
    3737#define _cw     _modrm 
    3838#define _cd     _modrm 
     39#define _cq     _modrm 
    3940#define _cp     _modrm 
    4041#define _ib     0 
    4142#define _iw     0 
    4243#define _id     0 
    4344#define _rb     0 
    4445#define _rw     0 
    4546#define _rd     0 
    4647#define _16_bit 0x20 
    4748#define _32_bit 0x40 
    4849#define _64_bit 0x10000 
    4950#define _I386   0x80            // opcode is only for 386 and later 
    5051#define _16_bit_addr    0x100 
    5152#define _32_bit_addr    0x200 
    5253#define _fwait 0x400    // Add an FWAIT prior to the instruction opcode 
    5354#define _nfwait 0x800   // Do not add an FWAIT prior to the instruction 
    5455 
    5556#define MOD_MASK        0xF000  // Mod mask 
    5657#define _modsi          0x1000  // Instruction modifies SI 
    5758#define _moddx          0x2000  // Instruction modifies DX 
    5859#define _mod2           0x3000  // Instruction modifies second operand 
  • branches/dmd-1.x/src/backend/ptrntab.c

    r577 r606  
    795795        { 0x38, _r|_modnot1,            _rm8,   _r8 }, 
    796796        { 0x39, _r|_16_bit|_modnot1,    _rm16,  _r16 }, 
    797797        { 0x39, _r|_32_bit|_modnot1,    _rm32,  _r32 }, 
    798798        { 0x3a, _r|_modnot1,            _r8,    _rm8 }, 
    799799        { 0x3b, _r|_16_bit|_modnot1,    _r16,   _rm16 }, 
    800800        { 0x3b, _r|_32_bit|_modnot1,    _r32,   _rm32 }, 
    801801        { ASM_END, 0, 0, 0 } 
    802802}; 
    803803PTRNTAB2  aptb2CMPS[] = /* CMPS */ { 
    804804        { 0xa6, _modsidi,               _m8,    _m8 }, 
    805805        { 0xa7, _modsidi,       _m16,   _m16 }, 
    806806        { 0xa7, _modsidi,       _m32,   _m32 }, 
    807807        { ASM_END, 0, 0, 0 } 
    808808}; 
    809809PTRNTAB2  aptb2CMPXCHG[] = /* CMPXCHG */ { 
    810810        { 0xfb0, _I386 | _cb|_mod2,     _rm8,   _r8 }, 
    811811                                                // This is really a 486 only 
    812812                                                // instruction 
    813813        { 0xfb1, _I386 | _cw | _16_bit|_mod2,   _rm16,  _r16 }, 
    814814        { 0xfb1, _I386 | _cd | _32_bit|_mod2,   _rm32,  _r32 }, 
     815        { 0xfb1, _I386 | _cq | _64_bit|_mod2,   _rm64,  _r64 }, 
    815816        { ASM_END, 0, 0, 0 } 
    816817}; 
    817818PTRNTAB2  aptb2DIV[] = /* DIV */ { 
    818819        { 0xf6, _6,                     _al,            _rm8 }, 
    819820        { 0xf7, _6 | _16_bit | _moddx,          _ax,            _rm16 }, 
    820821        { 0xf7, _6 | _32_bit | _moddx,          _eax,           _rm32 }, 
    821822        { 0xf6, _6 | _modax,                    _rm8,           0 }, 
    822823        { 0xf7, _6 | _16_bit | _modaxdx,                _rm16,          0 }, 
    823824        { 0xf7, _6 | _32_bit | _modaxdx,                _rm32,          0 }, 
    824825        { ASM_END, 0, 0, 0 } 
    825826}; 
    826827PTRNTAB2  aptb2ENTER[] = /* ENTER */ { 
    827828        { 0xc8, _iw|_ib,        _imm16, _imm8 }, 
    828829        { ASM_END, 0, 0, 0 } 
    829830}; 
    830831PTRNTAB2  aptb2IDIV[] = /* IDIV */ { 
    831832        { 0xf6, _7,                     _al,            _rm8 }, 
    832833        { 0xf7, _7|_16_bit|_moddx,              _ax,            _rm16 }, 
    833834        { 0xf7, _7|_32_bit|_moddx,              _eax,           _rm32 }, 
    834835        { 0xf6, _7 | _modax,                    _rm8,           0 }, 
     
    891892        { ASM_END, 0, 0, 0 } 
    892893}; 
    893894PTRNTAB2  aptb2LSL[] = /* LSL */ { 
    894895        { 0x0f03,       _r|_16_bit,                     _r16,   _rm16 }, 
    895896        { 0x0f03,       _r|_32_bit,                     _r32,   _rm32 }, 
    896897        { ASM_END, 0, 0, 0 } 
    897898}; 
    898899 
    899900PTRNTAB2 aptb2MOV[] = /* MOV */ { 
    900901#if 0 // Let pinholeopt() do this 
    901902        { 0xa0, 0,              _al,            _moffs8         }, 
    902903        { 0xa1, _16_bit,        _ax,            _moffs16        }, 
    903904        { 0xa1, _32_bit,        _eax,           _moffs32        }, 
    904905        { 0xa2, 0,              _moffs8,        _al             }, 
    905906        { 0xa3, _16_bit,        _moffs16,       _ax             }, 
    906907        { 0xa3, _32_bit,        _moffs32,       _eax            }, 
    907908#endif 
    908909        { 0x88, _r,             _rm8,           _r8             }, 
    909910        { 0x89, _r|_16_bit,     _rm16,          _r16            }, 
    910911        { 0x89, _r|_32_bit,     _rm32,          _r32            }, 
     912        { 0x89, _r|_64_bit,     _rm64,          _r64            }, 
    911913        { 0x8a, _r,             _r8,            _rm8            }, 
    912914        { 0x8b, _r|_16_bit,     _r16,           _rm16           }, 
    913915        { 0x8b, _r|_32_bit,     _r32,           _rm32           }, 
     916        { 0x8b, _r|_64_bit,     _r64,           _rm64           }, 
    914917        { 0x8c, _r,             _rm16,          _seg|_ds|_es| _ss | _fs | _gs | _cs }, 
    915918        { 0x8e, _r,             _seg|_ds|_es|_ss|_fs|_gs|_cs,   _rm16 }, 
    916919        { 0xb0, _rb,            _r8 | _plus_r,  _imm8           }, 
    917920        { 0xb8, _rw | _16_bit,  _r16 | _plus_r, _imm16          }, 
    918921        { 0xb8, _rd|_32_bit,    _r32 | _plus_r, _imm32          }, 
    919922        { 0xc6, _cb,            _rm8,           _imm8           }, 
    920923        { 0xc7, _cw|_16_bit,    _rm16,          _imm16          }, 
    921924        { 0xc7, _cd|_32_bit,    _rm32,          _imm32          }, 
    922925#if 0 // Let pinholeopt() do this 
    923926        { 0xc6, _cb,            _moffs8,        _imm8           }, 
    924927        { 0xc7, _cw|_16_bit,    _moffs16,       _imm16          }, 
    925928        { 0xc7, _cd|_32_bit,    _moffs32,       _imm32          }, 
    926929#endif 
    927930        { 0x0f20,       _r,     _r32,           _special | _crn }, 
    928931        { 0x0f22,       _r,     _special|_crn,  _r32            }, 
    929932        { 0x0f21,       _r,     _r32,           _special | _drn }, 
    930933        { 0x0f23,       _r,     _special|_drn,  _r32            }, 
    931934        { 0x0f24,       _r,     _r32,           _special | _trn }, 
    932935        { 0x0f26,       _r,     _special|_trn,  _r32            }, 
    933936        { ASM_END, 0, 0, 0 } 
  • branches/dmd-1.x/src/backend/ty.h

    r579 r606  
    276276#else 
    277277/* Detect cpp function type (callee cleans up stack)    */ 
    278278#ifndef typfunc 
    279279#define typfunc(ty)     (tytab[(ty) & 0xFF] & TYFLcallstkc) 
    280280#endif 
    281281#endif 
    282282 
    283283/* Array to convert a type to its unsigned equivalent   */ 
    284284extern const tym_t tytouns[]; 
    285285#ifndef touns 
    286286#define touns(ty)       (tytouns[(ty) & 0xFF]) 
    287287#endif 
    288288 
    289289/* Determine if TYffunc or TYfpfunc (a far function) */ 
    290290#ifndef tyfarfunc 
    291291#define tyfarfunc(ty)   (tytab[(ty) & 0xFF] & TYFLfarfunc) 
    292292#endif 
    293293 
    294294// Determine if parameter can go in register for TYjfunc 
    295295#ifndef tyjparam 
    296 #define tyjparam(ty)    (tysize(ty) <= intsize && !tyfloating(ty) && tybasic(ty) != TYstruct && tybasic(ty) != TYarray) 
     296#define tyjparam(ty)    (tysize(ty) <= NPTRSIZE && !tyfloating(ty) && tybasic(ty) != TYstruct && tybasic(ty) != TYarray) 
    297297#endif 
    298298 
    299299/* Determine relaxed type       */ 
    300300#ifndef tyrelax 
    301301#define tyrelax(ty)     (_tyrelax[tybasic(ty)]) 
    302302#endif 
    303303 
    304304/* Array to give the 'relaxed' type for relaxed type checking   */ 
    305305extern unsigned char _tyrelax[]; 
    306306#define type_relax      (config.flags3 & CFG3relax)     // !=0 if relaxed type checking 
    307307#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS 
    308308#define type_semirelax  (config.flags3 & CFG3semirelax) // !=0 if semi-relaxed type checking 
    309309#else 
    310310#define type_semirelax  type_relax 
    311311#endif 
    312312 
    313313/* Determine functionally equivalent type       */ 
    314314extern unsigned char tyequiv[]; 
    315315 
    316316/* Give an ascii string for a type      */ 
  • branches/dmd-1.x/src/glue.c

    r592 r606  
    790790 
    791791    // Determine register assignments 
    792792    if (pi) 
    793793    { 
    794794        if (global.params.isX86_64) 
    795795        { 
    796796            // Order of assignment of pointer or integer parameters 
    797797            static const unsigned char argregs[6] = { DI,SI,DX,CX,R8,R9 }; 
    798798            int r = 0; 
    799799            int xmmcnt = XMM0; 
    800800 
    801801            for (int i = 0; i < pi; i++) 
    802802            {   Symbol *sp = params[i]; 
    803803                tym_t ty = tybasic(sp->Stype->Tty); 
    804804                // BUG: doesn't work for structs 
    805805                if (r < sizeof(argregs)/sizeof(argregs[0])) 
    806806                { 
    807807                    if (type_jparam(sp->Stype)) 
    808808                    { 
    809809                        sp->Sclass = SCfastpar; 
    810                         sp->Spreg = r
     810                        sp->Spreg = argregs[r]
    811811                        sp->Sfl = FLauto; 
    812812                        ++r; 
    813813                    } 
    814814                } 
    815815                if (xmmcnt < XMM7) 
    816816                { 
    817817                    if (tyfloating(ty) && tysize(ty) <= 8) 
    818818                    { 
    819819                        sp->Sclass = SCfastpar; 
    820820                        sp->Spreg = xmmcnt; 
    821821                        sp->Sfl = FLauto; 
    822822                        ++xmmcnt; 
    823823                    } 
    824824                } 
    825825            } 
    826826        } 
    827827        else 
    828828        { 
    829829            // First parameter goes in register 
    830830            Symbol *sp = params[0]; 
  • branches/dmd-1.x/src/iasm.c

    r596 r606  
    534534{ 
    535535    if (tok_value == toknum) 
    536536        asm_token();                    // scan past token 
    537537    else 
    538538        /* When we run out of tokens, asmtok is NULL. 
    539539         * But when this happens when a ';' was hit. 
    540540         */ 
    541541        asmerr(errnum, asmtok ? asmtok->toChars() : ";"); 
    542542} 
    543543 
    544544 
    545545/******************************* 
    546546 */ 
    547547 
    548548STATIC PTRNTAB asm_classify(OP *pop, OPND *popnd1, OPND *popnd2, OPND *popnd3, 
    549549        unsigned *pusNumops) 
    550550{ 
    551551        unsigned usNumops; 
    552552        unsigned usActual; 
    553553        PTRNTAB ptbRet = { NULL }; 
    554         opflag_t usFlags1 = 0 ; 
    555         opflag_t usFlags2 = 0; 
    556         opflag_t usFlags3 = 0; 
    557         PTRNTAB1 *pptb1; 
    558         PTRNTAB2 *pptb2; 
    559         PTRNTAB3 *pptb3; 
     554        opflag_t opflags1 = 0 ; 
     555        opflag_t opflags2 = 0; 
     556        opflag_t opflags3 = 0; 
    560557        char    bFake = FALSE; 
    561558 
    562559        unsigned char   bMatch1, bMatch2, bMatch3, bRetry = FALSE; 
    563560 
    564561        // How many arguments are there?  the parser is strictly left to right 
    565562        // so this should work. 
    566563 
    567564        if (!popnd1) 
    568565            usNumops = 0; 
    569566        else 
    570567        { 
    571             popnd1->usFlags = usFlags1 = asm_determine_operand_flags(popnd1); 
     568            popnd1->usFlags = opflags1 = asm_determine_operand_flags(popnd1); 
    572569            if (!popnd2) 
    573570                usNumops = 1; 
    574571            else 
    575572            { 
    576                 popnd2->usFlags = usFlags2 = asm_determine_operand_flags(popnd2); 
     573                popnd2->usFlags = opflags2 = asm_determine_operand_flags(popnd2); 
    577574                if (!popnd3) 
    578575                    usNumops = 2; 
    579576                else 
    580577                { 
    581                     popnd3->usFlags = usFlags3 = asm_determine_operand_flags(popnd3); 
     578                    popnd3->usFlags = opflags3 = asm_determine_operand_flags(popnd3); 
    582579                    usNumops = 3; 
    583580                } 
    584581            } 
    585582        } 
    586583 
    587584        // Now check to insure that the number of operands is correct 
    588585        usActual = (pop->usNumops & ITSIZE); 
    589586        if (usActual != usNumops && asmstate.ucItype != ITopt && 
    590587            asmstate.ucItype != ITfloat) 
    591588        { 
    592589PARAM_ERROR: 
    593590                asmerr(EM_nops_expected, usActual, asm_opstr(pop), usNumops); 
    594591        } 
    595592        if (usActual < usNumops) 
    596593            *pusNumops = usActual; 
    597594        else 
    598595            *pusNumops = usNumops; 
    599596// 
    600597//      The number of arguments matches, now check to find the opcode 
    601598//      in the associated opcode table 
    602599// 
    603600RETRY: 
    604601        //printf("usActual = %d\n", usActual); 
    605602        switch (usActual) 
    606603        { 
    607604            case 0: 
    608605                ptbRet = pop->ptb ; 
    609606                goto RETURN_IT; 
    610607 
    611608            case 1: 
    612                 //printf("usFlags1 = "); asm_output_flags(usFlags1); printf("\n"); 
    613                 for (pptb1 = pop->ptb.pptb1; pptb1->usOpcode != ASM_END; 
    614                         pptb1++) 
     609            {   //printf("opflags1 = "); asm_output_flags(opflags1); printf("\n"); 
     610                PTRNTAB1 *table1; 
     611                for (table1 = pop->ptb.pptb1; table1->usOpcode != ASM_END; 
     612                        table1++) 
    615613                { 
    616                         //printf("table    = "); asm_output_flags(pptb1->usOp1); printf("\n"); 
    617                         bMatch1 = asm_match_flags(usFlags1, pptb1->usOp1); 
     614                        //printf("table    = "); asm_output_flags(table1->usOp1); printf("\n"); 
     615                        bMatch1 = asm_match_flags(opflags1, table1->usOp1); 
    618616                        //printf("bMatch1 = x%x\n", bMatch1); 
    619617                        if (bMatch1) 
    620                         {   if (pptb1->usOpcode == 0x68 && 
     618                        {   if (table1->usOpcode == 0x68 && 
    621619                                !I16 && 
    622                                 pptb1->usOp1 == _imm16 
     620                                table1->usOp1 == _imm16 
    623621                              ) 
    624622                                // Don't match PUSH imm16 in 32 bit code 
    625623                                continue; 
    626624                            break; 
    627625                        } 
    628626                        if ((asmstate.ucItype == ITimmed) && 
    629                             asm_match_flags(usFlags1, 
     627                            asm_match_flags(opflags1, 
    630628                                CONSTRUCT_FLAGS(_8 | _16 | _32, _imm, _normal, 
    631629                                                 0)) && 
    632                                 popnd1->disp == pptb1->usFlags) 
     630                                popnd1->disp == table1->usFlags) 
    633631                            break; 
    634632                        if ((asmstate.ucItype == ITopt || 
    635633                             asmstate.ucItype == ITfloat) && 
    636634                            !usNumops && 
    637                             !pptb1->usOp1) 
     635                            !table1->usOp1) 
    638636                        { 
    639637                            if (usNumops > 1) 
    640638                                goto PARAM_ERROR; 
    641639                            break; 
    642640                        } 
    643641                } 
    644                 if (pptb1->usOpcode == ASM_END) 
     642                if (table1->usOpcode == ASM_END) 
    645643                { 
    646644#ifdef DEBUG 
    647645                    if (debuga) 
    648646                    {   printf("\t%s\t", asm_opstr(pop)); 
    649647                        if (popnd1) 
    650648                                asm_output_popnd(popnd1); 
    651649                        if (popnd2) { 
    652650                                printf(","); 
    653651                                asm_output_popnd(popnd2); 
    654652                        } 
    655653                        if (popnd3) { 
    656654                                printf(","); 
    657655                                asm_output_popnd(popnd3); 
    658656                        } 
    659657                        printf("\n"); 
    660658 
    661659                        printf("OPCODE mism = "); 
    662660                        if (popnd1) 
    663661                            asm_output_flags(popnd1->usFlags); 
    664662                        else 
    665663                            printf("NONE"); 
    666664                        printf("\n"); 
    667665                    } 
    668666#endif 
    669667TYPE_SIZE_ERROR: 
    670668                        if (popnd1 && ASM_GET_aopty(popnd1->usFlags) != _reg) 
    671669                        { 
    672                             usFlags1 = popnd1->usFlags |= _anysize; 
     670                            opflags1 = popnd1->usFlags |= _anysize; 
    673671                            if (asmstate.ucItype == ITjump) 
    674672                            { 
    675673                                if (bRetry && popnd1->s && !popnd1->s->isLabel()) 
    676674                                { 
    677675                                    asmerr(EM_label_expected, popnd1->s->toChars()); 
    678676                                } 
    679677 
    680678                                popnd1->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    681679                                        _fanysize); 
    682680                            } 
    683681                        } 
    684682                        if (popnd2 && ASM_GET_aopty(popnd2->usFlags) != _reg) { 
    685                             usFlags2 = popnd2->usFlags |= (_anysize); 
     683                            opflags2 = popnd2->usFlags |= (_anysize); 
    686684                            if (asmstate.ucItype == ITjump) 
    687685                                popnd2->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    688686                                        _fanysize); 
    689687                        } 
    690688                        if (popnd3 && ASM_GET_aopty(popnd3->usFlags) != _reg) { 
    691                             usFlags3 = popnd3->usFlags |= (_anysize); 
     689                            opflags3 = popnd3->usFlags |= (_anysize); 
    692690                            if (asmstate.ucItype == ITjump) 
    693691                                popnd3->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 
    694692                                        _fanysize); 
    695693                        } 
    696694                        if (bRetry) 
    697695                        { 
    698696                            asmerr(EM_bad_op, asm_opstr(pop));  // illegal type/size of operands 
    699697                        } 
    700698                        bRetry = TRUE; 
    701699                        goto RETRY; 
    702700 
    703701                } 
    704                 ptbRet.pptb1 = pptb1; 
     702                ptbRet.pptb1 = table1; 
    705703                goto RETURN_IT; 
    706  
     704            } 
    707705            case 2: 
    708                 //printf("usFlags1 = "); asm_output_flags(usFlags1); printf(" "); 
    709                 //printf("usFlags2 = "); asm_output_flags(usFlags2); printf("\n"); 
    710                 for (pptb2 = pop->ptb.pptb2; 
    711                      pptb2->usOpcode != ASM_END; 
    712                      pptb2++) 
     706            {   //printf("opflags1 = "); asm_output_flags(opflags1); printf(" "); 
     707                //printf("opflags2 = "); asm_output_flags(opflags2); printf("\n"); 
     708                PTRNTAB2 *table2; 
     709                for (table2 = pop->ptb.pptb2; 
     710                     table2->usOpcode != ASM_END; 
     711                     table2++) 
    713712                { 
    714                         //printf("table1   = "); asm_output_flags(pptb2->usOp1); printf(" "); 
    715                         //printf("table2   = "); asm_output_flags(pptb2->usOp2); printf("\n"); 
    716                         bMatch1 = asm_match_flags(usFlags1, pptb2->usOp1); 
    717                         bMatch2 = asm_match_flags(usFlags2, pptb2->usOp2); 
     713                        //printf("table1   = "); asm_output_flags(table2->usOp1); printf(" "); 
     714                        //printf("table2   = "); asm_output_flags(table2->usOp2); printf("\n"); 
     715                        bMatch1 = asm_match_flags(opflags1, table2->usOp1); 
     716                        bMatch2 = asm_match_flags(opflags2, table2->usOp2); 
    718717                        //printf("match1 = %d, match2 = %d\n",bMatch1,bMatch2); 
    719718                        if (bMatch1 && bMatch2) { 
    720719 
    721720                            //printf("match\n"); 
    722721 
    723 // OK, if they both match and the first op in the table is not AL 
    724 // or size of 8 and the second is immediate 8, 
    725 // then check to see if the constant 
    726 // is a signed 8 bit constant.  If so, then do not match, otherwise match 
    727 /
     722                            /* If they both match and the first op in the table is not AL 
     723                             * or size of 8 and the second is immediate 8, 
     724                             * then check to see if the constant 
     725                             * is a signed 8 bit constant.  If so, then do not match, otherwise match 
     726                             *
    728727                            if (!bRetry && 
    729                                 !((ASM_GET_uSizemask(pptb2->usOp1) & _8) || 
    730                                   (ASM_GET_uRegmask(pptb2->usOp1) & _al)) && 
    731                                 (ASM_GET_aopty(pptb2->usOp2) == _imm) && 
    732                                 (ASM_GET_uSizemask(pptb2->usOp2) & _8)) 
     728                                !((ASM_GET_uSizemask(table2->usOp1) & _8) || 
     729                                  (ASM_GET_uRegmask(table2->usOp1) & _al)) && 
     730                                (ASM_GET_aopty(table2->usOp2) == _imm) && 
     731                                (ASM_GET_uSizemask(table2->usOp2) & _8)) 
    733732                            { 
    734733 
    735734                                if (popnd2->disp <= SCHAR_MAX) 
    736735                                    break; 
    737736                                else 
    738737                                    bFake = TRUE; 
    739738                            } 
    740739                            else 
    741740                                break; 
    742741                        } 
    743742                        if (asmstate.ucItype == ITopt || 
    744743                            asmstate.ucItype == ITfloat) 
    745744                        { 
    746745                                switch (usNumops) 
    747746                                { 
    748747                                    case 0: 
    749                                         if (!pptb2->usOp1) 
     748                                        if (!table2->usOp1) 
    750749                                            goto Lfound2; 
    751750                                        break; 
    752751                                    case 1: 
    753                                         if (bMatch1 && !pptb2->usOp2) 
     752                                        if (bMatch1 && !table2->usOp2) 
    754753                                            goto Lfound2; 
    755754                                        break; 
    756755                                    case 2: 
    757756                                        break; 
    758757                                    default: 
    759758                                        goto PARAM_ERROR; 
    760759                                } 
    761760                        } 
    762761#if 0 
    763762                        if (asmstate.ucItype == ITshift && 
    764                             !pptb2->usOp2 && 
     763                            !table2->usOp2 && 
    765764                            bMatch1 && popnd2->disp == 1 && 
    766                             asm_match_flags(usFlags2, 
     765                            asm_match_flags(opflags2, 
    767766                                CONSTRUCT_FLAGS(_8|_16|_32, _imm,_normal,0)) 
    768767                          ) 
    769768                            break; 
    770769#endif 
    771770                } 
    772771            Lfound2: 
    773                 if (pptb2->usOpcode == ASM_END) 
     772                if (table2->usOpcode == ASM_END) 
    774773                { 
    775774#ifdef DEBUG 
    776775                    if (debuga) 
    777776                    {   printf("\t%s\t", asm_opstr(pop)); 
    778777                        if (popnd1) 
    779778                                asm_output_popnd(popnd1); 
    780779                        if (popnd2) { 
    781780                                printf(","); 
    782781                                asm_output_popnd(popnd2); 
    783782                        } 
    784783                        if (popnd3) { 
    785784                                printf(","); 
    786785                                asm_output_popnd(popnd3); 
    787786                        } 
    788787                        printf("\n"); 
    789788 
    790789                        printf("OPCODE mismatch = "); 
    791790                        if (popnd1) 
    792791                            asm_output_flags(popnd1->usFlags); 
    793792                        else 
    794793                            printf("NONE"); 
    795794                        printf( " Op2 = "); 
    796795                        if (popnd2) 
    797796                            asm_output_flags(popnd2->usFlags); 
    798797                        else 
    799798                            printf("NONE"); 
    800799                        printf("\n"); 
    801800                    } 
    802801#endif 
    803802                    goto TYPE_SIZE_ERROR; 
    804803                } 
    805                 ptbRet.pptb2 = pptb2; 
     804                ptbRet.pptb2 = table2; 
    806805                goto RETURN_IT; 
    807         case 3: 
    808                 for (pptb3 = pop->ptb.pptb3; 
    809                      pptb3->usOpcode != ASM_END; 
    810                      pptb3++) 
     806            } 
     807            case 3: 
     808            { 
     809                PTRNTAB3 *table3; 
     810                for (table3 = pop->ptb.pptb3; 
     811                     table3->usOpcode != ASM_END; 
     812                     table3++) 
    811813                { 
    812                         bMatch1 = asm_match_flags(usFlags1, pptb3->usOp1); 
    813                         bMatch2 = asm_match_flags(usFlags2, pptb3->usOp2); 
    814                         bMatch3 = asm_match_flags(usFlags3, pptb3->usOp3); 
     814                        bMatch1 = asm_match_flags(opflags1, table3->usOp1); 
     815                        bMatch2 = asm_match_flags(opflags2, table3->usOp2); 
     816                        bMatch3 = asm_match_flags(opflags3, table3->usOp3); 
    815817                        if (bMatch1 && bMatch2 && bMatch3) 
    816818                            goto Lfound3; 
    817819                        if (asmstate.ucItype == ITopt) 
    818820                        { 
    819821                            switch (usNumops) 
    820822                            { 
    821823                                case 0: 
    822                                         if (!pptb3->usOp1) 
     824                                        if (!table3->usOp1) 
    823825                                            goto Lfound3; 
    824826                                        break; 
    825827                                case 1: 
    826                                         if (bMatch1 && !pptb3->usOp2) 
     828                                        if (bMatch1 && !table3->usOp2) 
    827829                                            goto Lfound3; 
    828830                                        break; 
    829831                                case 2: 
    830                                         if (bMatch1 && bMatch2 && !pptb3->usOp3) 
     832                                        if (bMatch1 && bMatch2 && !table3->usOp3) 
    831833                                            goto Lfound3; 
    832834                                        break; 
    833835                                case 3: 
    834836                                        break; 
    835837                                default: 
    836838                                        goto PARAM_ERROR; 
    837839                            } 
    838840                        } 
    839841                } 
    840842            Lfound3: 
    841                 if (pptb3->usOpcode == ASM_END) 
     843                if (table3->usOpcode == ASM_END) 
    842844                { 
    843845#ifdef DEBUG 
    844846                    if (debuga) 
    845847                    {   printf("\t%s\t", asm_opstr(pop)); 
    846848                        if (popnd1) 
    847849                                asm_output_popnd(popnd1); 
    848850                        if (popnd2) { 
    849851                                printf(","); 
    850852                                asm_output_popnd(popnd2); 
    851853                        } 
    852854                        if (popnd3) { 
    853855                                printf(","); 
    854856                                asm_output_popnd(popnd3); 
    855857                        } 
    856858                        printf("\n"); 
    857859 
    858860                        printf("OPCODE mismatch = "); 
    859861                        if (popnd1) 
    860862                            asm_output_flags(popnd1->usFlags); 
    861863                        else 
    862864                            printf("NONE"); 
    863865                        printf( " Op2 = "); 
    864866                        if (popnd2) 
    865867                            asm_output_flags(popnd2->usFlags); 
    866868                        else 
    867869                            printf("NONE"); 
    868870                        if (popnd3) 
    869871                            asm_output_flags(popnd3->usFlags); 
    870872                        printf("\n"); 
    871873                    } 
    872874#endif 
    873875                    goto TYPE_SIZE_ERROR; 
    874876                } 
    875                 ptbRet.pptb3 = pptb3; 
     877                ptbRet.pptb3 = table3; 
    876878                goto RETURN_IT; 
     879            } 
    877880        } 
    878881RETURN_IT: 
    879882        if (bRetry && !bFake) 
    880883        { 
    881884            asmerr(EM_bad_op, asm_opstr(pop)); 
    882885        } 
    883886        return ptbRet; 
    884887} 
    885888 
    886889/******************************* 
    887890 */ 
    888891 
    889892STATIC opflag_t asm_determine_float_flags(OPND *popnd) 
    890893{ 
    891894    //printf("asm_determine_float_flags()\n"); 
    892895 
    893896    opflag_t us, usFloat; 
    894897 
    895898    // Insure that if it is a register, that it is not a normal processor 
    896899    // register. 
     
    969972        if (asmstate.ucItype == ITfloat) 
    970973            return asm_determine_float_flags(popnd); 
    971974 
    972975        // If just a register 
    973976        if (popnd->base && !popnd->s && !popnd->disp && !popnd->real) 
    974977                return popnd->base->ty; 
    975978#if DEBUG 
    976979        if (debuga) 
    977980            printf("popnd->base = %s\n, popnd->pregDisp1 = %p\n", popnd->base ? popnd->base->regstr : "NONE", popnd->pregDisp1); 
    978981#endif 
    979982        ps = popnd->s; 
    980983        Declaration *ds = ps ? ps->isDeclaration() : NULL; 
    981984        if (ds && ds->storage_class & STClazy) 
    982985            sz = _anysize; 
    983986        else 
    984987            sz = asm_type_size((ds && ds->storage_class & (STCout | STCref)) ? popnd->ptype->pointerTo() : popnd->ptype); 
    985988        if (popnd->pregDisp1 && !popnd->base) 
    986989        { 
    987990            if (ps && ps->isLabel() && sz == _anysize) 
    988991                sz = I16 ? _16 : _32; 
    989             return (popnd->pregDisp1->ty & _r32
     992            return (popnd->pregDisp1->ty & (_r32 | _r64)
    990993                ? CONSTRUCT_FLAGS(sz, _m, _addr32, 0) 
    991994                : CONSTRUCT_FLAGS(sz, _m, _addr16, 0); 
    992995        } 
    993996        else if (ps) 
    994997        { 
    995998                if (popnd->bOffset || popnd->bSeg || ps == asmstate.psLocalsize) 
    996999                    return I16 
    9971000                        ? CONSTRUCT_FLAGS(_16, _imm, _normal, 0) 
    9981001                        : CONSTRUCT_FLAGS(_32, _imm, _normal, 0); 
    9991002 
    10001003                if (ps->isLabel()) 
    10011004                { 
    10021005                    switch (popnd->ajt) 
    10031006                    { 
    10041007                        case ASM_JUMPTYPE_UNSPECIFIED: 
    10051008                            if (ps == asmstate.psDollar) 
    10061009                            { 
    10071010                                if (popnd->disp >= CHAR_MIN && 
    10081011                                    popnd->disp <= CHAR_MAX) 
    10091012                                    us = CONSTRUCT_FLAGS(_8, _rel, _flbl,0); 
     
    15711574                        pc->IFL2 = FLconst; 
    15721575                        break; 
    15731576                } 
    15741577                if (aoptyTable2 == _m || 
    15751578                    aoptyTable2 == _rel || 
    15761579                    // If not MMX register (_mm) or XMM register (_xmm) 
    15771580                    (amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10)) && !uSizemaskTable1) || 
    15781581                    aoptyTable2 == _rm || 
    15791582                    (popnd1->usFlags == _r32 && popnd2->usFlags == _xmm) || 
    15801583                    (popnd1->usFlags == _r32 && popnd2->usFlags == _mm)) 
    15811584                { 
    15821585#if 0 
    15831586printf("test4 %d,%d,%d,%d\n", 
    15841587(aoptyTable2 == _m), 
    15851588(aoptyTable2 == _rel), 
    15861589(amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10))), 
    15871590(aoptyTable2 == _rm) 
    15881591); 
    15891592printf("usOpcode = %x\n", usOpcode); 
    15901593#endif 
     1594                        if (popnd1->usFlags == _r64) 
     1595                            pc->Irex |= REX_W; 
    15911596                        if (ptb.pptb0->usOpcode == 0x0F7E ||    // MOVD _rm32,_mm 
    15921597                            ptb.pptb0->usOpcode == 0x660F7E     // MOVD _rm32,_xmm 
    15931598                           ) 
    15941599                        { 
    15951600                            asm_make_modrm_byte( 
    15961601#ifdef DEBUG 
    15971602                                auchOpcode, &usIdx, 
    15981603#endif 
    15991604                                pc, 
    16001605                                ptb.pptb1->usFlags, 
    16011606                                popnd1, popnd2); 
    16021607                        } 
    16031608                        else 
    16041609                        { 
    16051610                            asm_make_modrm_byte( 
    16061611#ifdef DEBUG 
    16071612                                auchOpcode, &usIdx, 
    16081613#endif 
    16091614                                pc, 
    16101615                                ptb.pptb1->usFlags, 
    16111616                                popnd2, popnd1); 
    16121617                        } 
    16131618                        popndTmp = popnd1; 
    16141619                        aoptyTmp = aoptyTable1; 
    16151620                        uSizemaskTmp = uSizemaskTable1; 
    16161621                } 
    16171622                else 
    16181623                { 
     1624                        if (popnd2->usFlags == _r64) 
     1625                            pc->Irex |= REX_W; 
     1626 
    16191627                        if (((aoptyTable1 == _reg || aoptyTable1 == _float) && 
    16201628                             amodTable1 == _normal && 
    16211629                             (uRegmaskTable1 & _rplus_r))) 
    16221630                        { 
    16231631                            unsigned reg = popnd1->base->val; 
    16241632                            if (reg & 8) 
    16251633                            {   reg &= 7; 
    16261634                                pc->Irex |= REX_B; 
    16271635                                assert(I64); 
    16281636                            } 
    16291637                            if (asmstate.ucItype == ITfloat) 
    16301638                                pc->Irm += reg; 
    16311639                            else 
    16321640                                pc->Iop += reg; 
    16331641#ifdef DEBUG 
    16341642                            auchOpcode[usIdx-1] += reg; 
    16351643#endif 
    16361644                        } 
    16371645                        else 
    16381646                        if (((aoptyTable2 == _reg || aoptyTable2 == _float) && 
     
    18221830 
    18231831 
    18241832/******************************* 
    18251833 */ 
    18261834 
    18271835STATIC void asmerr(int errnum, ...) 
    18281836{   const char *format; 
    18291837 
    18301838    const char *p = asmstate.loc.toChars(); 
    18311839    if (*p) 
    18321840        printf("%s: ", p); 
    18331841 
    18341842    format = asmerrmsgs[errnum]; 
    18351843    va_list ap; 
    18361844    va_start(ap, errnum); 
    18371845    vprintf(format, ap); 
    18381846    va_end(ap); 
    18391847 
    18401848    printf("\n"); 
    18411849    fflush(stdout); 
    1842  
     1850halt(); 
    18431851    longjmp(asmstate.env,1); 
    18441852} 
    18451853 
    18461854/******************************* 
    18471855 */ 
    18481856 
    18491857STATIC void asmerr(const char *format, ...) 
    18501858{ 
    18511859    const char *p = asmstate.loc.toChars(); 
    18521860    if (*p) 
    18531861        printf("%s: ", p); 
    18541862 
    18551863    va_list ap; 
    18561864    va_start(ap, format); 
    18571865    vprintf(format, ap); 
    18581866    va_end(ap); 
    18591867 
    18601868    printf("\n"); 
    18611869    fflush(stdout); 
    18621870 
     
    23732381                r1r2 = Y(popnd->pregDisp1->val); 
    23742382            switch (r1r2) 
    23752383            { 
    23762384                case X(_BX,_SI):        rm = 0; break; 
    23772385                case X(_BX,_DI):        rm = 1; break; 
    23782386                case Y(_BX):    rm = 7; break; 
    23792387 
    23802388                case X(_BP,_SI):        rm = 2; break; 
    23812389                case X(_BP,_DI):        rm = 3; break; 
    23822390                case Y(_BP):    rm = 6; bDisp = TRUE;   break; 
    23832391 
    23842392                case X(_SI,_BX):        rm = 0; break; 
    23852393                case X(_SI,_BP):        rm = 2; break; 
    23862394                case Y(_SI):    rm = 4; break; 
    23872395 
    23882396                case X(_DI,_BX):        rm = 1; break; 
    23892397                case X(_DI,_BP):        rm = 3; break; 
    23902398                case Y(_DI):    rm = 5; break; 
    23912399 
    23922400                default: 
    2393                     asmerr(EM_bad_addr_mode);   // illegal addressing mode 
     2401                    asmerr("bad 16 bit index address mode"); 
    23942402            } 
    23952403            #undef X 
    23962404            #undef Y 
    23972405        } 
    23982406        mrmb.modregrm.rm = rm; 
    23992407 
    24002408#ifdef DEBUG 
    24012409        if (debuga) 
    24022410            printf("This is an mod = %d, popnd->s =%p, popnd->disp = %ld\n", 
    24032411               mrmb.modregrm.mod, s, popnd->disp); 
    24042412#endif 
    24052413            if (!s || (!mrmb.modregrm.mod && popnd->disp)) 
    24062414            { 
    24072415                if ((!popnd->disp && !bDisp) || 
    24082416                    !popnd->pregDisp1) 
    24092417                    mrmb.modregrm.mod = 0x0; 
    24102418                else 
    24112419                if (popnd->disp >= CHAR_MIN && 
    24122420                    popnd->disp <= SCHAR_MAX) 
    24132421                    mrmb.modregrm.mod = 0x1; 
     
    28922900                case _fn32: 
    28932901                case _flbl: 
    28942902                    return(TRUE); 
    28952903                default: 
    28962904                    return(FALSE); 
    28972905            } 
    28982906        case _rseg: 
    28992907        case _rspecial: 
    29002908            return(FALSE); 
    29012909        default: 
    29022910            assert(0); 
    29032911            return 0; 
    29042912    } 
    29052913} 
    29062914 
    29072915#ifdef DEBUG 
    29082916 
    29092917/******************************* 
    29102918 */ 
    29112919 
    2912 STATIC void asm_output_flags(opflag_t usFlags) 
    2913 { 
    2914         ASM_OPERAND_TYPE    aopty = ASM_GET_aopty(usFlags); 
    2915         ASM_MODIFIERS       amod = ASM_GET_amod(usFlags); 
    2916         unsigned            uRegmask = ASM_GET_uRegmask(usFlags); 
    2917         unsigned            uSizemask = ASM_GET_uSizemask(usFlags); 
     2920STATIC void asm_output_flags(opflag_t opflags) 
     2921{ 
     2922        ASM_OPERAND_TYPE    aopty = ASM_GET_aopty(opflags); 
     2923        ASM_MODIFIERS       amod = ASM_GET_amod(opflags); 
     2924        unsigned            uRegmask = ASM_GET_uRegmask(opflags); 
     2925        unsigned            uSizemask = ASM_GET_uSizemask(opflags); 
    29182926 
    29192927        if (uSizemask == _anysize) 
    29202928            printf("_anysize "); 
    29212929        else if (uSizemask == 0) 
    29222930            printf("0        "); 
    29232931        else 
    29242932        { 
    29252933            if (uSizemask & _8) 
    29262934                printf("_8  "); 
    29272935            if (uSizemask & _16) 
    29282936                printf("_16 "); 
    29292937            if (uSizemask & _32) 
    29302938                printf("_32 "); 
    29312939            if (uSizemask & _48) 
    29322940                printf("_48 "); 
    29332941            if (uSizemask & _64) 
    29342942                printf("_64 "); 
    29352943        } 
    29362944 
    29372945        printf("_"); 
  • branches/dmd-1.x/src/win32.mak

    r599 r606  
    9292    debug.obj code.obj cg87.obj cgsched.obj ee.obj csymbol.obj \ 
    9393    cgcod.obj cod1.obj cod2.obj cod3.obj cod4.obj cod5.obj outbuf.obj \ 
    9494    bcomplex.obj iasm.obj ptrntab.obj aa.obj ti_achar.obj md5.obj 
    9595 
    9696# from ROOT 
    9797 
    9898ROOTOBJS= lstring.obj array.obj gnuc.obj man.obj rmem.obj port.obj root.obj \ 
    9999    stringtable.obj dchar.obj response.obj async.obj speller.obj aav.obj 
    100100 
    101101OBJS= $(OBJ1) $(OBJ8) $(ROOTOBJS) 
    102102 
    103103SRCS= mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c utf.h \ 
    104104    utf.c entity.c identifier.c mtype.c expression.c optimize.c \ 
    105105    template.h template.c lexer.c declaration.c cast.c \ 
    106106    cond.h cond.c link.c aggregate.h staticassert.h parse.c statement.c \ 
    107107    constfold.c version.h version.c inifile.c iasm.c staticassert.c \ 
    108108    module.c scope.c dump.c init.h init.c attrib.h attrib.c opover.c \ 
    109109    eh.c toctype.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 
    110110    access.c complex_t.h unialpha.c irstate.h irstate.c glue.c msc.c \ 
    111111    ph.c tk.c s2ir.c todt.c e2ir.c util.c toobj.c cppmangle.c \ 
    112     identifier.h parse.h scope.h enum.h import.h \ 
     112    identifier.h parse.h objfile.h scope.h enum.h import.h \ 
    113113    typinf.c tocvdebug.c toelfdebug.c mars.h module.h mtype.h dsymbol.h \ 
    114114    declaration.h lexer.h expression.h statement.h doc.h doc.c \ 
    115115    macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 
    116116    delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 
    117117    clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 
    118118    aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c 
    119119 
    120120# From C++ compiler 
    121121 
    122122BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \ 
    123123    $C\global.h $C\parser.h $C\code.h $C\type.h $C\dt.h $C\cgcv.h \ 
    124124    $C\el.h $C\iasm.h $C\rtlsym.h $C\html.h \ 
    125125    $C\bcomplex.c $C\blockopt.c $C\cg.c $C\cg87.c \ 
    126126    $C\cgcod.c $C\cgcs.c $C\cgcv.c $C\cgelem.c $C\cgen.c $C\cgobj.c \ 
    127127    $C\cgreg.c $C\var.c \ 
    128128    $C\cgsched.c $C\cod1.c $C\cod2.c $C\cod3.c $C\cod4.c $C\cod5.c \ 
    129129    $C\code.c $C\symbol.c $C\debug.c $C\dt.c $C\ee.c $C\el.c \ 
    130130    $C\evalu8.c $C\go.c $C\gflow.c $C\gdag.c \ 
    131131    $C\gother.c $C\glocal.c $C\gloop.c $C\html.c $C\newman.c \ 
    132132    $C\nteh.c $C\os.c $C\out.c $C\outbuf.c $C\ptrntab.c $C\rtlsym.c \ 
     
    478478statement.obj : $(TOTALH) statement.h statement.c 
    479479staticassert.obj : $(TOTALH) staticassert.h staticassert.c 
    480480struct.obj : $(TOTALH) identifier.h enum.h struct.c 
    481481traits.obj : $(TOTALH) traits.c 
    482482dsymbol.obj : $(TOTALH) identifier.h dsymbol.h dsymbol.c 
    483483mtype.obj : $(TOTALH) mtype.h mtype.c 
    484484#typinf.obj : $(TOTALH) mtype.h typinf.c 
    485485utf.obj : utf.h utf.c 
    486486template.obj : $(TOTALH) template.h template.c 
    487487version.obj : $(TOTALH) identifier.h dsymbol.h cond.h version.h version.c 
    488488 
    489489################### Utilities ################ 
    490490 
    491491clean: 
    492492    del *.obj 
    493493    del total.sym 
    494494    del msgs.h msgs.c 
    495495    del elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c 
    496496    del impcnvtab.c 
    497497 
    498 zip : detab $(MAKEFILES) 
     498zip : detab tolf $(MAKEFILES) 
    499499    del dmdsrc.zip 
    500500    zip32 dmdsrc $(MAKEFILES) 
    501501    zip32 dmdsrc $(SRCS) 
    502502    zip32 dmdsrc $(BACKSRC) 
    503503    zip32 dmdsrc $(TKSRC) 
    504504    zip32 dmdsrc $(ROOTSRC) 
    505505 
    506506################### Detab ################ 
    507507 
    508508detab: 
    509509    detab $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) 
     510 
     511tolf: 
     512    tolf $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) $(MAKEFILES) 
    510513 
    511514################### Install ################ 
    512515 
    513516install: detab install2 
    514517 
    515518install2: 
    516519    copy dmd.exe $(DIR)\windows\bin\  
    517520    copy phobos\phobos.lib $(DIR)\windows\lib  
    518521    $(CP) $(SRCS) $(DIR)\src\dmd\  
    519522    $(CP) $(ROOTSRC) $(DIR)\src\dmd\root\  
    520523    $(CP) $(TKSRC) $(DIR)\src\dmd\tk\   
    521524    $(CP) $(BACKSRC) $(DIR)\src\dmd\backend\   
    522525    $(CP) $(MAKEFILES) $(DIR)\src\dmd\   
    523526    copy gpl.txt $(DIR)\src\dmd\  
    524527    copy readme.txt $(DIR)\src\dmd\  
    525528    copy artistic.txt $(DIR)\src\dmd\  
    526529    copy backendlicense.txt $(DIR)\src\dmd\  
    527530 
    528531################### Write to SVN ################ 
    529532 
    530 svn:    detab svn2 
     533svn:    detab tolf svn2 
    531534 
    532535svn2: 
    533536    $(CP) $(SRCS) $(DMDSVN)\  
    534537    $(CP) $(ROOTSRC) $(DMDSVN)\root\  
    535538    $(CP) $(TKSRC) $(DMDSVN)\tk\   
    536539    $(CP) $(BACKSRC) $(DMDSVN)\backend\   
    537540    $(CP) $(MAKEFILES) $(DMDSVN)\   
    538541    copy gpl.txt $(DMDSVN)\  
    539542    copy readme.txt $(DMDSVN)\  
    540543    copy artistic.txt $(DMDSVN)\  
    541544    copy backendlicense.txt $(DMDSVN)\  
    542545 
    543546###################################