@@ -1,9 +1,17 @@
{ %CPU=i386,x86_64 }
{ %OPT=-O2 -CpCOREAVX }
+uses
+ cpu;
+
var
X: LongWord;
begin
+ if not popcntsupport then
+ begin
+ writeln('This CPU doesn''t support POPCNT instruction');
+ halt(0);
+ end;
for X := 0 to 9 do
if PopCnt(X) = 0 then
@@ -1,9 +1,16 @@
X, Y: LongWord;
Y := PopCnt(X);
@@ -17,4 +24,4 @@ begin
end;
WriteLn('ok');
-end.
+end.