mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 07:31:20 +02:00
* set register size correctly for popcnt(<byte>), resolves #37400
(cherry picked from commit ed158f1e52
)
# Conflicts:
# .gitattributes
This commit is contained in:
parent
b9090f9117
commit
055283f9cb
@ -1011,6 +1011,12 @@ implementation
|
||||
emit_reg_reg(A_POPCNT,TCGSize2OpSize[opsize],left.location.register,location.register)
|
||||
else
|
||||
emit_ref_reg(A_POPCNT,TCGSize2OpSize[opsize],left.location.reference,location.register);
|
||||
|
||||
if resultdef.size=1 then
|
||||
begin
|
||||
location.size:=OS_8;
|
||||
location.register:=cg.makeregsize(current_asmdata.CurrAsmList,location.register,location.size);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
12
tests/webtbs/tw37400.pp
Normal file
12
tests/webtbs/tw37400.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{ %cpu=i386,x86_64 }
|
||||
{ %opt=-Cpcoreavx2 }
|
||||
function popc ( a, b: byte):byte;
|
||||
var z,v: byte;
|
||||
begin
|
||||
z:=a+b;
|
||||
v:=popcnt(z); //-- this line
|
||||
popc:=v;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user