소스 검색

- removed A_CLTD opcode (use A_CDQ instead)
* changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
* in daopt386: adapted AsmInstr array to reflect changes + fixed line too long

Jonas Maebe 27 년 전
부모
커밋
31cc13417a
3개의 변경된 파일26개의 추가작업 그리고 16개의 파일을 삭제
  1. 7 2
      compiler/cg386mat.pas
  2. 7 7
      compiler/daopt386.pas
  3. 12 7
      compiler/i386.pas

+ 7 - 2
compiler/cg386mat.pas

@@ -142,7 +142,7 @@ implementation
               if porddef(p^.left^.resulttype)^.typ=u32bit then
                  exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_L,R_EDX,R_EDX)))
               else
-                 exprasmlist^.concat(new(pai386,op_none(A_CLTD,S_NO)));
+                 exprasmlist^.concat(new(pai386,op_none(A_CDQ,S_NO)));
 
               { division depends on the right type }
               if porddef(p^.right^.resulttype)^.typ=u32bit then
@@ -534,7 +534,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.11  1998-11-05 14:26:02  peter
+  Revision 1.12  1998-11-26 21:45:29  jonas
+    - removed A_CLTD opcode (use A_CDQ instead)
+    * changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
+    * in daopt386: adapted AsmInstr array to reflect changes + fixed line too long
+
+  Revision 1.11  1998/11/05 14:26:02  peter
     * fixed shlshr which would push ecx when not needed
 
   Revision 1.10  1998/10/20 13:12:38  peter

+ 7 - 7
compiler/daopt386.pas

@@ -264,7 +264,6 @@ Const AsmInstr: Array[tasmop] Of TAsmInstrucProp = (
   {FCHS} (Ch: (C_FPU, C_None, C_None)),
   {FLD1} (Ch: (C_FPU, C_None, C_None)),
  {FIDIV} (Ch: (C_FPU, C_None, C_None)),
-  {CLTD} (Ch: (C_WEDX, C_REAX, C_None)),
    {JNZ} (Ch: (C_RFlags, C_None, C_None)),
   {FSTP} (Ch: (C_WOp1, C_FPU, C_None)),
    {AND} (Ch: (C_RWOp2, C_ROp1, C_WFlags)),
@@ -318,7 +317,7 @@ Const AsmInstr: Array[tasmop] Of TAsmInstrucProp = (
    {CLI} (Ch: (C_WFlags, C_None, C_None)),
   {CLTS} (Ch: (C_None, C_None, C_None)),
    {CMC} (Ch: (C_WFlags, C_None, C_None)),
-   {CWD} (Ch: (C_RWEAX, C_None, C_None)),
+   {CWD} (Ch: (C_RWEAX, C_WEDX, C_None)),
   {CWDE} (Ch: (C_RWEAX, C_None, C_None)),
    {DAA} (Ch: (C_RWEAX, C_None, C_None)),
    {DAS} (Ch: (C_RWEAX, C_None, C_None)),
@@ -328,7 +327,8 @@ Const AsmInstr: Array[tasmop] Of TAsmInstrucProp = (
   {LODS} (Ch: (C_WEAX, C_RWESI, C_None)),
   {LOCK} (Ch: (C_None, C_None, C_None)),
    {NOP} (Ch: (C_None, C_None, C_None)),
- {PUSHA} (Ch: (C_ALL, C_None, C_None)), {not true, but a pushall is usually followed by an instruction that does, so it won huert either}
+ {PUSHA} (Ch: (C_ALL, C_None, C_None)), {not true, but a pushall is usually followed by an instruction that does, so
+                                         it won hurt either}
  {PUSHF} (Ch: (C_RWESP, C_RFlags, C_None)),
 {PUSHFD} (Ch: (C_RWESP, C_RFlags, C_None)),
    {STC} (Ch: (C_WFlags, C_None, C_None)),
@@ -1531,7 +1531,6 @@ End;
 
 Procedure ReadReg(p: PPaiProp; Reg: TRegister);
 Begin
-//  if Reg in [R_EAX..R_EDI] then
     IncState(p^.Regs[Reg32(Reg)].RState)
 End;
 
@@ -2082,9 +2081,10 @@ End.
 
 {
  $Log$
- Revision 1.28  1998-11-26 15:43:24  jonas
-   * several small fixes in the AsmInstr table (concerning reading/writing from
-     regs/mem, doesn't affect current optimizer)
+ Revision 1.29  1998-11-26 21:45:31  jonas
+   - removed A_CLTD opcode (use A_CDQ instead)
+   * changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
+   * in daopt386: adapted AsmInstr array to reflect changes + fixed line too long
 
  Revision 1.27  1998/11/24 19:47:22  jonas
    * fixed problems posible with 3 operand instructions

+ 12 - 7
compiler/i386.pas

@@ -38,7 +38,7 @@ unit i386;
          A_FILD,A_CMP,A_JZ,A_INC,A_DEC,A_SETE,A_SETNE,A_SETL,
          A_SETG,A_SETLE,A_SETGE,A_JE,A_JNE,A_JL,A_JG,A_JLE,A_JGE,
          A_OR,A_FLD,A_FADD,A_FMUL,A_FSUB,A_FDIV,A_FCHS,A_FLD1,
-         A_FIDIV,A_CLTD,A_JNZ,A_FSTP,A_AND,A_JNO,A_NOTH,A_NONE,
+         A_FIDIV,A_JNZ,A_FSTP,A_AND,A_JNO,A_NOTH,A_NONE,
          A_ENTER,A_LEAVE,A_CLD,A_MOVS,A_REP,A_SHL,A_SHR,A_BOUND,
          A_JNS,A_JS,A_JO,A_SAR,A_TEST,
          A_FCOM,A_FCOMP,A_FCOMPP,A_FXCH,A_FADDP,A_FMULP,A_FSUBP,A_FDIVP,
@@ -440,7 +440,7 @@ unit i386;
     const
        last_instruction_in_cache = A_EMMS;
     type
-    
+
        tins_cache = array[A_MOV..last_instruction_in_cache] of longint;
 
     var
@@ -924,14 +924,14 @@ unit i386;
         'fild','cmp','jz','inc','dec','sete','setne','setl',
         'setg','setle','setge','je','jne','jl','jg','jle','jge',
         'or','fld','fadd','fmul','fsub','fdiv','fchs','fld1',
-        'fidiv','cltd','jnz','fstp','and','jno','','',
+        'fidiv','jnz','fstp','and','jno','','',
         'enter','leave','cld','movs','rep','shl','shr','bound',
         'jns','js','jo','sar','test',
         'fcom','fcomp','fcompp','fxch','faddp','fmulp','fsubp','fdivp',
         'fnsts','sahf','fdivrp','fsubrp','setc','setnc','jc','jnc',
         'ja','jae','jb','jbe','seta','setae','setb','setbe',
-        'aaa','aad','aam','aas','cbw','cdq','clc','cli',
-        'clts','cmc','cwd','cwde','daa','das','hlt','iret','lahf',
+        'aaa','aad','aam','aas','cbtw','cltd','clc','cli',
+        'clts','cmc','cwtd','cwtl','daa','das','hlt','iret','lahf',
         'lods','lock','nop','pusha','pushf','pushfl',
         'stc','std','sti','stos','wait','xlat','xlatb','movsb',
         'movsbl','movsbw','movswl','movsb','movzwl','popa','in',
@@ -995,7 +995,7 @@ unit i386;
         'fild','cmp','jz','inc','dec','sete','setne','setl',
         'setg','setle','setge','je','jne','jl','jg','jle','jge',
         'or','fld','fadd','fmul','fsub','fdiv','fchs','fld1',
-        'fidiv','cltd','jnz','fstp','and','jno','','',
+        'fidiv','jnz','fstp','and','jno','','',
         'enter','leave','cld','movs','rep','shl','shr','bound',
         'jns','js','jo','sar','test',
         'fcom','fcomp','fcompp','fxch','faddp','fmulp','fsubrp','fdivp',
@@ -1731,7 +1731,12 @@ unit i386;
 end.
 {
   $Log$
-  Revision 1.17  1998-11-13 15:40:19  pierre
+  Revision 1.18  1998-11-26 21:45:30  jonas
+    - removed A_CLTD opcode (use A_CDQ instead)
+    * changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
+    * in daopt386: adapted AsmInstr array to reflect changes + fixed line too long
+
+  Revision 1.17  1998/11/13 15:40:19  pierre
     + added -Se in Makefile cvstest target
     + lexlevel cleanup
       normal_function_level main_program_level and unit_init_level defined