mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 18:49:49 +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/tw17986.pp svneol=native#text/pascal
|
||||
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/tw18075.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw18082.pp svneol=native#text/plain
|
||||
|
@ -391,8 +391,7 @@ interface
|
||||
if o.ref^.offset>0 then
|
||||
asmwrite('+');
|
||||
asmwrite(tostr(o.ref^.offset));
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
else
|
||||
internalerror(10001);
|
||||
@ -1183,7 +1182,7 @@ interface
|
||||
labelprefix : '..@';
|
||||
comment : '; ';
|
||||
);
|
||||
|
||||
|
||||
as_i386_nasmhaiku_info : tasminfo =
|
||||
(
|
||||
id : as_i386_nasmhaiku;
|
||||
|
@ -204,6 +204,11 @@ begin
|
||||
OS_32 : opsize:=S_IL;
|
||||
OS_64 : opsize:=S_IQ;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if size=OS_64 then
|
||||
opsize:=S_Q;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -233,7 +238,7 @@ begin
|
||||
not(opr.ref.refaddr in [addr_pic,addr_pic_no_got]) then
|
||||
begin
|
||||
if (opr.ref.symbol.name <> '_GLOBAL_OFFSET_TABLE_') then
|
||||
begin
|
||||
begin
|
||||
message(asmr_e_need_pic_ref);
|
||||
result:=false;
|
||||
end
|
||||
|
@ -1768,7 +1768,14 @@ Unit Rax86int;
|
||||
Message1(sym_e_unknown_id,expr);
|
||||
expr:='';
|
||||
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;
|
||||
|
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