mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 12:23:24 +01:00 
			
		
		
		
	+ pic code reading for the assembler readers
* loadaddr generates pic code as well now
This commit is contained in:
		
							parent
							
								
									31ebe33949
								
							
						
					
					
						commit
						0811184277
					
				@ -659,9 +659,23 @@ unit cgx86;
 | 
				
			|||||||
            begin
 | 
					            begin
 | 
				
			||||||
              if assigned(ref.symbol) then
 | 
					              if assigned(ref.symbol) then
 | 
				
			||||||
                begin
 | 
					                begin
 | 
				
			||||||
                  tmpref:=ref;
 | 
					                  if cs_create_pic in aktmoduleswitches then
 | 
				
			||||||
                  tmpref.refaddr:=ADDR_FULL;
 | 
					                    begin
 | 
				
			||||||
                  list.concat(Taicpu.op_ref_reg(A_MOV,tcgsize2opsize[OS_ADDR],tmpref,r));
 | 
					{$ifdef x86_64}
 | 
				
			||||||
 | 
					                      reference_reset_symbol(tmpref,ref.symbol,0);
 | 
				
			||||||
 | 
					                      tmpref.refaddr:=addr_pic;
 | 
				
			||||||
 | 
					                      tmpref.base:=NR_RIP;
 | 
				
			||||||
 | 
					                      list.concat(taicpu.op_ref_reg(A_MOV,S_Q,tmpref,r));
 | 
				
			||||||
 | 
					{$else x86_64}
 | 
				
			||||||
 | 
					                      internalerror(2005042501);
 | 
				
			||||||
 | 
					{$endif x86_64}
 | 
				
			||||||
 | 
					                    end
 | 
				
			||||||
 | 
					                  else
 | 
				
			||||||
 | 
					                    begin
 | 
				
			||||||
 | 
					                      tmpref:=ref;
 | 
				
			||||||
 | 
					                      tmpref.refaddr:=ADDR_FULL;
 | 
				
			||||||
 | 
					                      list.concat(Taicpu.op_ref_reg(A_MOV,tcgsize2opsize[OS_ADDR],tmpref,r));
 | 
				
			||||||
 | 
					                    end;
 | 
				
			||||||
                end
 | 
					                end
 | 
				
			||||||
              else
 | 
					              else
 | 
				
			||||||
                a_load_const_reg(list,OS_ADDR,offset,r);
 | 
					                a_load_const_reg(list,OS_ADDR,offset,r);
 | 
				
			||||||
@ -1774,7 +1788,11 @@ unit cgx86;
 | 
				
			|||||||
end.
 | 
					end.
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  $Log$
 | 
					  $Log$
 | 
				
			||||||
  Revision 1.147  2005-03-13 17:15:26  florian
 | 
					  Revision 1.148  2005-04-25 09:51:07  florian
 | 
				
			||||||
 | 
					    + pic code reading for the assembler readers
 | 
				
			||||||
 | 
					    * loadaddr generates pic code as well now
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Revision 1.147  2005/03/13 17:15:26  florian
 | 
				
			||||||
    + storing non-extended floats to memory generates now a fwait to get exceptions at the correct place
 | 
					    + storing non-extended floats to memory generates now a fwait to get exceptions at the correct place
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Revision 1.146  2005/02/14 17:13:10  peter
 | 
					  Revision 1.146  2005/02/14 17:13:10  peter
 | 
				
			||||||
 | 
				
			|||||||
@ -327,6 +327,11 @@ Implementation
 | 
				
			|||||||
          end;
 | 
					          end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        procedure handleat;
 | 
				
			||||||
 | 
					          begin
 | 
				
			||||||
 | 
					          end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function MaybeBuildReference:boolean;
 | 
					        function MaybeBuildReference:boolean;
 | 
				
			||||||
          { Try to create a reference, if not a reference is found then false
 | 
					          { Try to create a reference, if not a reference is found then false
 | 
				
			||||||
            is returned }
 | 
					            is returned }
 | 
				
			||||||
@ -369,6 +374,19 @@ Implementation
 | 
				
			|||||||
                     BuildRecordOffsetSize(tempstr,l,k);
 | 
					                     BuildRecordOffsetSize(tempstr,l,k);
 | 
				
			||||||
                     inc(oper.opr.ref.offset,l);
 | 
					                     inc(oper.opr.ref.offset,l);
 | 
				
			||||||
                   end;
 | 
					                   end;
 | 
				
			||||||
 | 
					                  if actasmtoken=AS_AT then
 | 
				
			||||||
 | 
					                    begin
 | 
				
			||||||
 | 
					                      consume(AS_AT);
 | 
				
			||||||
 | 
					                      if actasmtoken=AS_ID then
 | 
				
			||||||
 | 
					                        begin
 | 
				
			||||||
 | 
					                          if actasmpattern='GOTPCREL' then
 | 
				
			||||||
 | 
					                            oper.opr.ref.refaddr:=addr_pic
 | 
				
			||||||
 | 
					                          else
 | 
				
			||||||
 | 
					                            Message(asmr_e_invalid_reference_syntax);
 | 
				
			||||||
 | 
					                        end
 | 
				
			||||||
 | 
					                      else
 | 
				
			||||||
 | 
					                        Message(asmr_e_invalid_reference_syntax);
 | 
				
			||||||
 | 
					                    end;
 | 
				
			||||||
                  case actasmtoken of
 | 
					                  case actasmtoken of
 | 
				
			||||||
                    AS_END,
 | 
					                    AS_END,
 | 
				
			||||||
                    AS_SEPARATOR,
 | 
					                    AS_SEPARATOR,
 | 
				
			||||||
@ -486,7 +504,23 @@ Implementation
 | 
				
			|||||||
                     begin
 | 
					                     begin
 | 
				
			||||||
                       if oper.SetupVar(expr,false) then
 | 
					                       if oper.SetupVar(expr,false) then
 | 
				
			||||||
                        begin
 | 
					                        begin
 | 
				
			||||||
                        end
 | 
					                          if actasmtoken=AS_AT then
 | 
				
			||||||
 | 
					                            begin
 | 
				
			||||||
 | 
					                              consume(AS_AT);
 | 
				
			||||||
 | 
					                              if actasmtoken=AS_ID then
 | 
				
			||||||
 | 
					                                begin
 | 
				
			||||||
 | 
					                                  if actasmpattern='GOTPCREL' then
 | 
				
			||||||
 | 
					                                    begin
 | 
				
			||||||
 | 
					                                      oper.opr.ref.refaddr:=addr_pic;
 | 
				
			||||||
 | 
					                                      consume(AS_ID);
 | 
				
			||||||
 | 
					                                    end
 | 
				
			||||||
 | 
					                                  else
 | 
				
			||||||
 | 
					                                    Message(asmr_e_invalid_reference_syntax);
 | 
				
			||||||
 | 
					                                end
 | 
				
			||||||
 | 
					                              else
 | 
				
			||||||
 | 
					                                Message(asmr_e_invalid_reference_syntax);
 | 
				
			||||||
 | 
					                            end;
 | 
				
			||||||
 | 
					                          end
 | 
				
			||||||
                       else
 | 
					                       else
 | 
				
			||||||
                        Begin
 | 
					                        Begin
 | 
				
			||||||
                          { look for special symbols ... }
 | 
					                          { look for special symbols ... }
 | 
				
			||||||
@ -775,7 +809,11 @@ Implementation
 | 
				
			|||||||
end.
 | 
					end.
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  $Log$
 | 
					  $Log$
 | 
				
			||||||
  Revision 1.10  2005-02-14 17:13:10  peter
 | 
					  Revision 1.11  2005-04-25 09:51:07  florian
 | 
				
			||||||
 | 
					    + pic code reading for the assembler readers
 | 
				
			||||||
 | 
					    * loadaddr generates pic code as well now
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Revision 1.10  2005/02/14 17:13:10  peter
 | 
				
			||||||
    * truncate log
 | 
					    * truncate log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user