mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 15:58:28 +02:00
* handle variables without explicit size prefix better in inline assembler, resolves #18009
git-svn-id: trunk@16859 -
This commit is contained in:
parent
0a9fdb71e5
commit
e7fa076b70
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10941,6 +10941,7 @@ tests/webtbs/tw17957.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw1798.pp svneol=native#text/plain
|
tests/webtbs/tw1798.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw17986.pp svneol=native#text/pascal
|
tests/webtbs/tw17986.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw17998.pp svneol=native#text/plain
|
tests/webtbs/tw17998.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw18009.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw18013.pp svneol=native#text/plain
|
tests/webtbs/tw18013.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw18075.pp svneol=native#text/pascal
|
tests/webtbs/tw18075.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw18082.pp svneol=native#text/plain
|
tests/webtbs/tw18082.pp svneol=native#text/plain
|
||||||
|
@ -391,8 +391,7 @@ interface
|
|||||||
if o.ref^.offset>0 then
|
if o.ref^.offset>0 then
|
||||||
asmwrite('+');
|
asmwrite('+');
|
||||||
asmwrite(tostr(o.ref^.offset));
|
asmwrite(tostr(o.ref^.offset));
|
||||||
|
end;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
internalerror(10001);
|
internalerror(10001);
|
||||||
@ -1183,7 +1182,7 @@ interface
|
|||||||
labelprefix : '..@';
|
labelprefix : '..@';
|
||||||
comment : '; ';
|
comment : '; ';
|
||||||
);
|
);
|
||||||
|
|
||||||
as_i386_nasmhaiku_info : tasminfo =
|
as_i386_nasmhaiku_info : tasminfo =
|
||||||
(
|
(
|
||||||
id : as_i386_nasmhaiku;
|
id : as_i386_nasmhaiku;
|
||||||
|
@ -204,6 +204,11 @@ begin
|
|||||||
OS_32 : opsize:=S_IL;
|
OS_32 : opsize:=S_IL;
|
||||||
OS_64 : opsize:=S_IQ;
|
OS_64 : opsize:=S_IQ;
|
||||||
end;
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if size=OS_64 then
|
||||||
|
opsize:=S_Q;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -233,7 +238,7 @@ begin
|
|||||||
not(opr.ref.refaddr in [addr_pic,addr_pic_no_got]) then
|
not(opr.ref.refaddr in [addr_pic,addr_pic_no_got]) then
|
||||||
begin
|
begin
|
||||||
if (opr.ref.symbol.name <> '_GLOBAL_OFFSET_TABLE_') then
|
if (opr.ref.symbol.name <> '_GLOBAL_OFFSET_TABLE_') then
|
||||||
begin
|
begin
|
||||||
message(asmr_e_need_pic_ref);
|
message(asmr_e_need_pic_ref);
|
||||||
result:=false;
|
result:=false;
|
||||||
end
|
end
|
||||||
|
@ -1768,7 +1768,14 @@ Unit Rax86int;
|
|||||||
Message1(sym_e_unknown_id,expr);
|
Message1(sym_e_unknown_id,expr);
|
||||||
expr:='';
|
expr:='';
|
||||||
end;
|
end;
|
||||||
end;
|
{ indexed access to variable? }
|
||||||
|
if actasmtoken=AS_LBRACKET then
|
||||||
|
begin
|
||||||
|
{ ... then the operand size is not known anymore }
|
||||||
|
oper.size:=OS_NO;
|
||||||
|
BuildReference(oper);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
19
tests/webtbs/tw18009.pp
Normal file
19
tests/webtbs/tw18009.pp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ %CPU=i386 }
|
||||||
|
{ %TARGET=go32v2,win32,linux }
|
||||||
|
{ %NOTE=This test requires an installed Nasm }
|
||||||
|
|
||||||
|
{$ASMMODE INTEL}
|
||||||
|
var
|
||||||
|
q:qword;
|
||||||
|
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
paddb mm0,q
|
||||||
|
paddw mm0,q
|
||||||
|
paddd mm0,q
|
||||||
|
paddusb mm0,q
|
||||||
|
paddusw mm0,q
|
||||||
|
paddsb mm0,q
|
||||||
|
paddsw mm0,q
|
||||||
|
end;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user