* 8/16-bit alu fixes in tnotnode.simplify

git-svn-id: trunk@27636 -
This commit is contained in:
nickysn 2014-04-22 22:04:31 +00:00
parent 356ea656e4
commit aa3f450832

View File

@ -1125,26 +1125,24 @@ implementation
u16bit,
s16bit,
s32bit,
{$ifdef cpu64bitaddr}
u32bit,
{$endif cpu64bitaddr}
s64bit:
s64bit,
u64bit:
begin
v:=int64(not int64(v));
if (torddef(left.resultdef).ordtype<>s64bit) then
def:=sinttype
{ unsigned, equal or bigger than the native int size? }
if (torddef(left.resultdef).ordtype in [u64bit,u32bit,u16bit,u8bit,uchar,uwidechar]) and
(is_nativeord(left.resultdef) or is_oversizedord(left.resultdef)) then
begin
{ Delphi-compatible: not dword = dword (not word = longint) }
{ Extension: not qword = qword }
v:=qword(not qword(v));
{ will be truncated by the ordconstnode for u32bit }
end
else
def:=s64inttype;
end;
{$ifndef cpu64bitaddr}
u32bit,
{$endif not cpu64bitaddr}
u64bit :
begin
{ Delphi-compatible: not dword = dword (not word = longint) }
{ Extension: not qword = qword }
v:=qword(not qword(v));
{ will be truncated by the ordconstnode for u32bit }
begin
v:=int64(not int64(v));
def:=get_common_intdef(torddef(left.resultdef),torddef(sinttype),false);
end;
end;
else
CGMessage(type_e_mismatch);