mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 20:50:32 +02:00
* simplified det_resulttype code for include/exclude
* include/exclude doesn't use any helpers anymore in the i386 secondpass
This commit is contained in:
parent
1fd6a2c5f8
commit
17b2fa3424
@ -733,48 +733,39 @@ implementation
|
|||||||
asmop:=A_BTS
|
asmop:=A_BTS
|
||||||
else
|
else
|
||||||
asmop:=A_BTR;
|
asmop:=A_BTR;
|
||||||
if tsetdef(left.resulttype.def).settype=smallset then
|
|
||||||
begin
|
if tcallparanode(tcallparanode(left).right).left.location.loc in [LOC_CREGISTER,LOC_REGISTER] then
|
||||||
if tcallparanode(tcallparanode(left).right).left.location.loc in [LOC_CREGISTER,LOC_REGISTER] then
|
{ we don't need a mod 32 because this is done automatically }
|
||||||
{ we don't need a mod 32 because this is done automatically }
|
{ by the bts instruction. For proper checking we would }
|
||||||
{ by the bts instruction. For proper checking we would }
|
|
||||||
{ need a cmp and jmp, but this should be done by the }
|
{ note: bts doesn't do any mod'ing, that's why we can also use }
|
||||||
{ type cast code which does range checking if necessary (FK) }
|
{ it for normalsets! (JM) }
|
||||||
hregister:=makereg32(tcallparanode(tcallparanode(left).right).left.location.register)
|
|
||||||
else
|
{ need a cmp and jmp, but this should be done by the }
|
||||||
begin
|
{ type cast code which does range checking if necessary (FK) }
|
||||||
getexplicitregister32(R_EDI);
|
hregister:=makereg32(tcallparanode(tcallparanode(left).right).left.location.register)
|
||||||
hregister:=R_EDI;
|
|
||||||
opsize:=def2def_opsize(
|
|
||||||
tcallparanode(tcallparanode(left).right).left.resulttype.def,u32bittype.def);
|
|
||||||
if opsize in [S_B,S_W,S_L] then
|
|
||||||
op:=A_MOV
|
|
||||||
else
|
|
||||||
op:=A_MOVZX;
|
|
||||||
emit_ref_reg(op,opsize,
|
|
||||||
newreference(
|
|
||||||
tcallparanode(tcallparanode(left).right).left.location.reference),R_EDI);
|
|
||||||
end;
|
|
||||||
if (tcallparanode(left).left.location.loc=LOC_REFERENCE) then
|
|
||||||
emit_reg_ref(asmop,S_L,hregister,
|
|
||||||
newreference(tcallparanode(left).left.location.reference))
|
|
||||||
else
|
|
||||||
emit_reg_reg(asmop,S_L,hregister,
|
|
||||||
tcallparanode(left).left.location.register);
|
|
||||||
if hregister = R_EDI then
|
|
||||||
ungetregister32(R_EDI);
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
pushsetelement(tcallparanode(tcallparanode(left).right).left);
|
getexplicitregister32(R_EDI);
|
||||||
{ normset is allways a ref }
|
hregister:=R_EDI;
|
||||||
emitpushreferenceaddr(tcallparanode(left).left.location.reference);
|
opsize:=def2def_opsize(
|
||||||
if inlinenumber=in_include_x_y then
|
tcallparanode(tcallparanode(left).right).left.resulttype.def,u32bittype.def);
|
||||||
emitcall('FPC_SET_SET_BYTE')
|
if opsize = S_L then
|
||||||
|
op:=A_MOV
|
||||||
else
|
else
|
||||||
emitcall('FPC_SET_UNSET_BYTE');
|
op:=A_MOVZX;
|
||||||
{CGMessage(cg_e_include_not_implemented);}
|
emit_ref_reg(op,opsize,
|
||||||
|
newreference(
|
||||||
|
tcallparanode(tcallparanode(left).right).left.location.reference),R_EDI);
|
||||||
end;
|
end;
|
||||||
|
if (tcallparanode(left).left.location.loc=LOC_REFERENCE) then
|
||||||
|
emit_reg_ref(asmop,S_L,hregister,
|
||||||
|
newreference(tcallparanode(left).left.location.reference))
|
||||||
|
else
|
||||||
|
emit_reg_reg(asmop,S_L,hregister,
|
||||||
|
tcallparanode(left).left.location.register);
|
||||||
|
if hregister = R_EDI then
|
||||||
|
ungetregister32(R_EDI);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
in_pi:
|
in_pi:
|
||||||
@ -879,7 +870,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.23 2001-08-30 20:13:57 peter
|
Revision 1.24 2001-09-04 14:32:45 jonas
|
||||||
|
* simplified det_resulttype code for include/exclude
|
||||||
|
* include/exclude doesn't use any helpers anymore in the i386 secondpass
|
||||||
|
|
||||||
|
Revision 1.23 2001/08/30 20:13:57 peter
|
||||||
* rtti/init table updates
|
* rtti/init table updates
|
||||||
* rttisym for reusable global rtti/init info
|
* rttisym for reusable global rtti/init info
|
||||||
* support published for interfaces
|
* support published for interfaces
|
||||||
|
@ -1646,31 +1646,18 @@ implementation
|
|||||||
in_exclude_x_y:
|
in_exclude_x_y:
|
||||||
begin
|
begin
|
||||||
resulttype:=voidtype;
|
resulttype:=voidtype;
|
||||||
if assigned(left) then
|
{ the parser already checks whether we have two (and exectly two) }
|
||||||
|
{ parameters (JM) }
|
||||||
|
set_varstate(left,true);
|
||||||
|
{ first param must be var }
|
||||||
|
valid_for_var(tcallparanode(left).left);
|
||||||
|
{ check type }
|
||||||
|
if (left.resulttype.def.deftype=setdef) then
|
||||||
begin
|
begin
|
||||||
set_varstate(left,true);
|
{ insert a type conversion }
|
||||||
{ remove warning when result is passed }
|
{ to the type of the set elements }
|
||||||
set_funcret_is_valid(tcallparanode(left).left);
|
inserttypeconv(tcallparanode(tcallparanode(left).right).left,
|
||||||
{ first param must be var }
|
tsetdef(left.resulttype.def).elementtype);
|
||||||
valid_for_var(tcallparanode(left).left);
|
|
||||||
{ check type }
|
|
||||||
if assigned(left.resulttype.def) and
|
|
||||||
(left.resulttype.def.deftype=setdef) then
|
|
||||||
begin
|
|
||||||
{ two paras ? }
|
|
||||||
if assigned(tcallparanode(left).right) then
|
|
||||||
begin
|
|
||||||
{ insert a type conversion }
|
|
||||||
{ to the type of the set elements }
|
|
||||||
inserttypeconv(tcallparanode(tcallparanode(left).right).left,
|
|
||||||
tsetdef(left.resulttype.def).elementtype);
|
|
||||||
{ only three parameters are allowed }
|
|
||||||
if assigned(tcallparanode(tcallparanode(left).right).right) then
|
|
||||||
CGMessage(cg_e_illegal_expression);
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
CGMessage(type_e_mismatch);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
@ -2269,7 +2256,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.56 2001-09-04 11:38:55 jonas
|
Revision 1.57 2001-09-04 14:32:45 jonas
|
||||||
|
* simplified det_resulttype code for include/exclude
|
||||||
|
* include/exclude doesn't use any helpers anymore in the i386 secondpass
|
||||||
|
|
||||||
|
Revision 1.56 2001/09/04 11:38:55 jonas
|
||||||
+ searchsystype() and searchsystype() functions in symtable
|
+ searchsystype() and searchsystype() functions in symtable
|
||||||
* changed ninl and nadd to use these functions
|
* changed ninl and nadd to use these functions
|
||||||
* i386 set comparison functions now return their results in al instead
|
* i386 set comparison functions now return their results in al instead
|
||||||
|
Loading…
Reference in New Issue
Block a user