summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 21:12:15 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 21:12:15 +0000
commit3d9290262080e217f4e1d7886f57a8b512a9fda9 (patch)
tree967501fcfe0491e100e22d31ce23d2e9b769d422
parent1014192338d347054d25304577152abf422af7ca (diff)
downloadfpc-3d9290262080e217f4e1d7886f57a8b512a9fda9.tar.gz
* optimization in tcgz80.a_load_const_cgpara for pushing longints, where the low 16 bits are equal
to the high 16 bits (works for e.g. 0) git-svn-id: https://svn.freepascal.org/svn/fpc/branches/z80@45126 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/z80/cgcpu.pas3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/z80/cgcpu.pas b/compiler/z80/cgcpu.pas
index 70b4781a3e..d80382e7ba 100644
--- a/compiler/z80/cgcpu.pas
+++ b/compiler/z80/cgcpu.pas
@@ -394,7 +394,8 @@ unit cgcpu;
getcpuregister(list,NR_IY);
list.Concat(taicpu.op_reg_const(A_LD,NR_IY,Word(a shr 16)));
list.Concat(taicpu.op_reg(A_PUSH,NR_IY));
- list.Concat(taicpu.op_reg_const(A_LD,NR_IY,Word(a)));
+ if Word(a)<>Word(a shr 16) then
+ list.Concat(taicpu.op_reg_const(A_LD,NR_IY,Word(a)));
list.Concat(taicpu.op_reg(A_PUSH,NR_IY));
ungetcpuregister(list,NR_IY);
end;