+ - can be used to remove options from a cpu capability switch

This commit is contained in:
florian 2021-11-30 22:27:50 +01:00
parent e422743841
commit 60623f39a1

View File

@ -1373,10 +1373,11 @@ var
more : TCmdStr;
major,minor : longint;
error : integer;
j,l : longint;
j,l , deletepos: longint;
d,s : TCmdStr;
hs : TCmdStr;
unicodemapping : punicodemap;
includecapability: Boolean;
{$ifdef llvm}
disable: boolean;
{$endif}
@ -1707,8 +1708,9 @@ begin
begin
s:=upper(copy(more,j+1,length(more)-j));
{$ifdef cpucapabilities}
if pos('+',s)<>0 then
if (pos('+',s)<>0) or (pos('-',s)<>0) then
begin
deletepos:=min(pos('+',s),pos('-',s));
extrasettings:=Copy(s,Pos('+',s),Length(s));
Delete(s,Pos('+',s),Length(s));
end
@ -1721,11 +1723,18 @@ begin
while extrasettings<>'' do
begin
Delete(extrasettings,1,1);
includecapability:=true;
if Pos('+',extrasettings)<>0 then
begin
s:=Copy(extrasettings,1,Pos('+',extrasettings)-1);
Delete(extrasettings,1,Pos('+',extrasettings)-1);
end
else if Pos('-',extrasettings)<>0 then
begin
s:=Copy(extrasettings,1,Pos('+',extrasettings)-1);
Delete(extrasettings,1,Pos('+',extrasettings)-1);
includecapability:=false;
end
else
begin
s:=extrasettings;
@ -1742,7 +1751,10 @@ begin
Internalerror(2021110601);
if s=cpuflagsstr then
begin
Include(cpu_capabilities[init_settings.cputype],cf);
if includecapability then
Include(cpu_capabilities[init_settings.cputype],cf)
else
Exclude(cpu_capabilities[init_settings.cputype],cf);
s:='';
break;
end;