Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-11

Attn. Mattias, adding x86 CPU detection function to DefineTemplates.pas

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Maxim Ganetsky

Hello.

I am trying to solve
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 (Lazarus emits x86-specific assembler mode compiler option for non-x86 CPUs).

In order to solve it, I need to add the following function to DefineTemplates.pas:

function IsCPUX86(TargetCPU: string): boolean;
begin
   TargetCPU := GetFPCTargetCPU(TargetCPU);
   Result:=(TargetCPU='i8086') or (TargetCPU='i386') or
(TargetCPU='x86_64');
end;

The questions are:

1. Is it correct place?
2. Is its name OK?
3. Maybe I missed some existing function?

The complete patch is attached in the issue.

Best regards, Maxim Ganetsky mailto:

Reply by email

Mattias Gaertner
to Maxim Ganetsky
Maxim Ganetsky wrote 16 lines
Hello. I am trying to solve https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 (Lazarus emits x86-specific assembler mode compiler option for non-x86 CPUs). In order to solve it, I need to add the following function to DefineTemplates.pas: function IsCPUX86(TargetCPU: string): boolean; begin ? TargetCPU := GetFPCTargetCPU(TargetCPU); ? Result:=(TargetCPU='i8086') or (TargetCPU='i386') or (TargetCPU='x86_64'); end;

ok

Mattias

Reply by email

Maxim Ganetsky
to Mattias Gaertner

24.11.2023 0:55, Mattias Gaertner via lazarus ?????:

Show quoted text 21 lines
On 23.11.23 02:11, Maxim Ganetsky via lazarus wrote: > Hello. > > I am trying to solve > https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38786 > (Lazarus emits x86-specific assembler mode compiler option for non-x86 > CPUs). > > In order to solve it, I need to add the following function to > DefineTemplates.pas: > > function IsCPUX86(TargetCPU: string): boolean; > begin > ?? TargetCPU := GetFPCTargetCPU(TargetCPU); > ?? Result:=(TargetCPU='i8086') or (TargetCPU='i386') or > (TargetCPU='x86_64'); > end; ok

Cool, fixed in
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/7eb6be5a2cdbd9d57ac4adb71348701f9139e709

and merged to `fixes_3_0`.

Best regards, Maxim Ganetsky mailto:

Reply by email