mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-03 10:29:41 +00:00
Optimization to avoid generating unnecessary sign-extension code when converting UChar values to Long/ULong.
This ameliorates a performance regression due to promoting char to int instead of unsigned int.
This commit is contained in:
parent
cc75a9b12b
commit
953a7c36d5
4
DAG.pas
4
DAG.pas
@ -987,6 +987,10 @@ case op^.opcode of {check for optimizations of this node}
|
||||
pc_cnv: begin {pc_cnv}
|
||||
fromtype.i := (op^.q & $00F0) >> 4;
|
||||
totype.i := op^.q & $000F;
|
||||
if (fromtype.optype = cgWord) and (TypeOf(op^.left) = cgUByte) then begin
|
||||
fromType.optype := cgUWord;
|
||||
op^.q := (op^.q & $FF0F) | (fromtype.i << 4);
|
||||
end; {if}
|
||||
if op^.left^.opcode = pc_ldc then begin
|
||||
case fromtype.optype of
|
||||
cgByte,cgWord:
|
||||
|
Loading…
Reference in New Issue
Block a user