Browse Source

+ add support for passing 32-bit values in a pair of registers in
tcg8086.a_load_const_cgpara. This fixes passing const longint parameters in
dx:ax when using the register calling convention on i8086.

git-svn-id: trunk@38785 -

nickysn 7 năm trước cách đây
mục cha
commit
bd3d35f2da
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      compiler/i8086/cgcpu.pas

+ 13 - 0
compiler/i8086/cgcpu.pas

@@ -1395,6 +1395,19 @@ unit cgcpu;
                 push_const(list,pushsize,a);
               end;
           end
+        else if (tcgsize2size[cgpara.Size]>2) and
+                (cgpara.location^.loc in [LOC_REGISTER,LOC_CREGISTER]) and
+                (cgpara.location^.Next<>nil) then
+          begin
+            if (tcgsize2size[cgpara.Size]<>4) or
+               (tcgsize2size[cgpara.location^.Size]<>2) or
+                not (cgpara.location^.Next^.Loc in [LOC_REGISTER,LOC_CREGISTER]) or
+               (tcgsize2size[cgpara.location^.Next^.Size]<>2) or
+               (cgpara.location^.Next^.Next<>nil) then
+              internalerror(2018041801);
+            a_load_const_reg(list,cgpara.location^.size,a and $FFFF,cgpara.location^.register);
+            a_load_const_reg(list,cgpara.location^.Next^.size,a shr 16,cgpara.location^.Next^.register);
+          end
         else
           inherited a_load_const_cgpara(list,size,a,cgpara);
       end;