浏览代码

* ppc64le: fix storing homogeneous 64 bit float parameters in case they are
split over just FPU registers and memory (related to mantis #36934)

git-svn-id: trunk@45204 -

Jonas Maebe 5 年之前
父节点
当前提交
05923af386
共有 3 个文件被更改,包括 70 次插入3 次删除
  1. 1 0
      .gitattributes
  2. 4 3
      compiler/powerpc64/cpupara.pas
  3. 65 0
      tests/webtbs/tw36934a.pp

+ 1 - 0
.gitattributes

@@ -18269,6 +18269,7 @@ tests/webtbs/tw36863.pp svneol=native#text/pascal
 tests/webtbs/tw3687.pp svneol=native#text/plain
 tests/webtbs/tw3687.pp svneol=native#text/plain
 tests/webtbs/tw3691.pp svneol=native#text/plain
 tests/webtbs/tw3691.pp svneol=native#text/plain
 tests/webtbs/tw36934.pp svneol=native#text/plain
 tests/webtbs/tw36934.pp svneol=native#text/plain
+tests/webtbs/tw36934a.pp svneol=native#text/plain
 tests/webtbs/tw3694.pp svneol=native#text/plain
 tests/webtbs/tw3694.pp svneol=native#text/plain
 tests/webtbs/tw3695.pp svneol=native#text/plain
 tests/webtbs/tw3695.pp svneol=native#text/plain
 tests/webtbs/tw3697.pp svneol=native#text/plain
 tests/webtbs/tw3697.pp svneol=native#text/plain

+ 4 - 3
compiler/powerpc64/cpupara.pas

@@ -645,10 +645,11 @@ implemented
       if possible (only possible in case of single precision floats, because
       if possible (only possible in case of single precision floats, because
       there are more fprs than gprs for parameter passing) }
       there are more fprs than gprs for parameter passing) }
     if assigned(alllocdef) and
     if assigned(alllocdef) and
-       (tcgsize2size[paracgsize]=4) and
        (loc=LOC_FPUREGISTER) and
        (loc=LOC_FPUREGISTER) and
-       (nextfloatreg=RS_F13) and
-       (paralen>4) then
+       (((nextfloatreg=RS_F13) and
+         (tcgsize2size[paracgsize]=4) and
+         (paralen>4)) or
+        (nextfloatreg>RS_F13)) then
       begin
       begin
         loc:=LOC_REGISTER;
         loc:=LOC_REGISTER;
         paracgsize:=OS_64;
         paracgsize:=OS_64;

+ 65 - 0
tests/webtbs/tw36934a.pp

@@ -0,0 +1,65 @@
+type
+  TPointF = record
+    x,y: double;
+  end;
+
+procedure test(pt1, pt2, pt3,
+  pt4: TPointF; texture: tobject; tex1, tex2, tex3, tex4: TPointF);
+begin
+  if pt1.x<>1.0 then
+    halt(1);
+  if pt1.y<>2.0 then
+    halt(2);
+  if pt2.x<>3.0 then
+    halt(3);
+  if pt2.y<>4.0 then
+    halt(4);
+  if pt3.x<>5.0 then
+    halt(5);
+  if pt3.y<>6.0 then
+    halt(6);
+  if pt4.x<>7.0 then
+    halt(7);
+  if pt4.y<>8.0 then
+    halt(8);
+  if texture<>nil then
+    halt(9);
+  if tex1.x<>9.0 then
+    halt(9);
+  if tex1.y<>10.0 then
+    halt(10);
+  if tex2.x<>11.0 then
+    halt(11);
+  if tex2.y<>12.0 then
+    halt(12);
+  if tex3.x<>13.0 then
+    halt(13);
+  if tex3.y<>14.0 then
+    halt(14);
+  if tex4.x<>15.0 then
+    halt(15);
+  if tex4.y<>16.0 then
+    halt(16);
+end;
+
+var
+  p1,p2,p3,p4,t1,t2,t3,t4: tpointf;
+begin
+  p1.x:=1.0;
+  p1.y:=2.0;
+  p2.x:=3.0;
+  p2.y:=4.0;
+  p3.x:=5.0;
+  p3.y:=6.0;
+  p4.x:=7.0;
+  p4.y:=8.0;
+  t1.x:=9.0;
+  t1.y:=10.0;
+  t2.x:=11.0;
+  t2.y:=12.0;
+  t3.x:=13.0;
+  t3.y:=14.0;
+  t4.x:=15.0;
+  t4.y:=16.0;
+  test(p1,p2,p3,p4,nil,t1,t2,t3,t4);
+end.