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