Changeset 606
- Timestamp:
- 08/09/10 03:53:24 (14 years ago)
- Files:
-
- branches/dmd-1.x/src/backend/cgen.c (modified) (1 diff)
- branches/dmd-1.x/src/backend/cod1.c (modified) (1 diff)
- branches/dmd-1.x/src/backend/cod3.c (modified) (1 diff)
- branches/dmd-1.x/src/backend/iasm.h (modified) (1 diff)
- branches/dmd-1.x/src/backend/ptrntab.c (modified) (2 diffs)
- branches/dmd-1.x/src/backend/ty.h (modified) (1 diff)
- branches/dmd-1.x/src/glue.c (modified) (1 diff)
- branches/dmd-1.x/src/iasm.c (modified) (6 diffs)
- branches/dmd-1.x/src/win32.mak (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/backend/cgen.c
r596 r606 279 279 * Generate a MOV to,from register instruction. 280 280 * Smart enough to dump redundant register moves, and segment 281 281 * register moves. 282 282 */ 283 283 284 284 code *genmovreg(code *c,unsigned to,unsigned from) 285 285 { 286 286 #if DEBUG 287 287 if (to > ES || from > ES) 288 288 printf("genmovreg(c = %p, to = %d, from = %d)\n",c,to,from); 289 289 #endif 290 290 assert(to <= ES && from <= ES); 291 291 if (to != from) 292 292 { 293 293 if (to == ES) 294 294 c = genregs(c,0x8E,0,from); 295 295 else if (from == ES) 296 296 c = genregs(c,0x8C,0,to); 297 297 else 298 298 c = genregs(c,0x89,from,to); 299 if (I64) 300 code_orrex(c, REX_W); 299 301 } 300 302 return c; 301 303 } 302 304 303 305 /************************** 304 306 * Generate a jump instruction. 305 307 */ 306 308 307 309 code *genjmp(code *c,unsigned op,unsigned fltarg,block *targ) 308 310 { code cs; 309 311 code *cj; 310 312 code *cnop; 311 313 312 314 cs.Iop = op & 0xFF; 313 315 cs.Iflags = 0; 314 316 cs.Irex = 0; 315 317 if (op != JMP) /* if not already long branch */ 316 318 cs.Iflags = CFjmp16; /* assume long branch for op = 0x7x */ 317 319 cs.IFL2 = fltarg; /* FLblock (or FLcode) */ 318 320 cs.IEV2.Vblock = targ; /* target block (or code) */ branches/dmd-1.x/src/backend/cod1.c
r596 r606 2804 2804 { /* Then symbol must be allocated on stack */ 2805 2805 needframe = TRUE; 2806 2806 break; 2807 2807 } 2808 2808 } 2809 2809 else 2810 2810 { if (mfuncreg == 0) /* if no registers left */ 2811 2811 { needframe = TRUE; 2812 2812 break; 2813 2813 } 2814 2814 } 2815 2815 } 2816 2816 } 2817 2817 } 2818 2818 } 2819 2819 #endif 2820 2820 2821 2821 retregs = regmask(e->Ety, tym1); 2822 2822 2823 2823 // If stack needs cleanup 2824 if (OTbinary(e->Eoper) && !typfunc(tym1) && 2824 if (OTbinary(e->Eoper) && 2825 (!typfunc(tym1) || I64) && 2825 2826 !(s && s->Sflags & SFLexit)) 2826 2827 { 2827 2828 if (tym1 == TYhfunc) 2828 2829 { // Hidden parameter is popped off by the callee 2829 2830 c = genadjesp(c, -4); 2830 2831 stackpush -= 4; 2831 2832 if (numpara + numalign > 4) 2832 2833 c = genstackclean(c, numpara + numalign - 4, retregs); 2833 2834 } 2834 2835 else 2835 2836 c = genstackclean(c,numpara + numalign,retregs); 2836 2837 } 2837 2838 else 2838 2839 { 2839 2840 c = genadjesp(c,-numpara); 2840 2841 stackpush -= numpara; 2841 2842 if (numalign) 2842 2843 c = genstackclean(c,numalign,retregs); 2843 2844 } 2844 2845 branches/dmd-1.x/src/backend/cod3.c
r596 r606 2003 2003 } 2004 2004 else if (xlocalsize == REGSIZE && (!I16 || b->BC == BCret)) 2005 2005 { mfuncreg &= ~mask[regx]; 2006 2006 c = gen1(c,0x58 + regx); // POP regx 2007 2007 } 2008 2008 else if (xlocalsize) 2009 2009 { 2010 2010 c = genc2(c,0x81,modregrm(3,0,SP),xlocalsize); // ADD SP,xlocalsize 2011 2011 if (I64) 2012 2012 code_orrex(c, REX_W); 2013 2013 } 2014 2014 } 2015 2015 if (b->BC == BCret || b->BC == BCretexp) 2016 2016 { 2017 2017 Lret: 2018 2018 op = tyfarfunc(tym) ? 0xCA : 0xC2; 2019 2019 if (tym == TYhfunc) 2020 2020 { 2021 2021 c = genc2(c,0xC2,0,4); // RET 4 2022 2022 } 2023 else if (!typfunc(tym) || Poffset == 0 )2023 else if (!typfunc(tym) || Poffset == 0 || I64) 2024 2024 { op++; // to a regular RET 2025 2025 c = gen1(c,op); 2026 2026 } 2027 2027 else 2028 2028 { // Stack is always aligned on register size boundary 2029 2029 Poffset = (Poffset + (REGSIZE - 1)) & ~(REGSIZE - 1); 2030 2030 c = genc2(c,op,0,Poffset); // RET Poffset 2031 2031 } 2032 2032 } 2033 2033 2034 2034 Lopt: 2035 2035 // If last instruction in ce is ADD SP,imm, and first instruction 2036 2036 // in c sets SP, we can dump the ADD. 2037 2037 cr = code_last(ce); 2038 2038 if (cr && c && !I64) 2039 2039 { 2040 2040 if (cr->Iop == 0x81 && cr->Irm == modregrm(3,0,SP)) // if ADD SP,imm 2041 2041 { 2042 2042 if ( 2043 2043 c->Iop == 0xC9 || // LEAVE branches/dmd-1.x/src/backend/iasm.h
r577 r606 19 19 // 20 20 // 21 21 22 22 // This is for when the reg field of modregrm specifies which instruction it is 23 23 #define NUM_MASK 0x7 24 24 #define _0 (0x0 | _modrm) // insure that some _modrm bit is set 25 25 #define _1 0x1 // with _0 26 26 #define _2 0x2 27 27 #define _3 0x3 28 28 #define _4 0x4 29 29 #define _5 0x5 30 30 #define _6 0x6 31 31 #define _7 0x7 32 32 33 33 #define _modrm 0x10 34 34 35 35 #define _r _modrm 36 36 #define _cb _modrm 37 37 #define _cw _modrm 38 38 #define _cd _modrm 39 #define _cq _modrm 39 40 #define _cp _modrm 40 41 #define _ib 0 41 42 #define _iw 0 42 43 #define _id 0 43 44 #define _rb 0 44 45 #define _rw 0 45 46 #define _rd 0 46 47 #define _16_bit 0x20 47 48 #define _32_bit 0x40 48 49 #define _64_bit 0x10000 49 50 #define _I386 0x80 // opcode is only for 386 and later 50 51 #define _16_bit_addr 0x100 51 52 #define _32_bit_addr 0x200 52 53 #define _fwait 0x400 // Add an FWAIT prior to the instruction opcode 53 54 #define _nfwait 0x800 // Do not add an FWAIT prior to the instruction 54 55 55 56 #define MOD_MASK 0xF000 // Mod mask 56 57 #define _modsi 0x1000 // Instruction modifies SI 57 58 #define _moddx 0x2000 // Instruction modifies DX 58 59 #define _mod2 0x3000 // Instruction modifies second operand branches/dmd-1.x/src/backend/ptrntab.c
r577 r606 795 795 { 0x38, _r|_modnot1, _rm8, _r8 }, 796 796 { 0x39, _r|_16_bit|_modnot1, _rm16, _r16 }, 797 797 { 0x39, _r|_32_bit|_modnot1, _rm32, _r32 }, 798 798 { 0x3a, _r|_modnot1, _r8, _rm8 }, 799 799 { 0x3b, _r|_16_bit|_modnot1, _r16, _rm16 }, 800 800 { 0x3b, _r|_32_bit|_modnot1, _r32, _rm32 }, 801 801 { ASM_END, 0, 0, 0 } 802 802 }; 803 803 PTRNTAB2 aptb2CMPS[] = /* CMPS */ { 804 804 { 0xa6, _modsidi, _m8, _m8 }, 805 805 { 0xa7, _modsidi, _m16, _m16 }, 806 806 { 0xa7, _modsidi, _m32, _m32 }, 807 807 { ASM_END, 0, 0, 0 } 808 808 }; 809 809 PTRNTAB2 aptb2CMPXCHG[] = /* CMPXCHG */ { 810 810 { 0xfb0, _I386 | _cb|_mod2, _rm8, _r8 }, 811 811 // This is really a 486 only 812 812 // instruction 813 813 { 0xfb1, _I386 | _cw | _16_bit|_mod2, _rm16, _r16 }, 814 814 { 0xfb1, _I386 | _cd | _32_bit|_mod2, _rm32, _r32 }, 815 { 0xfb1, _I386 | _cq | _64_bit|_mod2, _rm64, _r64 }, 815 816 { ASM_END, 0, 0, 0 } 816 817 }; 817 818 PTRNTAB2 aptb2DIV[] = /* DIV */ { 818 819 { 0xf6, _6, _al, _rm8 }, 819 820 { 0xf7, _6 | _16_bit | _moddx, _ax, _rm16 }, 820 821 { 0xf7, _6 | _32_bit | _moddx, _eax, _rm32 }, 821 822 { 0xf6, _6 | _modax, _rm8, 0 }, 822 823 { 0xf7, _6 | _16_bit | _modaxdx, _rm16, 0 }, 823 824 { 0xf7, _6 | _32_bit | _modaxdx, _rm32, 0 }, 824 825 { ASM_END, 0, 0, 0 } 825 826 }; 826 827 PTRNTAB2 aptb2ENTER[] = /* ENTER */ { 827 828 { 0xc8, _iw|_ib, _imm16, _imm8 }, 828 829 { ASM_END, 0, 0, 0 } 829 830 }; 830 831 PTRNTAB2 aptb2IDIV[] = /* IDIV */ { 831 832 { 0xf6, _7, _al, _rm8 }, 832 833 { 0xf7, _7|_16_bit|_moddx, _ax, _rm16 }, 833 834 { 0xf7, _7|_32_bit|_moddx, _eax, _rm32 }, 834 835 { 0xf6, _7 | _modax, _rm8, 0 }, … … 891 892 { ASM_END, 0, 0, 0 } 892 893 }; 893 894 PTRNTAB2 aptb2LSL[] = /* LSL */ { 894 895 { 0x0f03, _r|_16_bit, _r16, _rm16 }, 895 896 { 0x0f03, _r|_32_bit, _r32, _rm32 }, 896 897 { ASM_END, 0, 0, 0 } 897 898 }; 898 899 899 900 PTRNTAB2 aptb2MOV[] = /* MOV */ { 900 901 #if 0 // Let pinholeopt() do this 901 902 { 0xa0, 0, _al, _moffs8 }, 902 903 { 0xa1, _16_bit, _ax, _moffs16 }, 903 904 { 0xa1, _32_bit, _eax, _moffs32 }, 904 905 { 0xa2, 0, _moffs8, _al }, 905 906 { 0xa3, _16_bit, _moffs16, _ax }, 906 907 { 0xa3, _32_bit, _moffs32, _eax }, 907 908 #endif 908 909 { 0x88, _r, _rm8, _r8 }, 909 910 { 0x89, _r|_16_bit, _rm16, _r16 }, 910 911 { 0x89, _r|_32_bit, _rm32, _r32 }, 912 { 0x89, _r|_64_bit, _rm64, _r64 }, 911 913 { 0x8a, _r, _r8, _rm8 }, 912 914 { 0x8b, _r|_16_bit, _r16, _rm16 }, 913 915 { 0x8b, _r|_32_bit, _r32, _rm32 }, 916 { 0x8b, _r|_64_bit, _r64, _rm64 }, 914 917 { 0x8c, _r, _rm16, _seg|_ds|_es| _ss | _fs | _gs | _cs }, 915 918 { 0x8e, _r, _seg|_ds|_es|_ss|_fs|_gs|_cs, _rm16 }, 916 919 { 0xb0, _rb, _r8 | _plus_r, _imm8 }, 917 920 { 0xb8, _rw | _16_bit, _r16 | _plus_r, _imm16 }, 918 921 { 0xb8, _rd|_32_bit, _r32 | _plus_r, _imm32 }, 919 922 { 0xc6, _cb, _rm8, _imm8 }, 920 923 { 0xc7, _cw|_16_bit, _rm16, _imm16 }, 921 924 { 0xc7, _cd|_32_bit, _rm32, _imm32 }, 922 925 #if 0 // Let pinholeopt() do this 923 926 { 0xc6, _cb, _moffs8, _imm8 }, 924 927 { 0xc7, _cw|_16_bit, _moffs16, _imm16 }, 925 928 { 0xc7, _cd|_32_bit, _moffs32, _imm32 }, 926 929 #endif 927 930 { 0x0f20, _r, _r32, _special | _crn }, 928 931 { 0x0f22, _r, _special|_crn, _r32 }, 929 932 { 0x0f21, _r, _r32, _special | _drn }, 930 933 { 0x0f23, _r, _special|_drn, _r32 }, 931 934 { 0x0f24, _r, _r32, _special | _trn }, 932 935 { 0x0f26, _r, _special|_trn, _r32 }, 933 936 { ASM_END, 0, 0, 0 } branches/dmd-1.x/src/backend/ty.h
r579 r606 276 276 #else 277 277 /* Detect cpp function type (callee cleans up stack) */ 278 278 #ifndef typfunc 279 279 #define typfunc(ty) (tytab[(ty) & 0xFF] & TYFLcallstkc) 280 280 #endif 281 281 #endif 282 282 283 283 /* Array to convert a type to its unsigned equivalent */ 284 284 extern const tym_t tytouns[]; 285 285 #ifndef touns 286 286 #define touns(ty) (tytouns[(ty) & 0xFF]) 287 287 #endif 288 288 289 289 /* Determine if TYffunc or TYfpfunc (a far function) */ 290 290 #ifndef tyfarfunc 291 291 #define tyfarfunc(ty) (tytab[(ty) & 0xFF] & TYFLfarfunc) 292 292 #endif 293 293 294 294 // Determine if parameter can go in register for TYjfunc 295 295 #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) 297 297 #endif 298 298 299 299 /* Determine relaxed type */ 300 300 #ifndef tyrelax 301 301 #define tyrelax(ty) (_tyrelax[tybasic(ty)]) 302 302 #endif 303 303 304 304 /* Array to give the 'relaxed' type for relaxed type checking */ 305 305 extern unsigned char _tyrelax[]; 306 306 #define type_relax (config.flags3 & CFG3relax) // !=0 if relaxed type checking 307 307 #if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS 308 308 #define type_semirelax (config.flags3 & CFG3semirelax) // !=0 if semi-relaxed type checking 309 309 #else 310 310 #define type_semirelax type_relax 311 311 #endif 312 312 313 313 /* Determine functionally equivalent type */ 314 314 extern unsigned char tyequiv[]; 315 315 316 316 /* Give an ascii string for a type */ branches/dmd-1.x/src/glue.c
r592 r606 790 790 791 791 // Determine register assignments 792 792 if (pi) 793 793 { 794 794 if (global.params.isX86_64) 795 795 { 796 796 // Order of assignment of pointer or integer parameters 797 797 static const unsigned char argregs[6] = { DI,SI,DX,CX,R8,R9 }; 798 798 int r = 0; 799 799 int xmmcnt = XMM0; 800 800 801 801 for (int i = 0; i < pi; i++) 802 802 { Symbol *sp = params[i]; 803 803 tym_t ty = tybasic(sp->Stype->Tty); 804 804 // BUG: doesn't work for structs 805 805 if (r < sizeof(argregs)/sizeof(argregs[0])) 806 806 { 807 807 if (type_jparam(sp->Stype)) 808 808 { 809 809 sp->Sclass = SCfastpar; 810 sp->Spreg = r;810 sp->Spreg = argregs[r]; 811 811 sp->Sfl = FLauto; 812 812 ++r; 813 813 } 814 814 } 815 815 if (xmmcnt < XMM7) 816 816 { 817 817 if (tyfloating(ty) && tysize(ty) <= 8) 818 818 { 819 819 sp->Sclass = SCfastpar; 820 820 sp->Spreg = xmmcnt; 821 821 sp->Sfl = FLauto; 822 822 ++xmmcnt; 823 823 } 824 824 } 825 825 } 826 826 } 827 827 else 828 828 { 829 829 // First parameter goes in register 830 830 Symbol *sp = params[0]; branches/dmd-1.x/src/iasm.c
r596 r606 534 534 { 535 535 if (tok_value == toknum) 536 536 asm_token(); // scan past token 537 537 else 538 538 /* When we run out of tokens, asmtok is NULL. 539 539 * But when this happens when a ';' was hit. 540 540 */ 541 541 asmerr(errnum, asmtok ? asmtok->toChars() : ";"); 542 542 } 543 543 544 544 545 545 /******************************* 546 546 */ 547 547 548 548 STATIC PTRNTAB asm_classify(OP *pop, OPND *popnd1, OPND *popnd2, OPND *popnd3, 549 549 unsigned *pusNumops) 550 550 { 551 551 unsigned usNumops; 552 552 unsigned usActual; 553 553 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; 560 557 char bFake = FALSE; 561 558 562 559 unsigned char bMatch1, bMatch2, bMatch3, bRetry = FALSE; 563 560 564 561 // How many arguments are there? the parser is strictly left to right 565 562 // so this should work. 566 563 567 564 if (!popnd1) 568 565 usNumops = 0; 569 566 else 570 567 { 571 popnd1->usFlags = usFlags1 = asm_determine_operand_flags(popnd1);568 popnd1->usFlags = opflags1 = asm_determine_operand_flags(popnd1); 572 569 if (!popnd2) 573 570 usNumops = 1; 574 571 else 575 572 { 576 popnd2->usFlags = usFlags2 = asm_determine_operand_flags(popnd2);573 popnd2->usFlags = opflags2 = asm_determine_operand_flags(popnd2); 577 574 if (!popnd3) 578 575 usNumops = 2; 579 576 else 580 577 { 581 popnd3->usFlags = usFlags3 = asm_determine_operand_flags(popnd3);578 popnd3->usFlags = opflags3 = asm_determine_operand_flags(popnd3); 582 579 usNumops = 3; 583 580 } 584 581 } 585 582 } 586 583 587 584 // Now check to insure that the number of operands is correct 588 585 usActual = (pop->usNumops & ITSIZE); 589 586 if (usActual != usNumops && asmstate.ucItype != ITopt && 590 587 asmstate.ucItype != ITfloat) 591 588 { 592 589 PARAM_ERROR: 593 590 asmerr(EM_nops_expected, usActual, asm_opstr(pop), usNumops); 594 591 } 595 592 if (usActual < usNumops) 596 593 *pusNumops = usActual; 597 594 else 598 595 *pusNumops = usNumops; 599 596 // 600 597 // The number of arguments matches, now check to find the opcode 601 598 // in the associated opcode table 602 599 // 603 600 RETRY: 604 601 //printf("usActual = %d\n", usActual); 605 602 switch (usActual) 606 603 { 607 604 case 0: 608 605 ptbRet = pop->ptb ; 609 606 goto RETURN_IT; 610 607 611 608 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++) 615 613 { 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); 618 616 //printf("bMatch1 = x%x\n", bMatch1); 619 617 if (bMatch1) 620 { if ( pptb1->usOpcode == 0x68 &&618 { if (table1->usOpcode == 0x68 && 621 619 !I16 && 622 pptb1->usOp1 == _imm16620 table1->usOp1 == _imm16 623 621 ) 624 622 // Don't match PUSH imm16 in 32 bit code 625 623 continue; 626 624 break; 627 625 } 628 626 if ((asmstate.ucItype == ITimmed) && 629 asm_match_flags( usFlags1,627 asm_match_flags(opflags1, 630 628 CONSTRUCT_FLAGS(_8 | _16 | _32, _imm, _normal, 631 629 0)) && 632 popnd1->disp == pptb1->usFlags)630 popnd1->disp == table1->usFlags) 633 631 break; 634 632 if ((asmstate.ucItype == ITopt || 635 633 asmstate.ucItype == ITfloat) && 636 634 !usNumops && 637 ! pptb1->usOp1)635 !table1->usOp1) 638 636 { 639 637 if (usNumops > 1) 640 638 goto PARAM_ERROR; 641 639 break; 642 640 } 643 641 } 644 if ( pptb1->usOpcode == ASM_END)642 if (table1->usOpcode == ASM_END) 645 643 { 646 644 #ifdef DEBUG 647 645 if (debuga) 648 646 { printf("\t%s\t", asm_opstr(pop)); 649 647 if (popnd1) 650 648 asm_output_popnd(popnd1); 651 649 if (popnd2) { 652 650 printf(","); 653 651 asm_output_popnd(popnd2); 654 652 } 655 653 if (popnd3) { 656 654 printf(","); 657 655 asm_output_popnd(popnd3); 658 656 } 659 657 printf("\n"); 660 658 661 659 printf("OPCODE mism = "); 662 660 if (popnd1) 663 661 asm_output_flags(popnd1->usFlags); 664 662 else 665 663 printf("NONE"); 666 664 printf("\n"); 667 665 } 668 666 #endif 669 667 TYPE_SIZE_ERROR: 670 668 if (popnd1 && ASM_GET_aopty(popnd1->usFlags) != _reg) 671 669 { 672 usFlags1 = popnd1->usFlags |= _anysize;670 opflags1 = popnd1->usFlags |= _anysize; 673 671 if (asmstate.ucItype == ITjump) 674 672 { 675 673 if (bRetry && popnd1->s && !popnd1->s->isLabel()) 676 674 { 677 675 asmerr(EM_label_expected, popnd1->s->toChars()); 678 676 } 679 677 680 678 popnd1->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 681 679 _fanysize); 682 680 } 683 681 } 684 682 if (popnd2 && ASM_GET_aopty(popnd2->usFlags) != _reg) { 685 usFlags2 = popnd2->usFlags |= (_anysize);683 opflags2 = popnd2->usFlags |= (_anysize); 686 684 if (asmstate.ucItype == ITjump) 687 685 popnd2->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 688 686 _fanysize); 689 687 } 690 688 if (popnd3 && ASM_GET_aopty(popnd3->usFlags) != _reg) { 691 usFlags3 = popnd3->usFlags |= (_anysize);689 opflags3 = popnd3->usFlags |= (_anysize); 692 690 if (asmstate.ucItype == ITjump) 693 691 popnd3->usFlags |= CONSTRUCT_FLAGS(0, 0, 0, 694 692 _fanysize); 695 693 } 696 694 if (bRetry) 697 695 { 698 696 asmerr(EM_bad_op, asm_opstr(pop)); // illegal type/size of operands 699 697 } 700 698 bRetry = TRUE; 701 699 goto RETRY; 702 700 703 701 } 704 ptbRet.pptb1 = pptb1;702 ptbRet.pptb1 = table1; 705 703 goto RETURN_IT; 706 704 } 707 705 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++) 713 712 { 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); 718 717 //printf("match1 = %d, match2 = %d\n",bMatch1,bMatch2); 719 718 if (bMatch1 && bMatch2) { 720 719 721 720 //printf("match\n"); 722 721 723 // OK, if they both match and the first op in the table is not AL724 //or size of 8 and the second is immediate 8,725 //then check to see if the constant726 //is a signed 8 bit constant. If so, then do not match, otherwise match727 //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 */ 728 727 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)) 733 732 { 734 733 735 734 if (popnd2->disp <= SCHAR_MAX) 736 735 break; 737 736 else 738 737 bFake = TRUE; 739 738 } 740 739 else 741 740 break; 742 741 } 743 742 if (asmstate.ucItype == ITopt || 744 743 asmstate.ucItype == ITfloat) 745 744 { 746 745 switch (usNumops) 747 746 { 748 747 case 0: 749 if (! pptb2->usOp1)748 if (!table2->usOp1) 750 749 goto Lfound2; 751 750 break; 752 751 case 1: 753 if (bMatch1 && ! pptb2->usOp2)752 if (bMatch1 && !table2->usOp2) 754 753 goto Lfound2; 755 754 break; 756 755 case 2: 757 756 break; 758 757 default: 759 758 goto PARAM_ERROR; 760 759 } 761 760 } 762 761 #if 0 763 762 if (asmstate.ucItype == ITshift && 764 ! pptb2->usOp2 &&763 !table2->usOp2 && 765 764 bMatch1 && popnd2->disp == 1 && 766 asm_match_flags( usFlags2,765 asm_match_flags(opflags2, 767 766 CONSTRUCT_FLAGS(_8|_16|_32, _imm,_normal,0)) 768 767 ) 769 768 break; 770 769 #endif 771 770 } 772 771 Lfound2: 773 if ( pptb2->usOpcode == ASM_END)772 if (table2->usOpcode == ASM_END) 774 773 { 775 774 #ifdef DEBUG 776 775 if (debuga) 777 776 { printf("\t%s\t", asm_opstr(pop)); 778 777 if (popnd1) 779 778 asm_output_popnd(popnd1); 780 779 if (popnd2) { 781 780 printf(","); 782 781 asm_output_popnd(popnd2); 783 782 } 784 783 if (popnd3) { 785 784 printf(","); 786 785 asm_output_popnd(popnd3); 787 786 } 788 787 printf("\n"); 789 788 790 789 printf("OPCODE mismatch = "); 791 790 if (popnd1) 792 791 asm_output_flags(popnd1->usFlags); 793 792 else 794 793 printf("NONE"); 795 794 printf( " Op2 = "); 796 795 if (popnd2) 797 796 asm_output_flags(popnd2->usFlags); 798 797 else 799 798 printf("NONE"); 800 799 printf("\n"); 801 800 } 802 801 #endif 803 802 goto TYPE_SIZE_ERROR; 804 803 } 805 ptbRet.pptb2 = pptb2;804 ptbRet.pptb2 = table2; 806 805 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++) 811 813 { 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); 815 817 if (bMatch1 && bMatch2 && bMatch3) 816 818 goto Lfound3; 817 819 if (asmstate.ucItype == ITopt) 818 820 { 819 821 switch (usNumops) 820 822 { 821 823 case 0: 822 if (! pptb3->usOp1)824 if (!table3->usOp1) 823 825 goto Lfound3; 824 826 break; 825 827 case 1: 826 if (bMatch1 && ! pptb3->usOp2)828 if (bMatch1 && !table3->usOp2) 827 829 goto Lfound3; 828 830 break; 829 831 case 2: 830 if (bMatch1 && bMatch2 && ! pptb3->usOp3)832 if (bMatch1 && bMatch2 && !table3->usOp3) 831 833 goto Lfound3; 832 834 break; 833 835 case 3: 834 836 break; 835 837 default: 836 838 goto PARAM_ERROR; 837 839 } 838 840 } 839 841 } 840 842 Lfound3: 841 if ( pptb3->usOpcode == ASM_END)843 if (table3->usOpcode == ASM_END) 842 844 { 843 845 #ifdef DEBUG 844 846 if (debuga) 845 847 { printf("\t%s\t", asm_opstr(pop)); 846 848 if (popnd1) 847 849 asm_output_popnd(popnd1); 848 850 if (popnd2) { 849 851 printf(","); 850 852 asm_output_popnd(popnd2); 851 853 } 852 854 if (popnd3) { 853 855 printf(","); 854 856 asm_output_popnd(popnd3); 855 857 } 856 858 printf("\n"); 857 859 858 860 printf("OPCODE mismatch = "); 859 861 if (popnd1) 860 862 asm_output_flags(popnd1->usFlags); 861 863 else 862 864 printf("NONE"); 863 865 printf( " Op2 = "); 864 866 if (popnd2) 865 867 asm_output_flags(popnd2->usFlags); 866 868 else 867 869 printf("NONE"); 868 870 if (popnd3) 869 871 asm_output_flags(popnd3->usFlags); 870 872 printf("\n"); 871 873 } 872 874 #endif 873 875 goto TYPE_SIZE_ERROR; 874 876 } 875 ptbRet.pptb3 = pptb3;877 ptbRet.pptb3 = table3; 876 878 goto RETURN_IT; 879 } 877 880 } 878 881 RETURN_IT: 879 882 if (bRetry && !bFake) 880 883 { 881 884 asmerr(EM_bad_op, asm_opstr(pop)); 882 885 } 883 886 return ptbRet; 884 887 } 885 888 886 889 /******************************* 887 890 */ 888 891 889 892 STATIC opflag_t asm_determine_float_flags(OPND *popnd) 890 893 { 891 894 //printf("asm_determine_float_flags()\n"); 892 895 893 896 opflag_t us, usFloat; 894 897 895 898 // Insure that if it is a register, that it is not a normal processor 896 899 // register. … … 969 972 if (asmstate.ucItype == ITfloat) 970 973 return asm_determine_float_flags(popnd); 971 974 972 975 // If just a register 973 976 if (popnd->base && !popnd->s && !popnd->disp && !popnd->real) 974 977 return popnd->base->ty; 975 978 #if DEBUG 976 979 if (debuga) 977 980 printf("popnd->base = %s\n, popnd->pregDisp1 = %p\n", popnd->base ? popnd->base->regstr : "NONE", popnd->pregDisp1); 978 981 #endif 979 982 ps = popnd->s; 980 983 Declaration *ds = ps ? ps->isDeclaration() : NULL; 981 984 if (ds && ds->storage_class & STClazy) 982 985 sz = _anysize; 983 986 else 984 987 sz = asm_type_size((ds && ds->storage_class & (STCout | STCref)) ? popnd->ptype->pointerTo() : popnd->ptype); 985 988 if (popnd->pregDisp1 && !popnd->base) 986 989 { 987 990 if (ps && ps->isLabel() && sz == _anysize) 988 991 sz = I16 ? _16 : _32; 989 return (popnd->pregDisp1->ty & _r32)992 return (popnd->pregDisp1->ty & (_r32 | _r64)) 990 993 ? CONSTRUCT_FLAGS(sz, _m, _addr32, 0) 991 994 : CONSTRUCT_FLAGS(sz, _m, _addr16, 0); 992 995 } 993 996 else if (ps) 994 997 { 995 998 if (popnd->bOffset || popnd->bSeg || ps == asmstate.psLocalsize) 996 999 return I16 997 1000 ? CONSTRUCT_FLAGS(_16, _imm, _normal, 0) 998 1001 : CONSTRUCT_FLAGS(_32, _imm, _normal, 0); 999 1002 1000 1003 if (ps->isLabel()) 1001 1004 { 1002 1005 switch (popnd->ajt) 1003 1006 { 1004 1007 case ASM_JUMPTYPE_UNSPECIFIED: 1005 1008 if (ps == asmstate.psDollar) 1006 1009 { 1007 1010 if (popnd->disp >= CHAR_MIN && 1008 1011 popnd->disp <= CHAR_MAX) 1009 1012 us = CONSTRUCT_FLAGS(_8, _rel, _flbl,0); … … 1571 1574 pc->IFL2 = FLconst; 1572 1575 break; 1573 1576 } 1574 1577 if (aoptyTable2 == _m || 1575 1578 aoptyTable2 == _rel || 1576 1579 // If not MMX register (_mm) or XMM register (_xmm) 1577 1580 (amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10)) && !uSizemaskTable1) || 1578 1581 aoptyTable2 == _rm || 1579 1582 (popnd1->usFlags == _r32 && popnd2->usFlags == _xmm) || 1580 1583 (popnd1->usFlags == _r32 && popnd2->usFlags == _mm)) 1581 1584 { 1582 1585 #if 0 1583 1586 printf("test4 %d,%d,%d,%d\n", 1584 1587 (aoptyTable2 == _m), 1585 1588 (aoptyTable2 == _rel), 1586 1589 (amodTable1 == _rspecial && !(uRegmaskTable1 & (0x08 | 0x10))), 1587 1590 (aoptyTable2 == _rm) 1588 1591 ); 1589 1592 printf("usOpcode = %x\n", usOpcode); 1590 1593 #endif 1594 if (popnd1->usFlags == _r64) 1595 pc->Irex |= REX_W; 1591 1596 if (ptb.pptb0->usOpcode == 0x0F7E || // MOVD _rm32,_mm 1592 1597 ptb.pptb0->usOpcode == 0x660F7E // MOVD _rm32,_xmm 1593 1598 ) 1594 1599 { 1595 1600 asm_make_modrm_byte( 1596 1601 #ifdef DEBUG 1597 1602 auchOpcode, &usIdx, 1598 1603 #endif 1599 1604 pc, 1600 1605 ptb.pptb1->usFlags, 1601 1606 popnd1, popnd2); 1602 1607 } 1603 1608 else 1604 1609 { 1605 1610 asm_make_modrm_byte( 1606 1611 #ifdef DEBUG 1607 1612 auchOpcode, &usIdx, 1608 1613 #endif 1609 1614 pc, 1610 1615 ptb.pptb1->usFlags, 1611 1616 popnd2, popnd1); 1612 1617 } 1613 1618 popndTmp = popnd1; 1614 1619 aoptyTmp = aoptyTable1; 1615 1620 uSizemaskTmp = uSizemaskTable1; 1616 1621 } 1617 1622 else 1618 1623 { 1624 if (popnd2->usFlags == _r64) 1625 pc->Irex |= REX_W; 1626 1619 1627 if (((aoptyTable1 == _reg || aoptyTable1 == _float) && 1620 1628 amodTable1 == _normal && 1621 1629 (uRegmaskTable1 & _rplus_r))) 1622 1630 { 1623 1631 unsigned reg = popnd1->base->val; 1624 1632 if (reg & 8) 1625 1633 { reg &= 7; 1626 1634 pc->Irex |= REX_B; 1627 1635 assert(I64); 1628 1636 } 1629 1637 if (asmstate.ucItype == ITfloat) 1630 1638 pc->Irm += reg; 1631 1639 else 1632 1640 pc->Iop += reg; 1633 1641 #ifdef DEBUG 1634 1642 auchOpcode[usIdx-1] += reg; 1635 1643 #endif 1636 1644 } 1637 1645 else 1638 1646 if (((aoptyTable2 == _reg || aoptyTable2 == _float) && … … 1822 1830 1823 1831 1824 1832 /******************************* 1825 1833 */ 1826 1834 1827 1835 STATIC void asmerr(int errnum, ...) 1828 1836 { const char *format; 1829 1837 1830 1838 const char *p = asmstate.loc.toChars(); 1831 1839 if (*p) 1832 1840 printf("%s: ", p); 1833 1841 1834 1842 format = asmerrmsgs[errnum]; 1835 1843 va_list ap; 1836 1844 va_start(ap, errnum); 1837 1845 vprintf(format, ap); 1838 1846 va_end(ap); 1839 1847 1840 1848 printf("\n"); 1841 1849 fflush(stdout); 1842 1850 halt(); 1843 1851 longjmp(asmstate.env,1); 1844 1852 } 1845 1853 1846 1854 /******************************* 1847 1855 */ 1848 1856 1849 1857 STATIC void asmerr(const char *format, ...) 1850 1858 { 1851 1859 const char *p = asmstate.loc.toChars(); 1852 1860 if (*p) 1853 1861 printf("%s: ", p); 1854 1862 1855 1863 va_list ap; 1856 1864 va_start(ap, format); 1857 1865 vprintf(format, ap); 1858 1866 va_end(ap); 1859 1867 1860 1868 printf("\n"); 1861 1869 fflush(stdout); 1862 1870 … … 2373 2381 r1r2 = Y(popnd->pregDisp1->val); 2374 2382 switch (r1r2) 2375 2383 { 2376 2384 case X(_BX,_SI): rm = 0; break; 2377 2385 case X(_BX,_DI): rm = 1; break; 2378 2386 case Y(_BX): rm = 7; break; 2379 2387 2380 2388 case X(_BP,_SI): rm = 2; break; 2381 2389 case X(_BP,_DI): rm = 3; break; 2382 2390 case Y(_BP): rm = 6; bDisp = TRUE; break; 2383 2391 2384 2392 case X(_SI,_BX): rm = 0; break; 2385 2393 case X(_SI,_BP): rm = 2; break; 2386 2394 case Y(_SI): rm = 4; break; 2387 2395 2388 2396 case X(_DI,_BX): rm = 1; break; 2389 2397 case X(_DI,_BP): rm = 3; break; 2390 2398 case Y(_DI): rm = 5; break; 2391 2399 2392 2400 default: 2393 asmerr( EM_bad_addr_mode); // illegal addressing mode2401 asmerr("bad 16 bit index address mode"); 2394 2402 } 2395 2403 #undef X 2396 2404 #undef Y 2397 2405 } 2398 2406 mrmb.modregrm.rm = rm; 2399 2407 2400 2408 #ifdef DEBUG 2401 2409 if (debuga) 2402 2410 printf("This is an mod = %d, popnd->s =%p, popnd->disp = %ld\n", 2403 2411 mrmb.modregrm.mod, s, popnd->disp); 2404 2412 #endif 2405 2413 if (!s || (!mrmb.modregrm.mod && popnd->disp)) 2406 2414 { 2407 2415 if ((!popnd->disp && !bDisp) || 2408 2416 !popnd->pregDisp1) 2409 2417 mrmb.modregrm.mod = 0x0; 2410 2418 else 2411 2419 if (popnd->disp >= CHAR_MIN && 2412 2420 popnd->disp <= SCHAR_MAX) 2413 2421 mrmb.modregrm.mod = 0x1; … … 2892 2900 case _fn32: 2893 2901 case _flbl: 2894 2902 return(TRUE); 2895 2903 default: 2896 2904 return(FALSE); 2897 2905 } 2898 2906 case _rseg: 2899 2907 case _rspecial: 2900 2908 return(FALSE); 2901 2909 default: 2902 2910 assert(0); 2903 2911 return 0; 2904 2912 } 2905 2913 } 2906 2914 2907 2915 #ifdef DEBUG 2908 2916 2909 2917 /******************************* 2910 2918 */ 2911 2919 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);2920 STATIC 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); 2918 2926 2919 2927 if (uSizemask == _anysize) 2920 2928 printf("_anysize "); 2921 2929 else if (uSizemask == 0) 2922 2930 printf("0 "); 2923 2931 else 2924 2932 { 2925 2933 if (uSizemask & _8) 2926 2934 printf("_8 "); 2927 2935 if (uSizemask & _16) 2928 2936 printf("_16 "); 2929 2937 if (uSizemask & _32) 2930 2938 printf("_32 "); 2931 2939 if (uSizemask & _48) 2932 2940 printf("_48 "); 2933 2941 if (uSizemask & _64) 2934 2942 printf("_64 "); 2935 2943 } 2936 2944 2937 2945 printf("_"); branches/dmd-1.x/src/win32.mak
r599 r606 92 92 debug.obj code.obj cg87.obj cgsched.obj ee.obj csymbol.obj \ 93 93 cgcod.obj cod1.obj cod2.obj cod3.obj cod4.obj cod5.obj outbuf.obj \ 94 94 bcomplex.obj iasm.obj ptrntab.obj aa.obj ti_achar.obj md5.obj 95 95 96 96 # from ROOT 97 97 98 98 ROOTOBJS= lstring.obj array.obj gnuc.obj man.obj rmem.obj port.obj root.obj \ 99 99 stringtable.obj dchar.obj response.obj async.obj speller.obj aav.obj 100 100 101 101 OBJS= $(OBJ1) $(OBJ8) $(ROOTOBJS) 102 102 103 103 SRCS= mars.c enum.c struct.c dsymbol.c import.c idgen.c impcnvgen.c utf.h \ 104 104 utf.c entity.c identifier.c mtype.c expression.c optimize.c \ 105 105 template.h template.c lexer.c declaration.c cast.c \ 106 106 cond.h cond.c link.c aggregate.h staticassert.h parse.c statement.c \ 107 107 constfold.c version.h version.c inifile.c iasm.c staticassert.c \ 108 108 module.c scope.c dump.c init.h init.c attrib.h attrib.c opover.c \ 109 109 eh.c toctype.c class.c mangle.c bit.c tocsym.c func.c inline.c \ 110 110 access.c complex_t.h unialpha.c irstate.h irstate.c glue.c msc.c \ 111 111 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 \ 113 113 typinf.c tocvdebug.c toelfdebug.c mars.h module.h mtype.h dsymbol.h \ 114 114 declaration.h lexer.h expression.h statement.h doc.h doc.c \ 115 115 macro.h macro.c hdrgen.h hdrgen.c arraytypes.h \ 116 116 delegatize.c toir.h toir.c interpret.c traits.c builtin.c \ 117 117 clone.c lib.h libomf.c libelf.c libmach.c arrayop.c \ 118 118 aliasthis.h aliasthis.c json.h json.c unittests.c imphint.c 119 119 120 120 # From C++ compiler 121 121 122 122 BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \ 123 123 $C\global.h $C\parser.h $C\code.h $C\type.h $C\dt.h $C\cgcv.h \ 124 124 $C\el.h $C\iasm.h $C\rtlsym.h $C\html.h \ 125 125 $C\bcomplex.c $C\blockopt.c $C\cg.c $C\cg87.c \ 126 126 $C\cgcod.c $C\cgcs.c $C\cgcv.c $C\cgelem.c $C\cgen.c $C\cgobj.c \ 127 127 $C\cgreg.c $C\var.c \ 128 128 $C\cgsched.c $C\cod1.c $C\cod2.c $C\cod3.c $C\cod4.c $C\cod5.c \ 129 129 $C\code.c $C\symbol.c $C\debug.c $C\dt.c $C\ee.c $C\el.c \ 130 130 $C\evalu8.c $C\go.c $C\gflow.c $C\gdag.c \ 131 131 $C\gother.c $C\glocal.c $C\gloop.c $C\html.c $C\newman.c \ 132 132 $C\nteh.c $C\os.c $C\out.c $C\outbuf.c $C\ptrntab.c $C\rtlsym.c \ … … 478 478 statement.obj : $(TOTALH) statement.h statement.c 479 479 staticassert.obj : $(TOTALH) staticassert.h staticassert.c 480 480 struct.obj : $(TOTALH) identifier.h enum.h struct.c 481 481 traits.obj : $(TOTALH) traits.c 482 482 dsymbol.obj : $(TOTALH) identifier.h dsymbol.h dsymbol.c 483 483 mtype.obj : $(TOTALH) mtype.h mtype.c 484 484 #typinf.obj : $(TOTALH) mtype.h typinf.c 485 485 utf.obj : utf.h utf.c 486 486 template.obj : $(TOTALH) template.h template.c 487 487 version.obj : $(TOTALH) identifier.h dsymbol.h cond.h version.h version.c 488 488 489 489 ################### Utilities ################ 490 490 491 491 clean: 492 492 del *.obj 493 493 del total.sym 494 494 del msgs.h msgs.c 495 495 del elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c 496 496 del impcnvtab.c 497 497 498 zip : detab $(MAKEFILES)498 zip : detab tolf $(MAKEFILES) 499 499 del dmdsrc.zip 500 500 zip32 dmdsrc $(MAKEFILES) 501 501 zip32 dmdsrc $(SRCS) 502 502 zip32 dmdsrc $(BACKSRC) 503 503 zip32 dmdsrc $(TKSRC) 504 504 zip32 dmdsrc $(ROOTSRC) 505 505 506 506 ################### Detab ################ 507 507 508 508 detab: 509 509 detab $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) 510 511 tolf: 512 tolf $(SRCS) $(ROOTSRC) $(TKSRC) $(BACKSRC) $(MAKEFILES) 510 513 511 514 ################### Install ################ 512 515 513 516 install: detab install2 514 517 515 518 install2: 516 519 copy dmd.exe $(DIR)\windows\bin\ 517 520 copy phobos\phobos.lib $(DIR)\windows\lib 518 521 $(CP) $(SRCS) $(DIR)\src\dmd\ 519 522 $(CP) $(ROOTSRC) $(DIR)\src\dmd\root\ 520 523 $(CP) $(TKSRC) $(DIR)\src\dmd\tk\ 521 524 $(CP) $(BACKSRC) $(DIR)\src\dmd\backend\ 522 525 $(CP) $(MAKEFILES) $(DIR)\src\dmd\ 523 526 copy gpl.txt $(DIR)\src\dmd\ 524 527 copy readme.txt $(DIR)\src\dmd\ 525 528 copy artistic.txt $(DIR)\src\dmd\ 526 529 copy backendlicense.txt $(DIR)\src\dmd\ 527 530 528 531 ################### Write to SVN ################ 529 532 530 svn: detab svn2533 svn: detab tolf svn2 531 534 532 535 svn2: 533 536 $(CP) $(SRCS) $(DMDSVN)\ 534 537 $(CP) $(ROOTSRC) $(DMDSVN)\root\ 535 538 $(CP) $(TKSRC) $(DMDSVN)\tk\ 536 539 $(CP) $(BACKSRC) $(DMDSVN)\backend\ 537 540 $(CP) $(MAKEFILES) $(DMDSVN)\ 538 541 copy gpl.txt $(DMDSVN)\ 539 542 copy readme.txt $(DMDSVN)\ 540 543 copy artistic.txt $(DMDSVN)\ 541 544 copy backendlicense.txt $(DMDSVN)\ 542 545 543 546 ###################################
