diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas index 7a9ff3b65c..c32b47118c 100644 --- a/compiler/dbgdwarf.pas +++ b/compiler/dbgdwarf.pas @@ -769,6 +769,15 @@ implementation ]); finish_entry; 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 : begin append_entry(DW_TAG_base_type,false,[ @@ -893,7 +902,7 @@ implementation size:=def.elesize else size:=def.size; - + if not is_packed_array(def) then elesize := def.elesize*8 else diff --git a/compiler/dbgstabs.pas b/compiler/dbgstabs.pas index 8b0e854122..37e582aa12 100644 --- a/compiler/dbgstabs.pas +++ b/compiler/dbgstabs.pas @@ -525,7 +525,8 @@ implementation result:=strpnew(def_stab_number(def)); bool8bit, bool16bit, - bool32bit : + bool32bit, + bool64bit : result:=def_stabstr_evaluate(def,'r${numberstring};0;255;',[]); u32bit, s64bit, @@ -550,6 +551,9 @@ implementation result:=strpnew('-22;'); bool32bit : result:=strpnew('-23;'); + bool64bit : + { no clue if this is correct (FK) } + result:=strpnew('-23;'); u64bit : result:=strpnew('-32;'); s64bit : diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index 40306d8a12..4bb4536df7 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -135,7 +135,7 @@ implementation uvoid, u8bit,u16bit,u32bit,u64bit, s8bit,s16bit,s32bit,s64bit, - bool8bit,bool16bit,bool32bit, + bool8bit,bool16bit,bool32bit,bool64bit, uchar,uwidechar } type @@ -145,7 +145,7 @@ implementation (bvoid, bint,bint,bint,bint, bint,bint,bint,bint, - bbool,bbool,bbool, + bbool,bbool,bbool,bbool, bchar,bchar,bint); basedefconvertsimplicit : array[tbasedef,tbasedef] of tconverttype = @@ -229,7 +229,7 @@ implementation end; end; uvoid, - bool8bit,bool16bit,bool32bit: + bool8bit,bool16bit,bool32bit,bool64bit: eq:=te_equal; else internalerror(200210061); @@ -1330,8 +1330,8 @@ implementation u8bit,u16bit,u32bit,u64bit, s8bit,s16bit,s32bit,s64bit : is_subequal:=(torddef(def2).typ in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]); - bool8bit,bool16bit,bool32bit : - is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit]); + bool8bit,bool16bit,bool32bit,bool64bit : + is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit,bool64bit]); uchar : is_subequal:=(torddef(def2).typ=uchar); uwidechar : diff --git a/compiler/defutil.pas b/compiler/defutil.pas index 70fffb5960..75eb4d7178 100644 --- a/compiler/defutil.pas +++ b/compiler/defutil.pas @@ -333,7 +333,7 @@ implementation is_ordinal:=dt in [uchar,uwidechar, u8bit,u16bit,u32bit,u64bit, s8bit,s16bit,s32bit,s64bit, - bool8bit,bool16bit,bool32bit]; + bool8bit,bool16bit,bool32bit,bool64bit]; end; enumdef : is_ordinal:=true; @@ -384,7 +384,7 @@ implementation function is_boolean(def : tdef) : boolean; begin is_boolean:=(def.deftype=orddef) and - (torddef(def).typ in [bool8bit,bool16bit,bool32bit]); + (torddef(def).typ in [bool8bit,bool16bit,bool32bit,bool64bit]); end; diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 49049e9db7..be17d1e94e 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -661,7 +661,8 @@ implementation {$endif cpu64bit} bool8bit, bool16bit, - bool32bit : + bool32bit, + bool64bit: begin if do_read then begin @@ -1238,7 +1239,7 @@ implementation tempindex: TConstExprInt; begin resulttype:=voidtype; - + unpackedarraydef := nil; packedarraydef := nil; source := tcallparanode(left); @@ -1281,7 +1282,7 @@ implementation begin { index must be compatible with the unpacked array's indextype } inserttypeconv(index.left,unpackedarraydef.rangetype); - + { range check at compile time if possible } if assigned(packedarraydef) and (index.left.nodetype = ordconstn) and @@ -1301,7 +1302,7 @@ implementation { index in the unpacked array is read and must be valid } set_varstate(index.left,vs_read,[vsf_must_be_valid]); end; - + var @@ -1513,6 +1514,13 @@ implementation left:=nil; result:=hp; end; + bool64bit : + begin + { change to qword() } + hp:=ctypeconvnode.create_internal(left,u64inttype); + left:=nil; + result:=hp; + end; uvoid : CGMessage1(type_e_ordinal_expr_expected,left.resulttype.def.typename); else diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 326f251956..71cbb4eddd 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -803,7 +803,8 @@ implementation case torddef(left.resulttype.def).typ of bool8bit, bool16bit, - bool32bit : + bool32bit, + bool64bit: begin { here we do a boolean(byte(..)) type cast because } { boolean() is buggy in 1.00 } diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas index 20ccc950dc..517d42a164 100644 --- a/compiler/powerpc/cgcpu.pas +++ b/compiler/powerpc/cgcpu.pas @@ -547,7 +547,7 @@ const end else instr := taicpu.op_reg_reg(A_MR,reg2,reg1); - + list.concat(instr); rg[R_INTREGISTER].add_move_instruction(instr); end; @@ -1993,7 +1993,7 @@ const if not ((def.deftype=pointerdef) or ((def.deftype=orddef) and (torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar, - bool8bit,bool16bit,bool32bit]))) then + bool8bit,bool16bit,bool32bit,bool64bit]))) then begin list.concat(taicpu.op_reg(A_MCRXR,NR_CR7)); a_jmp(list,A_BC,C_NO,7,hl) diff --git a/compiler/psystem.pas b/compiler/psystem.pas index 548d024e05..960927368e 100644 --- a/compiler/psystem.pas +++ b/compiler/psystem.pas @@ -138,6 +138,7 @@ implementation booltype.setdef(torddef.create(bool8bit,0,1)); bool16type.setdef(torddef.create(bool16bit,0,1)); bool32type.setdef(torddef.create(bool32bit,0,1)); + bool64type.setdef(torddef.create(bool64bit,0,1)); cchartype.setdef(torddef.create(uchar,0,255)); cwidechartype.setdef(torddef.create(uwidechar,0,65535)); cshortstringtype.setdef(tstringdef.createshort(255)); @@ -253,6 +254,7 @@ implementation addtype('ByteBool',booltype); addtype('WordBool',bool16type); addtype('LongBool',bool32type); + addtype('QWordBool',bool64type); addtype('Byte',u8inttype); addtype('ShortInt',s8inttype); addtype('Word',u16inttype); @@ -289,6 +291,7 @@ implementation addtype('$boolean',booltype); addtype('$boolean16',bool16type); addtype('$boolean32',bool32type); + addtype('$boolean64',bool32type); addtype('$void_pointer',voidpointertype); addtype('$char_pointer',charpointertype); addtype('$widechar_pointer',widecharpointertype); @@ -373,6 +376,7 @@ implementation loadtype('boolean',booltype); loadtype('boolean16',bool16type); loadtype('boolean32',bool32type); + loadtype('boolean64',bool32type); loadtype('void_pointer',voidpointertype); loadtype('char_pointer',charpointertype); loadtype('widechar_pointer',widecharpointertype); diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 1276d36090..fbea83d425 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -130,6 +130,13 @@ implementation else Message(parser_e_illegal_expression); 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 : begin if is_constcharnode(p) then diff --git a/compiler/ptype.pas b/compiler/ptype.pas index 1769816ced..802a4d913a 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -479,7 +479,7 @@ implementation {$ifdef cpu64bit} u32bit,s64bit, {$endif cpu64bit} - bool8bit,bool16bit,bool32bit, + bool8bit,bool16bit,bool32bit,bool64bit, uwidechar] then begin lowval:=torddef(t.def).low; diff --git a/compiler/symconst.pas b/compiler/symconst.pas index 3a7d6745a7..b9f599fe22 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -175,7 +175,7 @@ type uvoid, u8bit,u16bit,u32bit,u64bit, s8bit,s16bit,s32bit,s64bit, - bool8bit,bool16bit,bool32bit, + bool8bit,bool16bit,bool32bit,bool64bit, uchar,uwidechar,scurrency ); diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 7845b881a0..5db372939e 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -1675,7 +1675,7 @@ implementation 0, 1,2,4,8, 1,2,4,8, - 1,2,4, + 1,2,4,8, 1,2,8 ); begin @@ -1714,7 +1714,7 @@ implementation varUndefined, varbyte,varqword,varlongword,varqword, varshortint,varsmallint,varinteger,varint64, - varboolean,varUndefined,varUndefined, + varboolean,varUndefined,varUndefined,varUndefined, varUndefined,varUndefined,varCurrency); begin result:=basetype2vartype[typ]; @@ -1747,7 +1747,7 @@ implementation (otUByte{otNone}, otUByte,otUWord,otULong,otUByte{otNone}, otSByte,otSWord,otSLong,otUByte{otNone}, - otUByte,otUWord,otULong, + otUByte,otUWord,otULong,otUByte, otUByte,otUWord,otUByte); begin write_rtti_name; @@ -1825,7 +1825,7 @@ implementation 'untyped', 'Byte','Word','DWord','QWord', 'ShortInt','SmallInt','LongInt','Int64', - 'Boolean','WordBool','LongBool', + 'Boolean','WordBool','LongBool','QWordBool', 'Char','WideChar','Currency'); begin @@ -3962,7 +3962,7 @@ implementation '', 'Uc','Us','Ui','Us', 'Sc','s','i','x', - 'b','b','b', + 'b','b','b','b', 'c','w','x'); var diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index 67197f0f48..8d3e894856 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -1898,7 +1898,7 @@ unit cgx86; if not ((def.deftype=pointerdef) or ((def.deftype=orddef) and (torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar, - bool8bit,bool16bit,bool32bit]))) then + bool8bit,bool16bit,bool32bit,bool64bit]))) then cond:=C_NO else cond:=C_NB;