浏览代码

* treat procvardef parameters the same as records (fixes webtbs/tw9141)
* fixed some issues with 16 byte parameters on both ppc and ppc64

git-svn-id: trunk@8389 -

Jonas Maebe 18 年之前
父节点
当前提交
22f616d6af
共有 3 个文件被更改,包括 8 次插入18 次删除
  1. 4 9
      compiler/powerpc/cpupara.pas
  2. 1 1
      compiler/powerpc64/cgcpu.pas
  3. 3 8
      compiler/powerpc64/cpupara.pas

+ 4 - 9
compiler/powerpc/cpupara.pas

@@ -130,6 +130,7 @@ unit cpupara;
               result:=LOC_REGISTER;
             classrefdef:
               result:=LOC_REGISTER;
+            procvardef,
             recorddef:
               if (target_info.abi<>abi_powerpc_aix) or
                  ((p.size >= 3) and
@@ -147,11 +148,6 @@ unit cpupara;
                 result:=LOC_REFERENCE
               else
                 result:=LOC_REGISTER;
-            procvardef:
-              if (po_methodpointer in tprocvardef(p).procoptions) then
-                result:=LOC_REFERENCE
-              else
-                result:=LOC_REGISTER;
             filedef:
               result:=LOC_REGISTER;
             arraydef:
@@ -185,7 +181,8 @@ unit cpupara;
           variantdef,
           formaldef :
             result:=true;
-          recorddef:
+          recorddef,
+          procvardef :
             result :=
               (target_info.abi<>abi_powerpc_aix) or
               ((varspez = vs_const) and
@@ -206,8 +203,6 @@ unit cpupara;
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
             result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
-          procvardef :
-            result:=po_methodpointer in tprocvardef(def).procoptions;
         end;
       end;
 
@@ -456,7 +451,7 @@ unit cpupara;
                       { make sure we don't lose whether or not the type is signed }
                       if (paradef.typ <> orddef) then
                         paracgsize := int_cgsize(paralen);
-                      if (paracgsize in [OS_NO,OS_64,OS_S64]) then
+                      if (paracgsize in [OS_NO,OS_64,OS_S64,OS_128,OS_S128]) then
                         paraloc^.size := OS_INT
                       else
                         paraloc^.size := paracgsize;

+ 1 - 1
compiler/powerpc64/cgcpu.pas

@@ -446,7 +446,7 @@ begin
     case location^.loc of
       LOC_REGISTER, LOC_CREGISTER:
         begin
-          if (size <> OS_NO) then
+          if not(size in [OS_NO,OS_128,OS_S128]) then
             a_load_ref_reg(list, size, location^.size, tmpref,
               location^.register)
           else begin

+ 3 - 8
compiler/powerpc64/cpupara.pas

@@ -123,6 +123,7 @@ begin
       result := LOC_REGISTER;
     classrefdef:
       result := LOC_REGISTER;
+    procvardef,
     recorddef:
       result := LOC_REGISTER;
     objectdef:
@@ -135,11 +136,6 @@ begin
         result := LOC_REFERENCE
       else
         result := LOC_REGISTER;
-    procvardef:
-      if (po_methodpointer in tprocvardef(p).procoptions) then
-        result := LOC_REFERENCE
-      else
-        result := LOC_REGISTER;
     filedef:
       result := LOC_REGISTER;
     arraydef:
@@ -173,6 +169,7 @@ begin
     variantdef,
     formaldef:
       result := true;
+    procvardef,
     recorddef:
       result :=
         ((varspez = vs_const) and
@@ -192,8 +189,6 @@ begin
       result := (tsetdef(def).settype <> smallset);
     stringdef:
       result := tstringdef(def).stringtype in [st_shortstring, st_longstring];
-    procvardef:
-      result := po_methodpointer in tprocvardef(def).procoptions;
   end;
 end;
 
@@ -388,7 +383,7 @@ begin
         { make sure we don't lose whether or not the type is signed }
         if (paracgsize <> OS_NO) and (paradef.typ <> orddef) then
           paracgsize := int_cgsize(paralen);
-        if (paracgsize = OS_NO) then
+        if (paracgsize in [OS_NO,OS_128,OS_S128]) then
           paraloc^.size := OS_INT
         else 
           paraloc^.size := paracgsize;