mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 11:53:42 +01:00 
			
		
		
		
	+ track usage of flags by using a new register RS_/NR_DEFAULTFLAGS
git-svn-id: trunk@22179 -
This commit is contained in:
		
							parent
							
								
									66d83bc3d2
								
							
						
					
					
						commit
						d8161c185c
					
				| @ -855,6 +855,7 @@ unit cgcpu; | |||||||
|                     end |                     end | ||||||
|                   else |                   else | ||||||
|                     list.concat(taicpu.op_reg_reg_reg_reg(asmop,dst,overflowreg,src2,src1)); |                     list.concat(taicpu.op_reg_reg_reg_reg(asmop,dst,overflowreg,src2,src1)); | ||||||
|  |                   a_reg_alloc(list,NR_DEFAULTFLAGS); | ||||||
|                   if op=OP_IMUL then |                   if op=OP_IMUL then | ||||||
|                     begin |                     begin | ||||||
|                       shifterop_reset(so); |                       shifterop_reset(so); | ||||||
| @ -1365,6 +1366,7 @@ unit cgcpu; | |||||||
|         tmpreg : tregister; |         tmpreg : tregister; | ||||||
|         b : byte; |         b : byte; | ||||||
|       begin |       begin | ||||||
|  |         a_reg_alloc(list,NR_DEFAULTFLAGS); | ||||||
|         if is_shifter_const(a,b) then |         if is_shifter_const(a,b) then | ||||||
|           list.concat(taicpu.op_reg_const(A_CMP,reg,a)) |           list.concat(taicpu.op_reg_const(A_CMP,reg,a)) | ||||||
|         { CMN reg,0 and CMN reg,$80000000 are different from CMP reg,$ffffffff |         { CMN reg,0 and CMN reg,$80000000 are different from CMP reg,$ffffffff | ||||||
| @ -1378,6 +1380,7 @@ unit cgcpu; | |||||||
|             list.concat(taicpu.op_reg_reg(A_CMP,reg,tmpreg)); |             list.concat(taicpu.op_reg_reg(A_CMP,reg,tmpreg)); | ||||||
|           end; |           end; | ||||||
|         a_jmp_cond(list,cmp_op,l); |         a_jmp_cond(list,cmp_op,l); | ||||||
|  |         a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -1388,8 +1391,10 @@ unit cgcpu; | |||||||
| 
 | 
 | ||||||
|     procedure tcgarm.a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); |     procedure tcgarm.a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); | ||||||
|       begin |       begin | ||||||
|  |         a_reg_alloc(list,NR_DEFAULTFLAGS); | ||||||
|         list.concat(taicpu.op_reg_reg(A_CMP,reg2,reg1)); |         list.concat(taicpu.op_reg_reg(A_CMP,reg2,reg1)); | ||||||
|         a_jmp_cond(list,cmp_op,l); |         a_jmp_cond(list,cmp_op,l); | ||||||
|  |         a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -2246,6 +2251,7 @@ unit cgcpu; | |||||||
|               hflags:=ovloc.resflags; |               hflags:=ovloc.resflags; | ||||||
|               inverse_flags(hflags); |               inverse_flags(hflags); | ||||||
|               cg.a_jmp_flags(list,hflags,hl); |               cg.a_jmp_flags(list,hflags,hl); | ||||||
|  |               cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|             end; |             end; | ||||||
|           else |           else | ||||||
|             internalerror(200409281); |             internalerror(200409281); | ||||||
| @ -3373,6 +3379,7 @@ unit cgcpu; | |||||||
|                         end |                         end | ||||||
|                       else |                       else | ||||||
|                         list.concat(taicpu.op_reg_reg_reg_reg(asmop,dst,overflowreg,src2,src1)); |                         list.concat(taicpu.op_reg_reg_reg_reg(asmop,dst,overflowreg,src2,src1)); | ||||||
|  |                       a_reg_alloc(list,NR_DEFAULTFLAGS); | ||||||
|                       if op=OP_IMUL then |                       if op=OP_IMUL then | ||||||
|                         begin |                         begin | ||||||
|                            shifterop_reset(so); |                            shifterop_reset(so); | ||||||
|  | |||||||
| @ -291,6 +291,9 @@ unit cpubase; | |||||||
|       { Offset where the parent framepointer is pushed } |       { Offset where the parent framepointer is pushed } | ||||||
|       PARENT_FRAMEPOINTER_OFFSET = 0; |       PARENT_FRAMEPOINTER_OFFSET = 0; | ||||||
| 
 | 
 | ||||||
|  |       NR_DEFAULTFLAGS = NR_CPSR_C; | ||||||
|  |       RS_DEFAULTFLAGS = RS_CPSR_C; | ||||||
|  | 
 | ||||||
|       { Low part of 64bit return value } |       { Low part of 64bit return value } | ||||||
|       function NR_FUNCTION_RESULT64_LOW_REG: tregister;{$ifdef USEINLINE}inline;{$endif USEINLINE} |       function NR_FUNCTION_RESULT64_LOW_REG: tregister;{$ifdef USEINLINE}inline;{$endif USEINLINE} | ||||||
|       function RS_FUNCTION_RESULT64_LOW_REG: shortint;{$ifdef USEINLINE}inline;{$endif USEINLINE} |       function RS_FUNCTION_RESULT64_LOW_REG: shortint;{$ifdef USEINLINE}inline;{$endif USEINLINE} | ||||||
|  | |||||||
| @ -295,11 +295,13 @@ interface | |||||||
|         case nodetype of |         case nodetype of | ||||||
|           equaln: |           equaln: | ||||||
|             begin |             begin | ||||||
|  |               cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register,right.location.register)); |               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register,right.location.register)); | ||||||
|               location.resflags:=F_EQ; |               location.resflags:=F_EQ; | ||||||
|             end; |             end; | ||||||
|           unequaln: |           unequaln: | ||||||
|             begin |             begin | ||||||
|  |               cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register,right.location.register)); |               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register,right.location.register)); | ||||||
|               location.resflags:=F_NE; |               location.resflags:=F_NE; | ||||||
|             end; |             end; | ||||||
| @ -313,6 +315,7 @@ interface | |||||||
|                 swapleftright; |                 swapleftright; | ||||||
|               tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size); |               tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size); | ||||||
|               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_AND,tmpreg,left.location.register,right.location.register)); |               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_AND,tmpreg,left.location.register,right.location.register)); | ||||||
|  |               cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,tmpreg,right.location.register)); |               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,tmpreg,right.location.register)); | ||||||
|               location.resflags:=F_EQ; |               location.resflags:=F_EQ; | ||||||
|             end; |             end; | ||||||
| @ -352,6 +355,7 @@ interface | |||||||
|             if not(left.location.loc in [LOC_CREGISTER,LOC_REGISTER]) then |             if not(left.location.loc in [LOC_CREGISTER,LOC_REGISTER]) then | ||||||
|               hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); |               hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); | ||||||
|             dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size); |             dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size); | ||||||
|  |             cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|             current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S)); |             current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S)); | ||||||
|           end |           end | ||||||
|         else |         else | ||||||
| @ -364,6 +368,7 @@ interface | |||||||
|               begin |               begin | ||||||
|                 location_reset(location,LOC_FLAGS,OS_NO); |                 location_reset(location,LOC_FLAGS,OS_NO); | ||||||
|                 location.resflags:=getresflags(unsigned); |                 location.resflags:=getresflags(unsigned); | ||||||
|  |                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi)); |                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi)); | ||||||
|                 if current_settings.cputype in cpu_thumb2 then |                 if current_settings.cputype in cpu_thumb2 then | ||||||
|                   begin |                   begin | ||||||
| @ -379,6 +384,7 @@ interface | |||||||
|             { operation requiring proper N, Z and V flags ? } |             { operation requiring proper N, Z and V flags ? } | ||||||
|               begin |               begin | ||||||
|                 location_reset(location,LOC_JUMP,OS_NO); |                 location_reset(location,LOC_JUMP,OS_NO); | ||||||
|  |                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi)); |                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reghi,right.location.register64.reghi)); | ||||||
|                 { the jump the sequence is a little bit hairy } |                 { the jump the sequence is a little bit hairy } | ||||||
|                 case nodetype of |                 case nodetype of | ||||||
| @ -388,6 +394,7 @@ interface | |||||||
|                         { cheat a little bit for the negative test } |                         { cheat a little bit for the negative test } | ||||||
|                         toggleflag(nf_swapped); |                         toggleflag(nf_swapped); | ||||||
|                         cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrFalseLabel); |                         cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrFalseLabel); | ||||||
|  |                         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                         toggleflag(nf_swapped); |                         toggleflag(nf_swapped); | ||||||
|                      end; |                      end; | ||||||
|                    lten,gten: |                    lten,gten: | ||||||
| @ -404,14 +411,17 @@ interface | |||||||
|                         else |                         else | ||||||
|                           nodetype:=ltn; |                           nodetype:=ltn; | ||||||
|                         cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel); |                         cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel); | ||||||
|  |                         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                         nodetype:=oldnodetype; |                         nodetype:=oldnodetype; | ||||||
|                      end; |                      end; | ||||||
|                 end; |                 end; | ||||||
|  |                 cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reglo,right.location.register64.reglo)); |                 current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reglo,right.location.register64.reglo)); | ||||||
|                 { the comparisaion of the low dword have to be |                 { the comparisaion of the low dword have to be | ||||||
|                    always unsigned!                            } |                    always unsigned!                            } | ||||||
|                 cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel); |                 cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel); | ||||||
|                 cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel); |                 cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel); | ||||||
|  |                 cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|               end; |               end; | ||||||
|           end; |           end; | ||||||
|       end; |       end; | ||||||
| @ -448,7 +458,7 @@ interface | |||||||
| 
 | 
 | ||||||
|         unsigned:=not(is_signed(left.resultdef)) or |         unsigned:=not(is_signed(left.resultdef)) or | ||||||
|                   not(is_signed(right.resultdef)); |                   not(is_signed(right.resultdef)); | ||||||
| 
 |         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|         if right.location.loc = LOC_CONSTANT then |         if right.location.loc = LOC_CONSTANT then | ||||||
|           begin |           begin | ||||||
|              if is_shifter_const(right.location.value,b) then |              if is_shifter_const(right.location.value,b) then | ||||||
|  | |||||||
| @ -168,8 +168,10 @@ implementation | |||||||
|                         current_asmdata.getjumplabel(l2); |                         current_asmdata.getjumplabel(l2); | ||||||
|                         reference_reset_symbol(href,l1,0,const_align(8)); |                         reference_reset_symbol(href,l1,0,const_align(8)); | ||||||
| 
 | 
 | ||||||
|  |                         cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                         current_asmdata.CurrAsmList.concat(Taicpu.op_reg_const(A_CMP,left.location.register,0)); |                         current_asmdata.CurrAsmList.concat(Taicpu.op_reg_const(A_CMP,left.location.register,0)); | ||||||
|                         cg.a_jmp_flags(current_asmdata.CurrAsmList,F_GE,l2); |                         cg.a_jmp_flags(current_asmdata.CurrAsmList,F_GE,l2); | ||||||
|  |                         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
| 
 | 
 | ||||||
|                         hregister:=cg.getfpuregister(current_asmdata.CurrAsmList,OS_F64); |                         hregister:=cg.getfpuregister(current_asmdata.CurrAsmList,OS_F64); | ||||||
|                         new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(8)); |                         new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(8)); | ||||||
| @ -316,6 +318,7 @@ implementation | |||||||
|          location_reset(location,LOC_REGISTER,def_cgsize(resultdef)); |          location_reset(location,LOC_REGISTER,def_cgsize(resultdef)); | ||||||
|          hreg1:=cg.getintregister(current_asmdata.CurrAsmList,location.size); |          hreg1:=cg.getintregister(current_asmdata.CurrAsmList,location.size); | ||||||
|          cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,hreg1); |          cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,hreg1); | ||||||
|  |          cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|          if (is_cbool(resultdef)) then |          if (is_cbool(resultdef)) then | ||||||
|            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,hreg1,hreg1); |            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,hreg1,hreg1); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -308,6 +308,7 @@ implementation | |||||||
|               LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF : |               LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF : | ||||||
|                 begin |                 begin | ||||||
|                   hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); |                   hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); | ||||||
|  |                   cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                   current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,left.location.register,0)); |                   current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,left.location.register,0)); | ||||||
|                   location_reset(location,LOC_FLAGS,OS_NO); |                   location_reset(location,LOC_FLAGS,OS_NO); | ||||||
|                   location.resflags:=F_EQ; |                   location.resflags:=F_EQ; | ||||||
|  | |||||||
| @ -1012,7 +1012,10 @@ implementation | |||||||
|             case l.loc of |             case l.loc of | ||||||
| {$ifdef cpuflags} | {$ifdef cpuflags} | ||||||
|               LOC_FLAGS : |               LOC_FLAGS : | ||||||
|                 cg.g_flags2reg(list,OS_INT,l.resflags,hregister); |                 begin | ||||||
|  |                   cg.g_flags2reg(list,OS_INT,l.resflags,hregister); | ||||||
|  |                   cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|  |                 end; | ||||||
| {$endif cpuflags} | {$endif cpuflags} | ||||||
|               LOC_JUMP : |               LOC_JUMP : | ||||||
|                 begin |                 begin | ||||||
| @ -1101,7 +1104,10 @@ implementation | |||||||
|           case l.loc of |           case l.loc of | ||||||
| {$ifdef cpuflags} | {$ifdef cpuflags} | ||||||
|             LOC_FLAGS : |             LOC_FLAGS : | ||||||
|               cg.g_flags2reg(list,dst_cgsize,l.resflags,hregister); |               begin | ||||||
|  |                 cg.g_flags2reg(list,dst_cgsize,l.resflags,hregister); | ||||||
|  |                 cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|  |               end; | ||||||
| {$endif cpuflags} | {$endif cpuflags} | ||||||
|             LOC_JUMP : |             LOC_JUMP : | ||||||
|               begin |               begin | ||||||
|  | |||||||
| @ -3405,7 +3405,10 @@ implementation | |||||||
|       case l.loc of |       case l.loc of | ||||||
| {$ifdef cpuflags} | {$ifdef cpuflags} | ||||||
|         LOC_FLAGS : |         LOC_FLAGS : | ||||||
|           g_flags2reg(list,dst_size,l.resflags,hregister); |           begin | ||||||
|  |             g_flags2reg(list,dst_size,l.resflags,hregister); | ||||||
|  |             cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|  |           end; | ||||||
| {$endif cpuflags} | {$endif cpuflags} | ||||||
|         LOC_JUMP : |         LOC_JUMP : | ||||||
|           begin |           begin | ||||||
| @ -3582,6 +3585,7 @@ implementation | |||||||
|                    LOC_FLAGS : |                    LOC_FLAGS : | ||||||
|                      begin |                      begin | ||||||
|                        a_jmp_flags(list,p.location.resflags,current_procinfo.CurrTrueLabel); |                        a_jmp_flags(list,p.location.resflags,current_procinfo.CurrTrueLabel); | ||||||
|  |                        a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|                        a_jmp_always(list,current_procinfo.CurrFalseLabel); |                        a_jmp_always(list,current_procinfo.CurrFalseLabel); | ||||||
|                      end; |                      end; | ||||||
| {$endif cpuflags} | {$endif cpuflags} | ||||||
|  | |||||||
| @ -240,6 +240,7 @@ interface | |||||||
|         location_reset(location,LOC_REGISTER,def_cgsize(resultdef)); |         location_reset(location,LOC_REGISTER,def_cgsize(resultdef)); | ||||||
|         location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size); |         location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size); | ||||||
|         cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,location.register); |         cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,location.register); | ||||||
|  |         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|         if (is_cbool(resultdef)) then |         if (is_cbool(resultdef)) then | ||||||
|           cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,location.register,location.register); |           cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,location.register,location.register); | ||||||
|         current_procinfo.CurrTrueLabel:=oldTrueLabel; |         current_procinfo.CurrTrueLabel:=oldTrueLabel; | ||||||
|  | |||||||
| @ -946,11 +946,15 @@ implementation | |||||||
|                           if left.location.size in [OS_S64,OS_64] then |                           if left.location.size in [OS_S64,OS_64] then | ||||||
|                             begin |                             begin | ||||||
|                               cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,left.location.register64.reglo); |                               cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,left.location.register64.reglo); | ||||||
|  |                               cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                               cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,left.location.register64.reghi); |                               cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,left.location.register64.reghi); | ||||||
|                             end |                             end | ||||||
|                           else |                           else | ||||||
| {$endif cpu32bitalu} | {$endif cpu32bitalu} | ||||||
|                             cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,left.location.register); |                             begin | ||||||
|  |                               cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,left.location.register); | ||||||
|  |                               cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|  |                             end; | ||||||
|                         LOC_REFERENCE: |                         LOC_REFERENCE: | ||||||
|                         { i386 has a hack in its code generator so that it can |                         { i386 has a hack in its code generator so that it can | ||||||
|                           deal with 64 bit locations in this parcticular case } |                           deal with 64 bit locations in this parcticular case } | ||||||
| @ -960,16 +964,21 @@ implementation | |||||||
|                               r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); |                               r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); | ||||||
|                               r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); |                               r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); | ||||||
|                               cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo); |                               cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo); | ||||||
|  |                               cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                               cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi); |                               cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi); | ||||||
|                               cg64.a_load64_reg_ref(current_asmdata.CurrAsmList,r64,left.location.reference); |                               cg64.a_load64_reg_ref(current_asmdata.CurrAsmList,r64,left.location.reference); | ||||||
|                             end |                             end | ||||||
|                           else |                           else | ||||||
| {$endif cpu32bitalu} | {$endif cpu32bitalu} | ||||||
|                             cg.g_flags2ref(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,left.location.reference); |                             begin | ||||||
|  |                               cg.g_flags2ref(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,left.location.reference); | ||||||
|  |                               cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|  |                             end; | ||||||
|                         LOC_SUBSETREG,LOC_SUBSETREF: |                         LOC_SUBSETREG,LOC_SUBSETREF: | ||||||
|                           begin |                           begin | ||||||
|                             r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size); |                             r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size); | ||||||
|                             cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r); |                             cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r); | ||||||
|  |                             cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                             hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location); |                             hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location); | ||||||
|                           end; |                           end; | ||||||
|                         else |                         else | ||||||
| @ -984,6 +993,7 @@ implementation | |||||||
|                           r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); |                           r64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); | ||||||
|                           r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); |                           r64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); | ||||||
|                           cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo); |                           cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,right.location.resflags,r64.reglo); | ||||||
|  |                           cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                           cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi); |                           cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_32,0,r64.reghi); | ||||||
|                           cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_S64, |                           cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_S64, | ||||||
|                             r64,r64); |                             r64,r64); | ||||||
| @ -994,6 +1004,7 @@ implementation | |||||||
|                         begin |                         begin | ||||||
|                           r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size); |                           r:=cg.getintregister(current_asmdata.CurrAsmList,left.location.size); | ||||||
|                           cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r); |                           cg.g_flags2reg(current_asmdata.CurrAsmList,left.location.size,right.location.resflags,r); | ||||||
|  |                           cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); | ||||||
|                           cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,left.location.size,r,r); |                           cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,left.location.size,r,r); | ||||||
|                           hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location); |                           hlcg.a_load_reg_loc(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,r,left.location); | ||||||
|                         end |                         end | ||||||
|  | |||||||
| @ -337,6 +337,7 @@ implementation | |||||||
|                      LOC_FLAGS : |                      LOC_FLAGS : | ||||||
|                        begin |                        begin | ||||||
|                          cg.a_jmp_flags(list,p.location.resflags,current_procinfo.CurrTrueLabel); |                          cg.a_jmp_flags(list,p.location.resflags,current_procinfo.CurrTrueLabel); | ||||||
|  |                          cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); | ||||||
|                          cg.a_jmp_always(list,current_procinfo.CurrFalseLabel); |                          cg.a_jmp_always(list,current_procinfo.CurrFalseLabel); | ||||||
|                        end; |                        end; | ||||||
| {$endif cpuflags} | {$endif cpuflags} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 florian
						florian