mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:06:14 +02:00
+ first part of qwordbool implementation
git-svn-id: trunk@4462 -
This commit is contained in:
parent
794c13c58b
commit
9e66674ff9
@ -769,6 +769,15 @@ implementation
|
|||||||
]);
|
]);
|
||||||
finish_entry;
|
finish_entry;
|
||||||
end;
|
end;
|
||||||
|
bool64bit :
|
||||||
|
begin
|
||||||
|
append_entry(DW_TAG_base_type,false,[
|
||||||
|
DW_AT_name,DW_FORM_string,'QWordBool'#0,
|
||||||
|
DW_AT_encoding,DW_FORM_data1,DW_ATE_boolean,
|
||||||
|
DW_AT_byte_size,DW_FORM_data1,8
|
||||||
|
]);
|
||||||
|
finish_entry;
|
||||||
|
end;
|
||||||
u64bit :
|
u64bit :
|
||||||
begin
|
begin
|
||||||
append_entry(DW_TAG_base_type,false,[
|
append_entry(DW_TAG_base_type,false,[
|
||||||
@ -893,7 +902,7 @@ implementation
|
|||||||
size:=def.elesize
|
size:=def.elesize
|
||||||
else
|
else
|
||||||
size:=def.size;
|
size:=def.size;
|
||||||
|
|
||||||
if not is_packed_array(def) then
|
if not is_packed_array(def) then
|
||||||
elesize := def.elesize*8
|
elesize := def.elesize*8
|
||||||
else
|
else
|
||||||
|
@ -525,7 +525,8 @@ implementation
|
|||||||
result:=strpnew(def_stab_number(def));
|
result:=strpnew(def_stab_number(def));
|
||||||
bool8bit,
|
bool8bit,
|
||||||
bool16bit,
|
bool16bit,
|
||||||
bool32bit :
|
bool32bit,
|
||||||
|
bool64bit :
|
||||||
result:=def_stabstr_evaluate(def,'r${numberstring};0;255;',[]);
|
result:=def_stabstr_evaluate(def,'r${numberstring};0;255;',[]);
|
||||||
u32bit,
|
u32bit,
|
||||||
s64bit,
|
s64bit,
|
||||||
@ -550,6 +551,9 @@ implementation
|
|||||||
result:=strpnew('-22;');
|
result:=strpnew('-22;');
|
||||||
bool32bit :
|
bool32bit :
|
||||||
result:=strpnew('-23;');
|
result:=strpnew('-23;');
|
||||||
|
bool64bit :
|
||||||
|
{ no clue if this is correct (FK) }
|
||||||
|
result:=strpnew('-23;');
|
||||||
u64bit :
|
u64bit :
|
||||||
result:=strpnew('-32;');
|
result:=strpnew('-32;');
|
||||||
s64bit :
|
s64bit :
|
||||||
|
@ -135,7 +135,7 @@ implementation
|
|||||||
uvoid,
|
uvoid,
|
||||||
u8bit,u16bit,u32bit,u64bit,
|
u8bit,u16bit,u32bit,u64bit,
|
||||||
s8bit,s16bit,s32bit,s64bit,
|
s8bit,s16bit,s32bit,s64bit,
|
||||||
bool8bit,bool16bit,bool32bit,
|
bool8bit,bool16bit,bool32bit,bool64bit,
|
||||||
uchar,uwidechar }
|
uchar,uwidechar }
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -145,7 +145,7 @@ implementation
|
|||||||
(bvoid,
|
(bvoid,
|
||||||
bint,bint,bint,bint,
|
bint,bint,bint,bint,
|
||||||
bint,bint,bint,bint,
|
bint,bint,bint,bint,
|
||||||
bbool,bbool,bbool,
|
bbool,bbool,bbool,bbool,
|
||||||
bchar,bchar,bint);
|
bchar,bchar,bint);
|
||||||
|
|
||||||
basedefconvertsimplicit : array[tbasedef,tbasedef] of tconverttype =
|
basedefconvertsimplicit : array[tbasedef,tbasedef] of tconverttype =
|
||||||
@ -229,7 +229,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
uvoid,
|
uvoid,
|
||||||
bool8bit,bool16bit,bool32bit:
|
bool8bit,bool16bit,bool32bit,bool64bit:
|
||||||
eq:=te_equal;
|
eq:=te_equal;
|
||||||
else
|
else
|
||||||
internalerror(200210061);
|
internalerror(200210061);
|
||||||
@ -1330,8 +1330,8 @@ implementation
|
|||||||
u8bit,u16bit,u32bit,u64bit,
|
u8bit,u16bit,u32bit,u64bit,
|
||||||
s8bit,s16bit,s32bit,s64bit :
|
s8bit,s16bit,s32bit,s64bit :
|
||||||
is_subequal:=(torddef(def2).typ in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
|
is_subequal:=(torddef(def2).typ in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
|
||||||
bool8bit,bool16bit,bool32bit :
|
bool8bit,bool16bit,bool32bit,bool64bit :
|
||||||
is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit]);
|
is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit,bool64bit]);
|
||||||
uchar :
|
uchar :
|
||||||
is_subequal:=(torddef(def2).typ=uchar);
|
is_subequal:=(torddef(def2).typ=uchar);
|
||||||
uwidechar :
|
uwidechar :
|
||||||
|
@ -333,7 +333,7 @@ implementation
|
|||||||
is_ordinal:=dt in [uchar,uwidechar,
|
is_ordinal:=dt in [uchar,uwidechar,
|
||||||
u8bit,u16bit,u32bit,u64bit,
|
u8bit,u16bit,u32bit,u64bit,
|
||||||
s8bit,s16bit,s32bit,s64bit,
|
s8bit,s16bit,s32bit,s64bit,
|
||||||
bool8bit,bool16bit,bool32bit];
|
bool8bit,bool16bit,bool32bit,bool64bit];
|
||||||
end;
|
end;
|
||||||
enumdef :
|
enumdef :
|
||||||
is_ordinal:=true;
|
is_ordinal:=true;
|
||||||
@ -384,7 +384,7 @@ implementation
|
|||||||
function is_boolean(def : tdef) : boolean;
|
function is_boolean(def : tdef) : boolean;
|
||||||
begin
|
begin
|
||||||
is_boolean:=(def.deftype=orddef) and
|
is_boolean:=(def.deftype=orddef) and
|
||||||
(torddef(def).typ in [bool8bit,bool16bit,bool32bit]);
|
(torddef(def).typ in [bool8bit,bool16bit,bool32bit,bool64bit]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -661,7 +661,8 @@ implementation
|
|||||||
{$endif cpu64bit}
|
{$endif cpu64bit}
|
||||||
bool8bit,
|
bool8bit,
|
||||||
bool16bit,
|
bool16bit,
|
||||||
bool32bit :
|
bool32bit,
|
||||||
|
bool64bit:
|
||||||
begin
|
begin
|
||||||
if do_read then
|
if do_read then
|
||||||
begin
|
begin
|
||||||
@ -1238,7 +1239,7 @@ implementation
|
|||||||
tempindex: TConstExprInt;
|
tempindex: TConstExprInt;
|
||||||
begin
|
begin
|
||||||
resulttype:=voidtype;
|
resulttype:=voidtype;
|
||||||
|
|
||||||
unpackedarraydef := nil;
|
unpackedarraydef := nil;
|
||||||
packedarraydef := nil;
|
packedarraydef := nil;
|
||||||
source := tcallparanode(left);
|
source := tcallparanode(left);
|
||||||
@ -1281,7 +1282,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ index must be compatible with the unpacked array's indextype }
|
{ index must be compatible with the unpacked array's indextype }
|
||||||
inserttypeconv(index.left,unpackedarraydef.rangetype);
|
inserttypeconv(index.left,unpackedarraydef.rangetype);
|
||||||
|
|
||||||
{ range check at compile time if possible }
|
{ range check at compile time if possible }
|
||||||
if assigned(packedarraydef) and
|
if assigned(packedarraydef) and
|
||||||
(index.left.nodetype = ordconstn) and
|
(index.left.nodetype = ordconstn) and
|
||||||
@ -1301,7 +1302,7 @@ implementation
|
|||||||
{ index in the unpacked array is read and must be valid }
|
{ index in the unpacked array is read and must be valid }
|
||||||
set_varstate(index.left,vs_read,[vsf_must_be_valid]);
|
set_varstate(index.left,vs_read,[vsf_must_be_valid]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -1513,6 +1514,13 @@ implementation
|
|||||||
left:=nil;
|
left:=nil;
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end;
|
end;
|
||||||
|
bool64bit :
|
||||||
|
begin
|
||||||
|
{ change to qword() }
|
||||||
|
hp:=ctypeconvnode.create_internal(left,u64inttype);
|
||||||
|
left:=nil;
|
||||||
|
result:=hp;
|
||||||
|
end;
|
||||||
uvoid :
|
uvoid :
|
||||||
CGMessage1(type_e_ordinal_expr_expected,left.resulttype.def.typename);
|
CGMessage1(type_e_ordinal_expr_expected,left.resulttype.def.typename);
|
||||||
else
|
else
|
||||||
|
@ -803,7 +803,8 @@ implementation
|
|||||||
case torddef(left.resulttype.def).typ of
|
case torddef(left.resulttype.def).typ of
|
||||||
bool8bit,
|
bool8bit,
|
||||||
bool16bit,
|
bool16bit,
|
||||||
bool32bit :
|
bool32bit,
|
||||||
|
bool64bit:
|
||||||
begin
|
begin
|
||||||
{ here we do a boolean(byte(..)) type cast because }
|
{ here we do a boolean(byte(..)) type cast because }
|
||||||
{ boolean(<int64>) is buggy in 1.00 }
|
{ boolean(<int64>) is buggy in 1.00 }
|
||||||
|
@ -547,7 +547,7 @@ const
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
instr := taicpu.op_reg_reg(A_MR,reg2,reg1);
|
instr := taicpu.op_reg_reg(A_MR,reg2,reg1);
|
||||||
|
|
||||||
list.concat(instr);
|
list.concat(instr);
|
||||||
rg[R_INTREGISTER].add_move_instruction(instr);
|
rg[R_INTREGISTER].add_move_instruction(instr);
|
||||||
end;
|
end;
|
||||||
@ -1993,7 +1993,7 @@ const
|
|||||||
if not ((def.deftype=pointerdef) or
|
if not ((def.deftype=pointerdef) or
|
||||||
((def.deftype=orddef) and
|
((def.deftype=orddef) and
|
||||||
(torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
|
(torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
|
||||||
bool8bit,bool16bit,bool32bit]))) then
|
bool8bit,bool16bit,bool32bit,bool64bit]))) then
|
||||||
begin
|
begin
|
||||||
list.concat(taicpu.op_reg(A_MCRXR,NR_CR7));
|
list.concat(taicpu.op_reg(A_MCRXR,NR_CR7));
|
||||||
a_jmp(list,A_BC,C_NO,7,hl)
|
a_jmp(list,A_BC,C_NO,7,hl)
|
||||||
|
@ -138,6 +138,7 @@ implementation
|
|||||||
booltype.setdef(torddef.create(bool8bit,0,1));
|
booltype.setdef(torddef.create(bool8bit,0,1));
|
||||||
bool16type.setdef(torddef.create(bool16bit,0,1));
|
bool16type.setdef(torddef.create(bool16bit,0,1));
|
||||||
bool32type.setdef(torddef.create(bool32bit,0,1));
|
bool32type.setdef(torddef.create(bool32bit,0,1));
|
||||||
|
bool64type.setdef(torddef.create(bool64bit,0,1));
|
||||||
cchartype.setdef(torddef.create(uchar,0,255));
|
cchartype.setdef(torddef.create(uchar,0,255));
|
||||||
cwidechartype.setdef(torddef.create(uwidechar,0,65535));
|
cwidechartype.setdef(torddef.create(uwidechar,0,65535));
|
||||||
cshortstringtype.setdef(tstringdef.createshort(255));
|
cshortstringtype.setdef(tstringdef.createshort(255));
|
||||||
@ -253,6 +254,7 @@ implementation
|
|||||||
addtype('ByteBool',booltype);
|
addtype('ByteBool',booltype);
|
||||||
addtype('WordBool',bool16type);
|
addtype('WordBool',bool16type);
|
||||||
addtype('LongBool',bool32type);
|
addtype('LongBool',bool32type);
|
||||||
|
addtype('QWordBool',bool64type);
|
||||||
addtype('Byte',u8inttype);
|
addtype('Byte',u8inttype);
|
||||||
addtype('ShortInt',s8inttype);
|
addtype('ShortInt',s8inttype);
|
||||||
addtype('Word',u16inttype);
|
addtype('Word',u16inttype);
|
||||||
@ -289,6 +291,7 @@ implementation
|
|||||||
addtype('$boolean',booltype);
|
addtype('$boolean',booltype);
|
||||||
addtype('$boolean16',bool16type);
|
addtype('$boolean16',bool16type);
|
||||||
addtype('$boolean32',bool32type);
|
addtype('$boolean32',bool32type);
|
||||||
|
addtype('$boolean64',bool32type);
|
||||||
addtype('$void_pointer',voidpointertype);
|
addtype('$void_pointer',voidpointertype);
|
||||||
addtype('$char_pointer',charpointertype);
|
addtype('$char_pointer',charpointertype);
|
||||||
addtype('$widechar_pointer',widecharpointertype);
|
addtype('$widechar_pointer',widecharpointertype);
|
||||||
@ -373,6 +376,7 @@ implementation
|
|||||||
loadtype('boolean',booltype);
|
loadtype('boolean',booltype);
|
||||||
loadtype('boolean16',bool16type);
|
loadtype('boolean16',bool16type);
|
||||||
loadtype('boolean32',bool32type);
|
loadtype('boolean32',bool32type);
|
||||||
|
loadtype('boolean64',bool32type);
|
||||||
loadtype('void_pointer',voidpointertype);
|
loadtype('void_pointer',voidpointertype);
|
||||||
loadtype('char_pointer',charpointertype);
|
loadtype('char_pointer',charpointertype);
|
||||||
loadtype('widechar_pointer',widecharpointertype);
|
loadtype('widechar_pointer',widecharpointertype);
|
||||||
|
@ -130,6 +130,13 @@ implementation
|
|||||||
else
|
else
|
||||||
Message(parser_e_illegal_expression);
|
Message(parser_e_illegal_expression);
|
||||||
end;
|
end;
|
||||||
|
bool64bit :
|
||||||
|
begin
|
||||||
|
if is_constboolnode(p) then
|
||||||
|
datalist.concat(Tai_const.Create_64bit(int64(tordconstnode(p).value)))
|
||||||
|
else
|
||||||
|
Message(parser_e_illegal_expression);
|
||||||
|
end;
|
||||||
uchar :
|
uchar :
|
||||||
begin
|
begin
|
||||||
if is_constcharnode(p) then
|
if is_constcharnode(p) then
|
||||||
|
@ -479,7 +479,7 @@ implementation
|
|||||||
{$ifdef cpu64bit}
|
{$ifdef cpu64bit}
|
||||||
u32bit,s64bit,
|
u32bit,s64bit,
|
||||||
{$endif cpu64bit}
|
{$endif cpu64bit}
|
||||||
bool8bit,bool16bit,bool32bit,
|
bool8bit,bool16bit,bool32bit,bool64bit,
|
||||||
uwidechar] then
|
uwidechar] then
|
||||||
begin
|
begin
|
||||||
lowval:=torddef(t.def).low;
|
lowval:=torddef(t.def).low;
|
||||||
|
@ -175,7 +175,7 @@ type
|
|||||||
uvoid,
|
uvoid,
|
||||||
u8bit,u16bit,u32bit,u64bit,
|
u8bit,u16bit,u32bit,u64bit,
|
||||||
s8bit,s16bit,s32bit,s64bit,
|
s8bit,s16bit,s32bit,s64bit,
|
||||||
bool8bit,bool16bit,bool32bit,
|
bool8bit,bool16bit,bool32bit,bool64bit,
|
||||||
uchar,uwidechar,scurrency
|
uchar,uwidechar,scurrency
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1675,7 +1675,7 @@ implementation
|
|||||||
0,
|
0,
|
||||||
1,2,4,8,
|
1,2,4,8,
|
||||||
1,2,4,8,
|
1,2,4,8,
|
||||||
1,2,4,
|
1,2,4,8,
|
||||||
1,2,8
|
1,2,8
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
@ -1714,7 +1714,7 @@ implementation
|
|||||||
varUndefined,
|
varUndefined,
|
||||||
varbyte,varqword,varlongword,varqword,
|
varbyte,varqword,varlongword,varqword,
|
||||||
varshortint,varsmallint,varinteger,varint64,
|
varshortint,varsmallint,varinteger,varint64,
|
||||||
varboolean,varUndefined,varUndefined,
|
varboolean,varUndefined,varUndefined,varUndefined,
|
||||||
varUndefined,varUndefined,varCurrency);
|
varUndefined,varUndefined,varCurrency);
|
||||||
begin
|
begin
|
||||||
result:=basetype2vartype[typ];
|
result:=basetype2vartype[typ];
|
||||||
@ -1747,7 +1747,7 @@ implementation
|
|||||||
(otUByte{otNone},
|
(otUByte{otNone},
|
||||||
otUByte,otUWord,otULong,otUByte{otNone},
|
otUByte,otUWord,otULong,otUByte{otNone},
|
||||||
otSByte,otSWord,otSLong,otUByte{otNone},
|
otSByte,otSWord,otSLong,otUByte{otNone},
|
||||||
otUByte,otUWord,otULong,
|
otUByte,otUWord,otULong,otUByte,
|
||||||
otUByte,otUWord,otUByte);
|
otUByte,otUWord,otUByte);
|
||||||
begin
|
begin
|
||||||
write_rtti_name;
|
write_rtti_name;
|
||||||
@ -1825,7 +1825,7 @@ implementation
|
|||||||
'untyped',
|
'untyped',
|
||||||
'Byte','Word','DWord','QWord',
|
'Byte','Word','DWord','QWord',
|
||||||
'ShortInt','SmallInt','LongInt','Int64',
|
'ShortInt','SmallInt','LongInt','Int64',
|
||||||
'Boolean','WordBool','LongBool',
|
'Boolean','WordBool','LongBool','QWordBool',
|
||||||
'Char','WideChar','Currency');
|
'Char','WideChar','Currency');
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -3962,7 +3962,7 @@ implementation
|
|||||||
'',
|
'',
|
||||||
'Uc','Us','Ui','Us',
|
'Uc','Us','Ui','Us',
|
||||||
'Sc','s','i','x',
|
'Sc','s','i','x',
|
||||||
'b','b','b',
|
'b','b','b','b',
|
||||||
'c','w','x');
|
'c','w','x');
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -1898,7 +1898,7 @@ unit cgx86;
|
|||||||
if not ((def.deftype=pointerdef) or
|
if not ((def.deftype=pointerdef) or
|
||||||
((def.deftype=orddef) and
|
((def.deftype=orddef) and
|
||||||
(torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
|
(torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
|
||||||
bool8bit,bool16bit,bool32bit]))) then
|
bool8bit,bool16bit,bool32bit,bool64bit]))) then
|
||||||
cond:=C_NO
|
cond:=C_NO
|
||||||
else
|
else
|
||||||
cond:=C_NB;
|
cond:=C_NB;
|
||||||
|
Loading…
Reference in New Issue
Block a user