From db77aad2ccf14b8d04e46ab0ef73c8a78ee692ea Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 3 Jul 2016 21:18:23 +0000 Subject: [PATCH] * 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 - --- .gitattributes | 1 + compiler/ncgutil.pas | 3 ++- tests/webtbs/tw30329.pp | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw30329.pp diff --git a/.gitattributes b/.gitattributes index 05511b8e14..21b9c65665 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index e5b00b75cf..9eed6d8265 100644 --- a/compiler/ncgutil.pas +++ b/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); diff --git a/tests/webtbs/tw30329.pp b/tests/webtbs/tw30329.pp new file mode 100644 index 0000000000..6e56ae2e8d --- /dev/null +++ b/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. +