From 8992ddc11f659219e7dc6254baea79f255e4df62 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Thu, 4 Feb 2021 18:32:06 -0600 Subject: [PATCH] Implement indirect store/copy operations for 64-bit types. These operations (pc_sto and pc_cpi) are used for access through a pointer, and in some cases also for initialization. --- Gen.pas | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Gen.pas b/Gen.pas index 20a8389..d639bb2 100644 --- a/Gen.pas +++ b/Gen.pas @@ -3664,6 +3664,43 @@ case optype of end; {else} end; {case cgReal,cgDouble,cgComp,cgExtended} + cgQuad,cgUQuad: begin + GenTree(op^.right); + gLong.preference := A_X; + GenTree(op^.left); + if gLong.where = onStack then begin + GenImplied(m_pla); + GenImplied(m_plx); + end; {if} + GenNative(m_sta_dir, direct, dworkLoc, nil, 0); + GenNative(m_stx_dir, direct, dworkLoc+2, nil, 0); + if opcode = pc_sto then + GenImplied(m_pla) + else {if op^.opcode = pc_cpi then} + GenNative(m_lda_s, direct, 1, nil, 0); + GenNative(m_sta_indl, direct, dworkLoc, nil, 0); + GenNative(m_ldy_imm, immediate, 2, nil, 0); + if opcode = pc_sto then + GenImplied(m_pla) + else {if op^.opcode = pc_cpi then} + GenNative(m_lda_s, direct, 3, nil, 0); + GenNative(m_sta_indly, direct, dworkLoc, nil, 0); + GenImplied(m_iny); + GenImplied(m_iny); + if opcode = pc_sto then + GenImplied(m_pla) + else {if op^.opcode = pc_cpi then} + GenNative(m_lda_s, direct, 5, nil, 0); + GenNative(m_sta_indly, direct, dworkLoc, nil, 0); + GenImplied(m_iny); + GenImplied(m_iny); + if opcode = pc_sto then + GenImplied(m_pla) + else {if op^.opcode = pc_cpi then} + GenNative(m_lda_s, direct, 7, nil, 0); + GenNative(m_sta_indly, direct, dworkLoc, nil, 0); + end; {case cgQuad,cgUQuad} + cgLong,cgULong: begin if opcode = pc_sto then gLong.preference := onStack+constant