mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-04-07 17:37:11 +00:00
Optimize double stores to just use integer operations.
This is equivalent to an optimization already done for float.
This commit is contained in:
parent
0021fd81bc
commit
af3c8e1eea
19
DAG.pas
19
DAG.pas
@ -565,6 +565,12 @@ var
|
||||
false: (rval: real);
|
||||
end;
|
||||
|
||||
cnvdbl: record {for stuffing a double in a quad space}
|
||||
case boolean of
|
||||
true: (qval: longlong);
|
||||
false: (rval: double);
|
||||
end;
|
||||
|
||||
begin {RealStoreOptimizations}
|
||||
if opl^.opcode = pc_cnv then
|
||||
if baseTypeEnum(opl^.q & $000F) = op^.optype then
|
||||
@ -631,6 +637,19 @@ var
|
||||
opl^.optype := cgLong;
|
||||
op^.optype := cgLong;
|
||||
end; {if}
|
||||
end {if}
|
||||
else if op^.optype = cgDouble then begin
|
||||
if opl^.opcode = pc_ldc then begin
|
||||
cnvdbl.rval := opl^.rval;
|
||||
opl^.qval := cnvdbl.qval;
|
||||
opl^.optype := cgQuad;
|
||||
op^.optype := cgQuad;
|
||||
end {if}
|
||||
else if opl^.opcode in [pc_ind,pc_ldo,pc_lod] then
|
||||
if opl^.optype = cgDouble then begin
|
||||
opl^.optype := cgQuad;
|
||||
op^.optype := cgQuad;
|
||||
end; {if}
|
||||
end; {if}
|
||||
end; {RealStoreOptimizations}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user