mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-03-11 23:01:01 +00:00
Implement && and || operators for long long types.
This is done by comparing against 0 (similar to how it is done for reals), rather than introducing new intermediate code operations.
This commit is contained in:
parent
c537153ee5
commit
eb49e10ea9
@ -3460,20 +3460,36 @@ case tree^.token.kind of
|
||||
GenerateCode(tree^.left);
|
||||
if expressionType^.kind in [pointerType,arrayType] then
|
||||
expressionType := uLongPtr
|
||||
else if UsualUnaryConversions = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end; {if}
|
||||
else begin
|
||||
et := UsualUnaryConversions;
|
||||
if et = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end {if}
|
||||
else if et in [cgQuad,cgUQuad] then begin
|
||||
GenLdcQuad(longlong0);
|
||||
Gen0t(pc_neq, et);
|
||||
expressionType := intPtr;
|
||||
end; {else if}
|
||||
end; {else}
|
||||
lType := expressionType;
|
||||
GenerateCode(tree^.right);
|
||||
if expressionType^.kind in [pointerType,arrayType] then
|
||||
expressionType := uLongPtr
|
||||
else if UsualUnaryConversions = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end; {if}
|
||||
else begin
|
||||
et := UsualUnaryConversions;
|
||||
if et = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end {if}
|
||||
else if et in [cgQuad,cgUQuad] then begin
|
||||
GenLdcQuad(longlong0);
|
||||
Gen0t(pc_neq, et);
|
||||
expressionType := intPtr;
|
||||
end; {else if}
|
||||
end; {else}
|
||||
case UsualBinaryConversions(lType) of
|
||||
cgByte,cgUByte,cgWord,cgUWord:
|
||||
Gen0(pc_ior);
|
||||
@ -3489,20 +3505,36 @@ case tree^.token.kind of
|
||||
GenerateCode(tree^.left);
|
||||
if expressionType^.kind in [pointerType,arrayType] then
|
||||
expressionType := uLongPtr
|
||||
else if UsualUnaryConversions = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end; {if}
|
||||
else begin
|
||||
et := UsualUnaryConversions;
|
||||
if et = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end {if}
|
||||
else if et in [cgQuad,cgUQuad] then begin
|
||||
GenLdcQuad(longlong0);
|
||||
Gen0t(pc_neq, et);
|
||||
expressionType := intPtr;
|
||||
end; {else if}
|
||||
end; {else}
|
||||
lType := expressionType;
|
||||
GenerateCode(tree^.right);
|
||||
if expressionType^.kind in [pointerType,arrayType] then
|
||||
expressionType := uLongPtr
|
||||
else if UsualUnaryConversions = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end; {if}
|
||||
else begin
|
||||
et := UsualUnaryConversions;
|
||||
if et = cgExtended then begin
|
||||
GenLdcReal(0.0);
|
||||
Gen0t(pc_neq, cgExtended);
|
||||
expressionType := intPtr;
|
||||
end {if}
|
||||
else if et in [cgQuad,cgUQuad] then begin
|
||||
GenLdcQuad(longlong0);
|
||||
Gen0t(pc_neq, et);
|
||||
expressionType := intPtr;
|
||||
end; {else if}
|
||||
end; {else}
|
||||
case UsualBinaryConversions(lType) of
|
||||
cgByte,cgUByte,cgWord,cgUWord:
|
||||
Gen0(pc_and);
|
||||
|
Loading…
x
Reference in New Issue
Block a user