mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 21:09:27 +02:00
* when optimising subsetreg moves for aarch64, take into account the fact
that the subsetreg itself can be 32 or 64 bit (mantis #33607) git-svn-id: trunk@40512 -
This commit is contained in:
parent
5e22121c21
commit
52fec8a94a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16399,6 +16399,7 @@ tests/webtbs/tw3356.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw33563.pp svneol=native#text/pascal
|
tests/webtbs/tw33563.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw33564.pp svneol=native#text/pascal
|
tests/webtbs/tw33564.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3360.pp svneol=native#text/plain
|
tests/webtbs/tw3360.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw33607.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw33635.pp svneol=native#text/pascal
|
tests/webtbs/tw33635.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3364.pp svneol=native#text/plain
|
tests/webtbs/tw3364.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3366.pp svneol=native#text/plain
|
tests/webtbs/tw3366.pp svneol=native#text/plain
|
||||||
|
@ -64,7 +64,10 @@ implementation
|
|||||||
begin
|
begin
|
||||||
tocgsize:=def_cgsize(tosize);
|
tocgsize:=def_cgsize(tosize);
|
||||||
if (sreg.startbit<>0) or
|
if (sreg.startbit<>0) or
|
||||||
not(sreg.bitlen in [32,64]) then
|
not((sreg.subsetregsize in [OS_32,OS_S32]) and
|
||||||
|
(sreg.bitlen=32)) or
|
||||||
|
not((sreg.subsetregsize in [OS_64,OS_S64]) and
|
||||||
|
(sreg.bitlen=64)) then
|
||||||
begin
|
begin
|
||||||
if is_signed(subsetsize) then
|
if is_signed(subsetsize) then
|
||||||
op:=A_SBFX
|
op:=A_SBFX
|
||||||
|
51
tests/webtbs/tw33607.pp
Normal file
51
tests/webtbs/tw33607.pp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{$mode objfpc}{$H+}
|
||||||
|
{$modeSwitch advancedRecords}
|
||||||
|
|
||||||
|
type
|
||||||
|
TRectangle = record
|
||||||
|
public
|
||||||
|
Left, Bottom: Integer;
|
||||||
|
Width, Height: Cardinal;
|
||||||
|
|
||||||
|
function ScaleAround0(const Factor: Single): TRectangle;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRectangle.ScaleAround0(const Factor: Single): TRectangle;
|
||||||
|
begin
|
||||||
|
if Width <= 0 then
|
||||||
|
begin
|
||||||
|
Result.Width := Width;
|
||||||
|
Result.Left := Left;
|
||||||
|
end else
|
||||||
|
halt(3);
|
||||||
|
|
||||||
|
Result.Height := Height;
|
||||||
|
Result.Bottom := Bottom;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function Rectangle(const Left, Bottom: Integer;
|
||||||
|
const Width, Height: Cardinal): TRectangle;
|
||||||
|
begin
|
||||||
|
Rectangle.Left := Left;
|
||||||
|
Rectangle.Bottom := Bottom;
|
||||||
|
Rectangle.Width := Width;
|
||||||
|
Rectangle.Height := Height;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure test(c: qword);
|
||||||
|
begin
|
||||||
|
if c<>0 then
|
||||||
|
halt(2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
R, S : TRectangle;
|
||||||
|
begin
|
||||||
|
R := Rectangle(10, 20, 0, 50);
|
||||||
|
S := R.ScaleAround0(2);
|
||||||
|
if s.width<>0 then
|
||||||
|
halt(1);
|
||||||
|
|
||||||
|
test(R.ScaleAround0(2).Width);
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user