瀏覽代碼

* support LOC_MMREGISTER for paralocs when loading 128 bit function results
into integer registers (a record that consists of 4 32 bit floats is
returned in 2 xmm registers on x86_64) (mantis #30329)

git-svn-id: trunk@34058 -

Jonas Maebe 9 年之前
父節點
當前提交
db77aad2cc
共有 3 個文件被更改,包括 35 次插入1 次删除
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/ncgutil.pas
  3. 32 0
      tests/webtbs/tw30329.pp

+ 1 - 0
.gitattributes

@@ -15125,6 +15125,7 @@ tests/webtbs/tw30207.pp svneol=native#text/plain
 tests/webtbs/tw30208.pp svneol=native#text/pascal
 tests/webtbs/tw3023.pp svneol=native#text/plain
 tests/webtbs/tw3028.pp svneol=native#text/plain
+tests/webtbs/tw30329.pp -text svneol=native#text/plain
 tests/webtbs/tw3038.pp svneol=native#text/plain
 tests/webtbs/tw3041.pp svneol=native#text/plain
 tests/webtbs/tw3045.pp svneol=native#text/plain

+ 2 - 1
compiler/ncgutil.pas

@@ -856,7 +856,8 @@ implementation
                    is_record(vardef)) then
                 begin
                   case paraloc^.loc of
-                    LOC_REGISTER:
+                    LOC_REGISTER,
+                    LOC_MMREGISTER:
                       begin
                         if not assigned(paraloc^.next) then
                           internalerror(200410104);

+ 32 - 0
tests/webtbs/tw30329.pp

@@ -0,0 +1,32 @@
+program TestOutbox2d;
+
+{$mode objfpc}{$H+}
+
+type
+  TGF2DPoint = array[0..1] of Single;
+
+  TGF2DOutbox = packed record
+    FMin, FMax: TGF2DPoint;
+  end;
+
+function Some2DOutbox : TGF2DOutbox;
+begin
+  Result.FMin[0]:=1.0;
+  Result.FMin[1]:=2.0;
+  Result.FMax[0]:=3.0;
+  Result.FMax[1]:=4.0;
+end;
+
+
+var
+  Outbox : TGF2DOutbox;
+begin
+  Outbox:=Some2DOutbox;
+  with outbox do
+    if (fmin[0]<>1.0) or
+       (fmin[1]<>2.0) or
+       (fmax[0]<>3.0) or
+       (fmax[1]<>4.0) then
+      halt(1);
+end.
+