IDE: separate processor types for i386 and x86_64 CPUs in compiler options.

git-svn-id: trunk@42763 -
This commit is contained in:
juha 2013-09-13 08:09:51 +00:00
parent 0381e3d330
commit db4ed9dfb7

View File

@ -84,40 +84,46 @@ begin
Result:=LowerCase(CPU); Result:=LowerCase(CPU);
end; end;
function ProcessorToCaption(const Processor: string): string; function ProcessorToCaption(const aProcessor: string): string;
// Special treatment for i386 CPUs, others go untouched
begin begin
if CompareText(Processor, '80386') = 0 then if aProcessor = '' then
Result := '('+lisDefault+')'
else if CompareText(aProcessor, '80386') = 0 then
Result := '386/486 (-Op80386)' Result := '386/486 (-Op80386)'
else if CompareText(Processor, 'pentium') = 0 then else if CompareText(aProcessor, 'pentium') = 0 then
Result := 'Pentium/Pentium MMX (-OpPENTIUM)' Result := 'Pentium/Pentium MMX (-OpPENTIUM)'
else if CompareText(Processor, 'pentium2') = 0 then else if CompareText(aProcessor, 'pentium2') = 0 then
Result := 'Pentium Pro/Pentium II/C6x86/K6 (-OpPENTIUM2)' Result := 'Pentium Pro/Pentium II/C6x86/K6 (-OpPENTIUM2)'
else if CompareText(Processor, 'pentium3') = 0 then else if CompareText(aProcessor, 'pentium3') = 0 then
Result := 'Pentium III (-OpPENTIUM3)' Result := 'Pentium III (-OpPENTIUM3)'
else if CompareText(Processor, 'pentium4') = 0 then else if CompareText(aProcessor, 'pentium4') = 0 then
Result := 'Pentium IV (-OpPENTIUM4)' Result := 'Pentium IV (-OpPENTIUM4)'
else if CompareText(Processor, 'pentiumm') = 0 then else if CompareText(aProcessor, 'pentiumm') = 0 then
Result := 'Pentium M (-OpPENTIUMM)' Result := 'Pentium M (-OpPENTIUMM)'
else else
Result := '(' + lisDefault + ')'; Result := aProcessor;
end; end;
function CaptionToProcessor(const Caption: string): string; function CaptionToProcessor(const aCaption: string): string;
// Special treatment for i386 CPUs, others go untouched
begin begin
if Pos('-Op80386', Caption) > 0 then if aCaption = '('+lisDefault+')' then
Result := ''
else if Pos('-Op80386', aCaption) > 0 then
Result := '80386' Result := '80386'
else if Pos('-OpPENTIUMM', Caption) > 0 then else if Pos('-OpPENTIUMM', aCaption) > 0 then
Result := 'pentiumm' Result := 'pentiumm'
else if Pos('-OpPENTIUM4', Caption) > 0 then else if Pos('-OpPENTIUM4', aCaption) > 0 then
Result := 'pentium4' Result := 'pentium4'
else if Pos('-OpPENTIUM3', Caption) > 0 then else if Pos('-OpPENTIUM3', aCaption) > 0 then
Result := 'pentium3' Result := 'pentium3'
else if Pos('-OpPENTIUM2', Caption) > 0 then else if Pos('-OpPENTIUM2', aCaption) > 0 then
Result := 'pentium2' Result := 'pentium2'
else if Pos('-OpPENTIUM', Caption) > 0 then else if Pos('-OpPENTIUM', aCaption) > 0 then
Result := 'pentium' Result := 'pentium'
else else
Result := ''; Result := aCaption;
end; end;
@ -197,18 +203,21 @@ procedure TCompilerConfigTargetFrame.UpdateByTargetCPU(aTargetCPU: string);
var var
IsIntel: Boolean; IsIntel: Boolean;
procedure IntelProcessor; procedure Intel_i386(aList: TStrings);
begin begin
IsIntel := True; IsIntel := True;
with TargetProcComboBox.Items do aList.Add(ProcessorToCaption('80386'));
begin aList.Add(ProcessorToCaption('Pentium'));
Add(ProcessorToCaption('80386')); aList.Add(ProcessorToCaption('Pentium2'));
Add(ProcessorToCaption('Pentium')); aList.Add(ProcessorToCaption('Pentium3'));
Add(ProcessorToCaption('Pentium2')); aList.Add(ProcessorToCaption('Pentium4'));
Add(ProcessorToCaption('Pentium3')); aList.Add(ProcessorToCaption('PentiumM'));
Add(ProcessorToCaption('Pentium4')); end;
Add(ProcessorToCaption('PentiumM'));
end; procedure Intel_x86_64(aList: TStrings);
begin
IsIntel := True;
aList.Add('ATHLON64');
end; end;
var var
@ -228,14 +237,14 @@ begin
// Update selection list for target processor // Update selection list for target processor
TargetProcComboBox.Clear; TargetProcComboBox.Clear;
TargetProcComboBox.Items.Add(ProcessorToCaption('')); TargetProcComboBox.Items.Add('('+lisDefault+')');
case aTargetCPU of case aTargetCPU of
'arm': begin end; 'arm': begin end;
'i386': IntelProcessor; 'i386': Intel_i386(TargetProcComboBox.Items);
'm68k': begin end; 'm68k': begin end;
'powerpc': begin end; 'powerpc': begin end;
'sparc': begin end; 'sparc': begin end;
'x86_64': IntelProcessor; 'x86_64': Intel_x86_64(TargetProcComboBox.Items);
'mipsel': begin end; 'mipsel': begin end;
'mips': begin end; 'mips': begin end;
'jvm': begin end; 'jvm': begin end;