mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
* fixed size of movzx/movsx with 64bit operand in x86-64 Intel asm reader
git-svn-id: trunk@23131 -
This commit is contained in:
parent
14b1c8a99c
commit
d180d6f241
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9730,6 +9730,7 @@ tests/tbs/tb0583a.pp svneol=native#text/plain
|
||||
tests/tbs/tb0584.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0585.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0586.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0587.pp svneol=native#text/plain
|
||||
tests/tbs/tb205.pp svneol=native#text/plain
|
||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||
|
@ -789,6 +789,10 @@ begin
|
||||
case tx86operand(operands[2]).opsize of
|
||||
S_L :
|
||||
opsize:=S_WL;
|
||||
{$ifdef x86_64}
|
||||
S_Q :
|
||||
opsize:=S_WQ;
|
||||
{$endif}
|
||||
end;
|
||||
S_B :
|
||||
begin
|
||||
@ -797,6 +801,10 @@ begin
|
||||
opsize:=S_BW;
|
||||
S_L :
|
||||
opsize:=S_BL;
|
||||
{$ifdef x86_64}
|
||||
S_Q :
|
||||
opsize:=S_BQ;
|
||||
{$endif}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
29
tests/tbs/tb0587.pp
Normal file
29
tests/tbs/tb0587.pp
Normal file
@ -0,0 +1,29 @@
|
||||
{ %cpu=x86_64 }
|
||||
{ %opt=-Aas }
|
||||
|
||||
{$asmmode intel}
|
||||
|
||||
procedure test;
|
||||
var
|
||||
i1,i2: int64;
|
||||
b: shortint;
|
||||
begin
|
||||
b:=-128;
|
||||
asm
|
||||
movsx rax, b
|
||||
mov i1,rax
|
||||
movzx rax, b
|
||||
mov i2,rax
|
||||
end ['rax'];
|
||||
if i1<>-128 then
|
||||
halt(1);
|
||||
if i2<>byte(-128) then
|
||||
halt(2);
|
||||
end;
|
||||
|
||||
begin
|
||||
test
|
||||
end.
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user