mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:09:11 +02:00
* patch by lag programming to replace bitcnt by popcnt, resolves #40962
This commit is contained in:
parent
a9f522c29d
commit
5d4bb6db9b
@ -5019,23 +5019,6 @@ implementation
|
||||
|
||||
hs1,hs2 : String;
|
||||
|
||||
function bitcnt(aValue: int64): integer;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
result := 0;
|
||||
|
||||
for i := 0 to 63 do
|
||||
begin
|
||||
if (aValue mod 2) = 1 then
|
||||
begin
|
||||
inc(result);
|
||||
end;
|
||||
|
||||
aValue := aValue shr 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
new(InsTabMemRefSizeInfoCache);
|
||||
FillChar(InsTabMemRefSizeInfoCache^,sizeof(TInsTabMemRefSizeInfoCache),0);
|
||||
@ -5322,7 +5305,7 @@ implementation
|
||||
OT_SHORT: ; // ignore
|
||||
else
|
||||
begin
|
||||
bitcount := bitcnt(actMemSize);
|
||||
bitcount := popcnt(qword(actMemSize));
|
||||
|
||||
if bitcount > 1 then MRefInfo := msiMultiple
|
||||
else InternalError(777203);
|
||||
|
@ -616,23 +616,6 @@ const
|
||||
ExistsCode337 : boolean;
|
||||
ExistsSSEAVXReg : boolean;
|
||||
|
||||
function bitcnt(aValue: int64): integer;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
result := 0;
|
||||
|
||||
for i := 0 to 63 do
|
||||
begin
|
||||
if (aValue mod 2) = 1 then
|
||||
begin
|
||||
inc(result);
|
||||
end;
|
||||
|
||||
aValue := aValue shr 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
new(InsTabMemRefSizeInfoCache);
|
||||
FillChar(InsTabMemRefSizeInfoCache^,sizeof(TInsTabMemRefSizeInfoCache),0);
|
||||
@ -920,7 +903,7 @@ const
|
||||
OT_SHORT: ; // ignore
|
||||
else
|
||||
begin
|
||||
bitcount := bitcnt(actMemSize);
|
||||
bitcount := popcnt(qword(actMemSize));
|
||||
|
||||
if bitcount > 1 then MRefInfo := msiMultiple
|
||||
else;
|
||||
|
Loading…
Reference in New Issue
Block a user