mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 08:31:49 +01:00 
			
		
		
		
	* changes to work with -dUSE_OP3
This commit is contained in:
		
							parent
							
								
									c7c74f2895
								
							
						
					
					
						commit
						e16f0f99db
					
				| @ -190,9 +190,11 @@ Type | |||||||
|   TLabelTable = Array[0..2500000] Of TLabelTableItem; |   TLabelTable = Array[0..2500000] Of TLabelTableItem; | ||||||
| {$Endif tp} | {$Endif tp} | ||||||
|   PLabelTable = ^TLabelTable; |   PLabelTable = ^TLabelTable; | ||||||
|  | {$IfNDef USE_OP3} | ||||||
|   TwoWords = Record |   TwoWords = Record | ||||||
|                Word1, Word2: Word; |                Word1, Word2: Word; | ||||||
|              End; |              End; | ||||||
|  | {$EndIf USE_OP3} | ||||||
| 
 | 
 | ||||||
| {******************************* Variables *******************************} | {******************************* Variables *******************************} | ||||||
| 
 | 
 | ||||||
| @ -1112,17 +1114,23 @@ Begin | |||||||
|       If Not(TmpResult) Then |       If Not(TmpResult) Then | ||||||
|         Case Pai386(p1)^.op2t Of |         Case Pai386(p1)^.op2t Of | ||||||
|           Top_Reg: |           Top_Reg: | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |              TmpResult := Reg = TRegister(Pai386(p1)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|               if Pai386(p1)^.op3t<>Top_reg |               if Pai386(p1)^.op3t<>Top_reg | ||||||
|                 then TmpResult := Reg = TRegister(Pai386(p1)^.op2) |                 then TmpResult := Reg = TRegister(Pai386(p1)^.op2) | ||||||
|                 else TmpResult := longint(Reg) = twowords(Pai386(p1)^.op2).word1; |                 else TmpResult := longint(Reg) = twowords(Pai386(p1)^.op2).word1; | ||||||
|  | {$EndIf USE_OP3} | ||||||
|           Top_Ref: TmpResult := RegInRef(Reg, TReference(Pai386(p1)^.op2^)) |           Top_Ref: TmpResult := RegInRef(Reg, TReference(Pai386(p1)^.op2^)) | ||||||
|         End; |         End; | ||||||
|       If Not(TmpResult) Then |       If Not(TmpResult) Then | ||||||
|         Case Pai386(p1)^.op3t Of |         Case Pai386(p1)^.op3t Of | ||||||
|           Top_Reg: TmpResult := longint(Reg) =twowords(Pai386(p1)^.op2).word2; | {$IfDef USE_OP3} | ||||||
|           Top_none:; |           Top_Reg: TmpResult := Reg = TRegister(Pai386(p1)^.op3); | ||||||
|           else |           Top_Ref: TmpResult := RegInRef(Reg, TReference(Pai386(p1)^.op3^)); | ||||||
|              internalerror($Da); | {$Else USE_OP3} | ||||||
|  |           Top_Reg: TmpResult := longint(Reg) = twowords(Pai386(p1)^.op2).word2; | ||||||
|  | {$EndIf USE_OP3} | ||||||
|        End |        End | ||||||
|     End; |     End; | ||||||
|   RegInInstruction := TmpResult |   RegInInstruction := TmpResult | ||||||
| @ -1411,7 +1419,11 @@ Begin | |||||||
|       Case Pai386(p)^.op2t Of |       Case Pai386(p)^.op2t Of | ||||||
|         top_reg: |         top_reg: | ||||||
|           If Not(TRegister(Pai386(p)^.op2) in [R_NO,R_ESP,ProcInfo.FramePointer]) Then |           If Not(TRegister(Pai386(p)^.op2) in [R_NO,R_ESP,ProcInfo.FramePointer]) Then | ||||||
|             If RegSet := RegSet + [TRegister(TwoWords(Pai386(p)^.op2).Word1]; | {$IfDef USE_OP3} | ||||||
|  |             RegSet := RegSet + [TRegister(Pai386(p)^.op2)]; | ||||||
|  | {$EndIf USE_OP3} | ||||||
|  |             RegSet := RegSet + [TRegister(TwoWords(Pai386(p)^.op2).Word1]; | ||||||
|  | {$EndIf USE_OP3} | ||||||
|         top_ref: |         top_ref: | ||||||
|           With TReference(Pai386(p)^.op2^) Do |           With TReference(Pai386(p)^.op2^) Do | ||||||
|             Begin |             Begin | ||||||
| @ -1534,6 +1546,12 @@ Begin {checks whether two Pai386 instructions are equal} | |||||||
|           End |           End | ||||||
|       Else |       Else | ||||||
|  {an instruction <> mov, movzx, movsx} |  {an instruction <> mov, movzx, movsx} | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |         InstructionsEquivalent := | ||||||
|  |           OpsEquivalent(Pai386(p1)^.op1t, Pai386(p1)^.op1, Pai386(p2)^.op1, RegInfo, OpAct_Unknown) And | ||||||
|  |           OpsEquivalent(Pai386(p1)^.op2t, Pai386(p1)^.op2, Pai386(p2)^.op2, RegInfo, OpAct_Unknown) And | ||||||
|  |           OpsEquivalent(Pai386(p1)^.op3t, Pai386(p1)^.op3, Pai386(p2)^.op3, RegInfo, OpAct_Unknown) | ||||||
|  | {$Else USE_OP3} | ||||||
|         If (Pai386(p1)^.op3t = top_none) Then |         If (Pai386(p1)^.op3t = top_none) Then | ||||||
|           InstructionsEquivalent := |           InstructionsEquivalent := | ||||||
|             OpsEquivalent(Pai386(p1)^.op1t, Pai386(p1)^.op1, Pai386(p2)^.op1, RegInfo, OpAct_Unknown) And |             OpsEquivalent(Pai386(p1)^.op1t, Pai386(p1)^.op1, Pai386(p2)^.op1, RegInfo, OpAct_Unknown) And | ||||||
| @ -1545,6 +1563,7 @@ Begin {checks whether two Pai386 instructions are equal} | |||||||
|                           Pointer(Longint(TwoWords(Pai386(p2)^.op2).Word1)), RegInfo, OpAct_Unknown) And |                           Pointer(Longint(TwoWords(Pai386(p2)^.op2).Word1)), RegInfo, OpAct_Unknown) And | ||||||
|             OpsEquivalent(Pai386(p1)^.op3t, Pointer(Longint(TwoWords(Pai386(p1)^.op2).Word2)), |             OpsEquivalent(Pai386(p1)^.op3t, Pointer(Longint(TwoWords(Pai386(p1)^.op2).Word2)), | ||||||
|                           Pointer(Longint(TwoWords(Pai386(p2)^.op2).Word2)), RegInfo, OpAct_Unknown) |                           Pointer(Longint(TwoWords(Pai386(p2)^.op2).Word2)), RegInfo, OpAct_Unknown) | ||||||
|  | {$EndIf USE_OP3} | ||||||
|  {the instructions haven't even got the same structure, so they're certainly |  {the instructions haven't even got the same structure, so they're certainly | ||||||
|   not equivalent} |   not equivalent} | ||||||
|     Else InstructionsEquivalent := False; |     Else InstructionsEquivalent := False; | ||||||
| @ -2049,10 +2068,13 @@ Begin | |||||||
|               A_IMUL: |               A_IMUL: | ||||||
|                 Begin |                 Begin | ||||||
|                   ReadOp(CurProp, Pai386(p)^.Op1t, Pai386(p)^.Op1); |                   ReadOp(CurProp, Pai386(p)^.Op1t, Pai386(p)^.Op1); | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                   ReadOp(CurProp, Pai386(p)^.Op2t, Pai386(p)^.Op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                   If (Pai386(p)^.Op2t = Top_Ref) Then |                   If (Pai386(p)^.Op2t = Top_Ref) Then | ||||||
|                     ReadOp(CurProp, Pai386(p)^.Op2t, Pai386(p)^.Op2) |                     ReadOp(CurProp, Pai386(p)^.Op2t, Pai386(p)^.Op2) | ||||||
|                   Else ReadOp(CurProp, Pai386(p)^.Op2t, Pointer(Longint(TwoWords(Pai386(p)^.Op2).Word1))); |                   Else ReadOp(CurProp, Pai386(p)^.Op2t, Pointer(Longint(TwoWords(Pai386(p)^.Op2).Word1))); | ||||||
|                   ReadOp(CurProp, Pai386(p)^.Op3t, Pointer(LongInt(TwoWords(Pai386(p)^.Op2).Word2))); | {$EndIf USE_OP3} | ||||||
|                   If (Pai386(p)^.Op3t = top_none) |                   If (Pai386(p)^.Op3t = top_none) | ||||||
|                    Then |                    Then | ||||||
|                      If (Pai386(p)^.Op2t = top_none) |                      If (Pai386(p)^.Op2t = top_none) | ||||||
| @ -2062,7 +2084,11 @@ Begin | |||||||
|                            DestroyReg(CurProp, R_EDX) |                            DestroyReg(CurProp, R_EDX) | ||||||
|                          End |                          End | ||||||
|                        Else Destroy(p, Pai386(p)^.Op2t, Pai386(p)^.Op2) |                        Else Destroy(p, Pai386(p)^.Op2t, Pai386(p)^.Op2) | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                    Else Destroy(p, Pai386(p)^.Op3t, Pai386(p)^.Op3); | ||||||
|  | {$Else USE_OP3} | ||||||
|                    Else DestroyReg(CurProp, TRegister(longint(twowords(Pai386(p)^.Op2).word2))); |                    Else DestroyReg(CurProp, TRegister(longint(twowords(Pai386(p)^.Op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                 End; |                 End; | ||||||
|               A_XOR: |               A_XOR: | ||||||
|                 Begin |                 Begin | ||||||
| @ -2096,16 +2122,35 @@ Begin | |||||||
|                         C_CDirFlag: CurProp^.DirFlag := F_NotSet; |                         C_CDirFlag: CurProp^.DirFlag := F_NotSet; | ||||||
|                         C_SDirFlag: CurProp^.DirFlag := F_Set; |                         C_SDirFlag: CurProp^.DirFlag := F_Set; | ||||||
|                         C_ROp1: ReadOp(CurProp, Pai386(p)^.op1t, Pai386(p)^.op1); |                         C_ROp1: ReadOp(CurProp, Pai386(p)^.op1t, Pai386(p)^.op1); | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                         C_ROp2: ReadOp(CurProp, Pai386(p)^.op2t, Pai386(p)^.op2); | ||||||
|  |                         C_ROp3: ReadOp(CurProp, Pai386(p)^.op3t, Pai386(p)^.op3); | ||||||
|  | {$Else USE_OP3} | ||||||
|                         C_ROp2: If (Pai386(p)^.Op3t = top_none) Then |                         C_ROp2: If (Pai386(p)^.Op3t = top_none) Then | ||||||
|                                   ReadOp(CurProp, Pai386(p)^.op2t, Pai386(p)^.op2) |                                   ReadOp(CurProp, Pai386(p)^.op2t, Pai386(p)^.op2) | ||||||
|                                 Else ReadOp(CurProp, Pai386(p)^.op2t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word1))); |                                 Else ReadOp(CurProp, Pai386(p)^.op2t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word1))); | ||||||
|                         C_ROp3: ReadOp(CurProp, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); |                         C_ROp3: ReadOp(CurProp, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                         C_WOp1..C_RWOp1: |                         C_WOp1..C_RWOp1: | ||||||
|                           Begin |                           Begin | ||||||
|                             If (InstrProp.Ch[Cnt] = C_RWOp1) Then |                             If (InstrProp.Ch[Cnt] = C_RWOp1) Then | ||||||
|                               ReadOp(CurProp, Pai386(p)^.op1t, Pai386(p)^.op1); |                               ReadOp(CurProp, Pai386(p)^.op1t, Pai386(p)^.op1); | ||||||
|                             Destroy(p, Pai386(p)^.op1t, Pai386(p)^.op1); |                             Destroy(p, Pai386(p)^.op1t, Pai386(p)^.op1); | ||||||
|                           End; |                           End; | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                         C_WOp2..C_RWOp2: | ||||||
|  |                           Begin | ||||||
|  |                             If (InstrProp.Ch[Cnt] = C_RWOp2) Then | ||||||
|  |                               ReadOp(CurProp, Pai386(p)^.op2t, Pai386(p)^.op2); | ||||||
|  |                             Destroy(p, Pai386(p)^.op2t, Pai386(p)^.op2); | ||||||
|  |                           End; | ||||||
|  |                         C_WOp3..C_RWOp3: | ||||||
|  |                           Begin | ||||||
|  |                             If (InstrProp.Ch[Cnt] = C_RWOp3) Then | ||||||
|  |                               ReadOp(CurProp, Pai386(p)^.op3t, Pai386(p)^.op3); | ||||||
|  |                             Destroy(p, Pai386(p)^.op3t, Pai386(p)^.op3); | ||||||
|  |                           End; | ||||||
|  | {$Else USE_OP3} | ||||||
|                         C_WOp2..C_RWOp2: |                         C_WOp2..C_RWOp2: | ||||||
|                           Begin |                           Begin | ||||||
|                             If (InstrProp.Ch[Cnt] = C_RWOp2) Then |                             If (InstrProp.Ch[Cnt] = C_RWOp2) Then | ||||||
| @ -2122,6 +2167,7 @@ Begin | |||||||
|                               ReadOp(CurProp, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); |                               ReadOp(CurProp, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); | ||||||
|                             Destroy(p, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); |                             Destroy(p, Pai386(p)^.op3t, Pointer(Longint(TwoWords(Pai386(p)^.op2).word2))); | ||||||
|                           End; |                           End; | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                         C_WMemEDI: |                         C_WMemEDI: | ||||||
|                           Begin |                           Begin | ||||||
|                             ReadReg(CurProp, R_EDI); |                             ReadReg(CurProp, R_EDI); | ||||||
| @ -2240,7 +2286,10 @@ End. | |||||||
| 
 | 
 | ||||||
| { | { | ||||||
|  $Log$ |  $Log$ | ||||||
|  Revision 1.41  1999-04-16 13:42:33  jonas |  Revision 1.42  1999-04-16 15:16:31  jonas | ||||||
|  |    * changes to work with -dUSE_OP3 | ||||||
|  | 
 | ||||||
|  |  Revision 1.41  1999/04/16 13:42:33  jonas | ||||||
|    * more regalloc fixes (still not complete) |    * more regalloc fixes (still not complete) | ||||||
| 
 | 
 | ||||||
|  Revision 1.40  1999/04/16 11:49:41  peter |  Revision 1.40  1999/04/16 11:49:41  peter | ||||||
|  | |||||||
| @ -373,8 +373,13 @@ Begin | |||||||
|                       Else |                       Else | ||||||
|                        {change "imul $1, reg1, reg2" to "mov reg1, reg2"} |                        {change "imul $1, reg1, reg2" to "mov reg1, reg2"} | ||||||
|                         Begin |                         Begin | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                           hp1 := New(Pai386, Op_Reg_Reg(A_MOV, S_L, TRegister(Pai386(p)^.op2), | ||||||
|  |                                                         TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                           hp1 := New(Pai386, Op_Reg_Reg(A_MOV, S_L, TRegister(TwoWords(Pai386(p)^.op2).Word1), |                           hp1 := New(Pai386, Op_Reg_Reg(A_MOV, S_L, TRegister(TwoWords(Pai386(p)^.op2).Word1), | ||||||
|                                                         TRegister(TwoWords(Pai386(p)^.op2).Word2))); |                                                         TRegister(TwoWords(Pai386(p)^.op2).Word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                           hp1^.fileinfo := p^.fileinfo; |                           hp1^.fileinfo := p^.fileinfo; | ||||||
|                           InsertLLItem(AsmL, p^.previous, p^.next, hp1); |                           InsertLLItem(AsmL, p^.previous, p^.next, hp1); | ||||||
|                           Dispose(p, Done); |                           Dispose(p, Done); | ||||||
| @ -401,13 +406,22 @@ Begin | |||||||
|                                 lea (reg1,reg1,2), reg2 |                                 lea (reg1,reg1,2), reg2 | ||||||
|                               imul 3, reg1 to |                               imul 3, reg1 to | ||||||
|                                 lea (reg1,reg1,2), reg1} |                                 lea (reg1,reg1,2), reg1} | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                TmpRef^.base := TRegister(Pai386(p)^.op2); | ||||||
|  |                                TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); |                                TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|                                TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                TmpRef^.ScaleFactor := 2; |                                TmpRef^.ScaleFactor := 2; | ||||||
|                                If (Pai386(p)^.op3t = Top_None) |                                If (Pai386(p)^.op3t = Top_None) | ||||||
|                                  Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) |                                  Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) | ||||||
|                                  Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                  Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                   TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                   TRegister(twowords(Pai386(p)^.op2).word2))); |                                   TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                hp1^.fileinfo := p^.fileinfo; |                                hp1^.fileinfo := p^.fileinfo; | ||||||
|                                InsertLLItem(AsmL,p^.previous, p^.next, hp1); |                                InsertLLItem(AsmL,p^.previous, p^.next, hp1); | ||||||
|                                Dispose(p, Done); |                                Dispose(p, Done); | ||||||
| @ -418,13 +432,22 @@ Begin | |||||||
|                                lea (reg1,reg1,4), reg2 |                                lea (reg1,reg1,4), reg2 | ||||||
|                              imul 5, reg1 to |                              imul 5, reg1 to | ||||||
|                                lea (reg1,reg1,4), reg1} |                                lea (reg1,reg1,4), reg1} | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                               TmpRef^.base := TRegister(Pai386(p)^.op2); | ||||||
|  |                               TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                               TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); |                               TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|                               TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                               TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                               TmpRef^.ScaleFactor := 4; |                               TmpRef^.ScaleFactor := 4; | ||||||
|                               If (Pai386(p)^.op3t = Top_None) |                               If (Pai386(p)^.op3t = Top_None) | ||||||
|                                 Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) |                                 Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) | ||||||
|                                 Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                 Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                  TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                  TRegister(twowords(Pai386(p)^.op2).word2))); |                                  TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                               hp1^.fileinfo:= p^.fileinfo; |                               hp1^.fileinfo:= p^.fileinfo; | ||||||
|                               InsertLLItem(AsmL,p^.previous, p^.next, hp1); |                               InsertLLItem(AsmL,p^.previous, p^.next, hp1); | ||||||
|                               Dispose(p, Done); |                               Dispose(p, Done); | ||||||
| @ -440,14 +463,26 @@ Begin | |||||||
|                               If (aktoptprocessor <= Class386) |                               If (aktoptprocessor <= Class386) | ||||||
|                                 Then |                                 Then | ||||||
|                                   Begin |                                   Begin | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                     TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                     TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                     TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                     If (Pai386(p)^.op3t = Top_Reg) |                                     If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                       Then |                                       Then | ||||||
|                                         Begin |                                         Begin | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                           TmpRef^.base := TRegister(Pai386(p)^.op3); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                           TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).word2); |                                           TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).word2); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                           TmpRef^.ScaleFactor := 4; |                                           TmpRef^.ScaleFactor := 4; | ||||||
|                                           hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                           hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                             TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                             TRegister(twowords(Pai386(p)^.op2).word2))); |                                             TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                         End |                                         End | ||||||
|                                       Else |                                       Else | ||||||
|                                         Begin |                                         Begin | ||||||
| @ -459,14 +494,22 @@ Begin | |||||||
|                                     InsertLLItem(AsmL,p, p^.next, hp1); |                                     InsertLLItem(AsmL,p, p^.next, hp1); | ||||||
|                                     New(TmpRef); |                                     New(TmpRef); | ||||||
|                                     Reset_reference(TmpRef^); |                                     Reset_reference(TmpRef^); | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                     TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                     TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                     TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                     TmpRef^.ScaleFactor := 2; |                                     TmpRef^.ScaleFactor := 2; | ||||||
|                                     If (Pai386(p)^.op3t = Top_Reg) |                                     If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                       Then |                                       Then | ||||||
|                                         Begin |                                         Begin | ||||||
|                                           TmpRef^.base := R_NO; |                                           TmpRef^.base := R_NO; | ||||||
|                                           hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                           hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                             TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                             TRegister(twowords(Pai386(p)^.op2).word2))); |                                             TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                         End |                                         End | ||||||
|                                       Else |                                       Else | ||||||
|                                         Begin |                                         Begin | ||||||
| @ -485,13 +528,22 @@ Begin | |||||||
|                                 lea (reg1,reg1,8), reg2 |                                 lea (reg1,reg1,8), reg2 | ||||||
|                               imul 9, reg1 to |                               imul 9, reg1 to | ||||||
|                                 lea (reg1,reg1,8), reg1} |                                 lea (reg1,reg1,8), reg1} | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                TmpRef^.base := TRegister(Pai386(p)^.op2); | ||||||
|  |                                TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); |                                TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|                                TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                TmpRef^.ScaleFactor := 8; |                                TmpRef^.ScaleFactor := 8; | ||||||
|                                If (Pai386(p)^.op3t = Top_None) |                                If (Pai386(p)^.op3t = Top_None) | ||||||
|                                    Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) |                                    Then hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2))) | ||||||
|                                    Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                    Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                      TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                      TRegister(twowords(Pai386(p)^.op2).word2))); |                                      TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                  hp1^.fileinfo := p^.fileinfo; |                                  hp1^.fileinfo := p^.fileinfo; | ||||||
|                                  InsertLLItem(AsmL,p^.previous, p^.next, hp1); |                                  InsertLLItem(AsmL,p^.previous, p^.next, hp1); | ||||||
|                                  Dispose(p, Done); |                                  Dispose(p, Done); | ||||||
| @ -509,19 +561,33 @@ Begin | |||||||
|                                    If (Pai386(p)^.op3t = Top_Reg) |                                    If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                      Then |                                      Then | ||||||
|                                        hp1 :=  New(Pai386, op_reg_reg(A_ADD, S_L, |                                        hp1 :=  New(Pai386, op_reg_reg(A_ADD, S_L, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                           Tregister(Pai386(p)^.op3), | ||||||
|  |                                           Tregister(Pai386(p)^.op3))) | ||||||
|  | {$Else USE_OP3} | ||||||
|                                           Tregister(twowords(Pai386(p)^.op2).word2), |                                           Tregister(twowords(Pai386(p)^.op2).word2), | ||||||
|                                           Tregister(twowords(Pai386(p)^.op2).word2))) |                                           Tregister(twowords(Pai386(p)^.op2).word2))) | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                      Else hp1 := New(Pai386, op_reg_reg(A_ADD, S_L, |                                      Else hp1 := New(Pai386, op_reg_reg(A_ADD, S_L, | ||||||
|                                               TRegister(Pai386(p)^.op2), TRegister(Pai386(p)^.op2))); |                                               TRegister(Pai386(p)^.op2), TRegister(Pai386(p)^.op2))); | ||||||
|                                    hp1^.fileinfo := p^.fileinfo; |                                    hp1^.fileinfo := p^.fileinfo; | ||||||
|                                    InsertLLItem(AsmL,p, p^.next, hp1); |                                    InsertLLItem(AsmL,p, p^.next, hp1); | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                    TmpRef^.base := TRegister(Pai386(p)^.op2); | ||||||
|  |                                    TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                    TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); |                                    TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|                                    TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                    TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                    TmpRef^.ScaleFactor := 4; |                                    TmpRef^.ScaleFactor := 4; | ||||||
|                                    If (Pai386(p)^.op3t = Top_Reg) |                                    If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                      Then |                                      Then | ||||||
|                                        hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                        hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                           TRegister(Pai386(p)^.op3))) | ||||||
|  | {$Else USE_OP3} | ||||||
|                                           TRegister(twowords(Pai386(p)^.op2).word2))) |                                           TRegister(twowords(Pai386(p)^.op2).word2))) | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                      Else |                                      Else | ||||||
|                                        hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                        hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|                                           TRegister(Pai386(p)^.op2))); |                                           TRegister(Pai386(p)^.op2))); | ||||||
| @ -542,14 +608,26 @@ Begin | |||||||
|                                If (aktoptprocessor <= Class386) |                                If (aktoptprocessor <= Class386) | ||||||
|                                  Then |                                  Then | ||||||
|                                    Begin |                                    Begin | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                      TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                      TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                      TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                      If (Pai386(p)^.op3t = Top_Reg) |                                      If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                        Then |                                        Then | ||||||
|                                          Begin |                                          Begin | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                            TmpRef^.base := TRegister(Pai386(p)^.op3); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                            TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).word2); |                                            TmpRef^.base := TRegister(twowords(Pai386(p)^.op2).word2); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                            TmpRef^.ScaleFactor := 8; |                                            TmpRef^.ScaleFactor := 8; | ||||||
|                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                              TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                              TRegister(twowords(Pai386(p)^.op2).word2))); |                                              TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                          End |                                          End | ||||||
|                                        Else |                                        Else | ||||||
|                                          Begin |                                          Begin | ||||||
| @ -562,14 +640,22 @@ Begin | |||||||
|                                      InsertLLItem(AsmL,p, p^.next, hp1); |                                      InsertLLItem(AsmL,p, p^.next, hp1); | ||||||
|                                      New(TmpRef); |                                      New(TmpRef); | ||||||
|                                      Reset_reference(TmpRef^); |                                      Reset_reference(TmpRef^); | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                      TmpRef^.Index := TRegister(Pai386(p)^.op2); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                      TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); |                                      TmpRef^.Index := TRegister(twowords(Pai386(p)^.op2).Word1); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                      If (Pai386(p)^.op3t = Top_Reg) |                                      If (Pai386(p)^.op3t = Top_Reg) | ||||||
|                                        Then |                                        Then | ||||||
|                                          Begin |                                          Begin | ||||||
|                                            TmpRef^.base := R_NO; |                                            TmpRef^.base := R_NO; | ||||||
|                                            TmpRef^.ScaleFactor := 4; |                                            TmpRef^.ScaleFactor := 4; | ||||||
|                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, |                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, | ||||||
|  | {$IfDef USE_OP3} | ||||||
|  |                                              TRegister(Pai386(p)^.op3))); | ||||||
|  | {$Else USE_OP3} | ||||||
|                                              TRegister(twowords(Pai386(p)^.op2).word2))); |                                              TRegister(twowords(Pai386(p)^.op2).word2))); | ||||||
|  | {$EndIf USE_OP3} | ||||||
|                                          End |                                          End | ||||||
|                                        Else |                                        Else | ||||||
|                                          Begin |                                          Begin | ||||||
| @ -1591,7 +1677,10 @@ End. | |||||||
| 
 | 
 | ||||||
| { | { | ||||||
|  $Log$ |  $Log$ | ||||||
|  Revision 1.42  1999-04-10 16:15:04  peter |  Revision 1.43  1999-04-16 15:16:29  jonas | ||||||
|  |    * changes to work with -dUSE_OP3 | ||||||
|  | 
 | ||||||
|  |  Revision 1.42  1999/04/10 16:15:04  peter | ||||||
|    * fixed browcol |    * fixed browcol | ||||||
|    + -ar to show regalloc info in .s file |    + -ar to show regalloc info in .s file | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe