mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:59:18 +02:00
* remove obsolete cardinal() typecasts
This commit is contained in:
parent
2eecc76977
commit
0ac4983a9b
@ -660,11 +660,11 @@ unit cg64f32;
|
|||||||
|
|
||||||
function tcg64f32.optimize64_op_const_reg(list: taasmoutput; var op: topcg; var a : int64; var reg: tregister64): boolean;
|
function tcg64f32.optimize64_op_const_reg(list: taasmoutput; var op: topcg; var a : int64; var reg: tregister64): boolean;
|
||||||
var
|
var
|
||||||
lowvalue, highvalue : cardinal;
|
lowvalue, highvalue : longint;
|
||||||
hreg: tregister;
|
hreg: tregister;
|
||||||
begin
|
begin
|
||||||
lowvalue := cardinal(a);
|
lowvalue := longint(a);
|
||||||
highvalue:= a shr 32;
|
highvalue:= longint(a shr 32);
|
||||||
{ assume it will be optimized out }
|
{ assume it will be optimized out }
|
||||||
optimize64_op_const_reg := true;
|
optimize64_op_const_reg := true;
|
||||||
case op of
|
case op of
|
||||||
@ -675,9 +675,9 @@ unit cg64f32;
|
|||||||
end;
|
end;
|
||||||
OP_AND:
|
OP_AND:
|
||||||
begin
|
begin
|
||||||
if lowvalue <> high(cardinal) then
|
if lowvalue <> -1 then
|
||||||
cg.a_op_const_reg(list,op,OS_32,lowvalue,reg.reglo);
|
cg.a_op_const_reg(list,op,OS_32,lowvalue,reg.reglo);
|
||||||
if highvalue <> high(cardinal) then
|
if highvalue <> -1 then
|
||||||
cg.a_op_const_reg(list,op,OS_32,highvalue,reg.reghi);
|
cg.a_op_const_reg(list,op,OS_32,highvalue,reg.reghi);
|
||||||
{ already emitted correctly }
|
{ already emitted correctly }
|
||||||
exit;
|
exit;
|
||||||
@ -753,7 +753,10 @@ unit cg64f32;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.59 2004-06-17 16:55:46 peter
|
Revision 1.60 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.59 2004/06/17 16:55:46 peter
|
||||||
* powerpc compiles again
|
* powerpc compiles again
|
||||||
|
|
||||||
Revision 1.58 2004/06/16 20:07:07 florian
|
Revision 1.58 2004/06/16 20:07:07 florian
|
||||||
|
@ -652,23 +652,7 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
getrange(def,lv,hv);
|
getrange(def,lv,hv);
|
||||||
if (def.deftype=orddef) and
|
if (l<lv) or (l>hv) then
|
||||||
(torddef(def).typ=u32bit) then
|
|
||||||
begin
|
|
||||||
if (l < cardinal(lv)) or
|
|
||||||
(l > cardinal(hv)) then
|
|
||||||
begin
|
|
||||||
if not explicit then
|
|
||||||
begin
|
|
||||||
if (cs_check_range in aktlocalswitches) then
|
|
||||||
Message(parser_e_range_check_error)
|
|
||||||
else
|
|
||||||
Message(parser_w_range_check_error);
|
|
||||||
end;
|
|
||||||
error := true;
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else if (l<lv) or (l>hv) then
|
|
||||||
begin
|
begin
|
||||||
if not explicit then
|
if not explicit then
|
||||||
begin
|
begin
|
||||||
@ -904,7 +888,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 2004-06-16 20:07:07 florian
|
Revision 1.17 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.16 2004/06/16 20:07:07 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.15 2004/05/28 21:13:23 peter
|
Revision 1.15 2004/05/28 21:13:23 peter
|
||||||
|
@ -461,7 +461,7 @@ implementation
|
|||||||
Consts.concat(Tai_const_symbol.Create(l1));
|
Consts.concat(Tai_const_symbol.Create(l1));
|
||||||
Consts.concat(Tai_const.Create_32bit(len));
|
Consts.concat(Tai_const.Create_32bit(len));
|
||||||
Consts.concat(Tai_const.Create_32bit(len));
|
Consts.concat(Tai_const.Create_32bit(len));
|
||||||
Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
|
Consts.concat(Tai_const.Create_32bit(-1));
|
||||||
Consts.concat(Tai_label.Create(l1));
|
Consts.concat(Tai_label.Create(l1));
|
||||||
getmem(pc,len+2);
|
getmem(pc,len+2);
|
||||||
move(value_str^,pc^,len);
|
move(value_str^,pc^,len);
|
||||||
@ -513,7 +513,7 @@ implementation
|
|||||||
Consts.concat(Tai_const_symbol.Create(l1));
|
Consts.concat(Tai_const_symbol.Create(l1));
|
||||||
Consts.concat(Tai_const.Create_32bit(len));
|
Consts.concat(Tai_const.Create_32bit(len));
|
||||||
Consts.concat(Tai_const.Create_32bit(len));
|
Consts.concat(Tai_const.Create_32bit(len));
|
||||||
Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
|
Consts.concat(Tai_const.Create_32bit(-1));
|
||||||
Consts.concat(Tai_label.Create(l1));
|
Consts.concat(Tai_label.Create(l1));
|
||||||
getmem(pc,len+2);
|
getmem(pc,len+2);
|
||||||
move(value_str^,pc^,len);
|
move(value_str^,pc^,len);
|
||||||
@ -729,7 +729,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.41 2004-06-16 20:07:08 florian
|
Revision 1.42 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.41 2004/06/16 20:07:08 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.40 2004/04/29 19:56:37 daniel
|
Revision 1.40 2004/04/29 19:56:37 daniel
|
||||||
|
@ -2400,7 +2400,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.136 2004-06-16 20:07:08 florian
|
Revision 1.137 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.136 2004/06/16 20:07:08 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.135 2004/05/28 21:15:20 peter
|
Revision 1.135 2004/05/28 21:15:20 peter
|
||||||
@ -2732,4 +2735,4 @@ end.
|
|||||||
Revision 1.68 2002/01/19 11:53:56 peter
|
Revision 1.68 2002/01/19 11:53:56 peter
|
||||||
* constant evaluation for assinged added
|
* constant evaluation for assinged added
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ implementation
|
|||||||
bool32bit :
|
bool32bit :
|
||||||
begin
|
begin
|
||||||
if is_constboolnode(p) then
|
if is_constboolnode(p) then
|
||||||
curconstSegment.concat(Tai_const.Create_32bit(cardinal(tordconstnode(p).value)))
|
curconstSegment.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)))
|
||||||
else
|
else
|
||||||
Message(parser_e_illegal_expression);
|
Message(parser_e_illegal_expression);
|
||||||
end;
|
end;
|
||||||
@ -176,7 +176,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if is_constintnode(p) then
|
if is_constintnode(p) then
|
||||||
begin
|
begin
|
||||||
curconstSegment.concat(Tai_const.Create_32bit(cardinal(tordconstnode(p).value)));
|
curconstSegment.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)));
|
||||||
if torddef(t.def).typ<>u32bit then
|
if torddef(t.def).typ<>u32bit then
|
||||||
check_range(torddef(t.def));
|
check_range(torddef(t.def));
|
||||||
end
|
end
|
||||||
@ -603,7 +603,7 @@ implementation
|
|||||||
Consts.concat(Tai_const.Create_16bit(strlength));
|
Consts.concat(Tai_const.Create_16bit(strlength));
|
||||||
{ redondent with maxlength but who knows ... (PM) }
|
{ redondent with maxlength but who knows ... (PM) }
|
||||||
{ third write use count (set to -1 for safety ) }
|
{ third write use count (set to -1 for safety ) }
|
||||||
Consts.concat(Tai_const.Create_16bit(Cardinal(-1)));
|
Consts.concat(Tai_const.Create_16bit(-1));
|
||||||
Consts.concat(Tai_label.Create(ll));
|
Consts.concat(Tai_label.Create(ll));
|
||||||
getmem(ca,strlength+2);
|
getmem(ca,strlength+2);
|
||||||
move(strval^,ca^,strlength);
|
move(strval^,ca^,strlength);
|
||||||
@ -663,7 +663,7 @@ implementation
|
|||||||
Consts.concat(Tai_const.Create_64bit(strlength));
|
Consts.concat(Tai_const.Create_64bit(strlength));
|
||||||
{ redondent with maxlength but who knows ... (PM) }
|
{ redondent with maxlength but who knows ... (PM) }
|
||||||
{ third write use count (set to -1 for safety ) }
|
{ third write use count (set to -1 for safety ) }
|
||||||
Consts.concat(Tai_const.Create_64bit(Cardinal(-1)));
|
Consts.concat(Tai_const.Create_64bit(-1));
|
||||||
Consts.concat(Tai_label.Create(ll));
|
Consts.concat(Tai_label.Create(ll));
|
||||||
getmem(ca,strlength+2);
|
getmem(ca,strlength+2);
|
||||||
move(strval^,ca^,strlength);
|
move(strval^,ca^,strlength);
|
||||||
@ -1092,7 +1092,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.86 2004-06-16 20:07:09 florian
|
Revision 1.87 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.86 2004/06/16 20:07:09 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.85 2004/05/23 15:23:30 peter
|
Revision 1.85 2004/05/23 15:23:30 peter
|
||||||
@ -1308,4 +1311,4 @@ end.
|
|||||||
Revision 1.40 2002/01/06 21:47:32 peter
|
Revision 1.40 2002/01/06 21:47:32 peter
|
||||||
* removed getprocvar, use only getprocvardef
|
* removed getprocvar, use only getprocvardef
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5470,7 +5470,7 @@ implementation
|
|||||||
else
|
else
|
||||||
writeproc(tpropertysym(sym).storedaccess,4);
|
writeproc(tpropertysym(sym).storedaccess,4);
|
||||||
rttiList.concat(Tai_const.Create_32bit(tpropertysym(sym).index));
|
rttiList.concat(Tai_const.Create_32bit(tpropertysym(sym).index));
|
||||||
rttiList.concat(Tai_const.Create_32bit(cardinal(tpropertysym(sym).default)));
|
rttiList.concat(Tai_const.Create_32bit(tpropertysym(sym).default));
|
||||||
rttiList.concat(Tai_const.Create_16bit(count));
|
rttiList.concat(Tai_const.Create_16bit(count));
|
||||||
inc(count);
|
inc(count);
|
||||||
rttiList.concat(Tai_const.Create_8bit(proctypesinfo));
|
rttiList.concat(Tai_const.Create_8bit(proctypesinfo));
|
||||||
@ -6137,7 +6137,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.241 2004-06-16 20:07:09 florian
|
Revision 1.242 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.241 2004/06/16 20:07:09 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.240 2004/05/25 18:51:14 peter
|
Revision 1.240 2004/05/25 18:51:14 peter
|
||||||
@ -6876,4 +6879,4 @@ end.
|
|||||||
* fix stacksize for some targets
|
* fix stacksize for some targets
|
||||||
* fix generic size problems which depend now on EXTEND_SIZE constant
|
* fix generic size problems which depend now on EXTEND_SIZE constant
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ const
|
|||||||
if hp2.name^<>'' then
|
if hp2.name^<>'' then
|
||||||
importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
|
importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
|
||||||
else
|
else
|
||||||
importsSection.concat(Tai_const.Create_32bit(cardinal($80000000) or cardinal(hp2.ordnr)));
|
importsSection.concat(Tai_const.Create_32bit(longint($80000000) or longint(hp2.ordnr)));
|
||||||
{ finally the import information }
|
{ finally the import information }
|
||||||
new_section(importsSection,sec_idata6,'',0);
|
new_section(importsSection,sec_idata6,'',0);
|
||||||
importsSection.concat(Tai_label.Create(hp2.lab));
|
importsSection.concat(Tai_label.Create(hp2.lab));
|
||||||
@ -465,7 +465,7 @@ const
|
|||||||
if hp2.name^<>'' then
|
if hp2.name^<>'' then
|
||||||
importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
|
importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
|
||||||
else
|
else
|
||||||
importsSection.concat(Tai_const.Create_32bit(cardinal($80000000) or cardinal(hp2.ordnr)));
|
importsSection.concat(Tai_const.Create_32bit(longint($80000000) or hp2.ordnr));
|
||||||
hp2:=twin32imported_item(hp2.next);
|
hp2:=twin32imported_item(hp2.next);
|
||||||
end;
|
end;
|
||||||
{ finalize the names ... }
|
{ finalize the names ... }
|
||||||
@ -1659,7 +1659,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.33 2004-06-16 20:07:11 florian
|
Revision 1.34 2004-06-18 15:16:46 peter
|
||||||
|
* remove obsolete cardinal() typecasts
|
||||||
|
|
||||||
|
Revision 1.33 2004/06/16 20:07:11 florian
|
||||||
* dwarf branch merged
|
* dwarf branch merged
|
||||||
|
|
||||||
Revision 1.32 2004/04/28 18:02:54 peter
|
Revision 1.32 2004/04/28 18:02:54 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user