Hi Seenkao,
Just curious as to the type of App are you develping?
Excuse the text below, as am sure you are aware of it, but other people reading in future may not.
Normally the 'user' is not aware or even care about the cpu being used.
The developer will generally create various binaries for each platform the app supports, nowadays when you deploy the app as a package it will contain the binaries for which ever cpu(s) you support, to the user when installing the package the os will choose the app in the package that is for the cpu its running on. With Windows/Mac the installer will contain both X86-64 and Aarch64/M1 executables as a combined installer.
Each binary will be optimized for the architecture at compile time.
As the developer the ifdef are used generally to set any specific vars that defer between os/widgetset builds for your app to work/display properly, and to allow you to have a std function that return a value for the specific os.
ie pseudo code
function getmydocslocation:ansistring;
begin
{$ifdef windows}
result:=use windows api call to get value;
{$endif}
{$ifdef darwin}
result:=use macos apicall to get value;
{$endif}
end;
This is indeed what a lot of the lcl does for its controls, as most are wrappers around the os's native widgets or indeed specific widgetsets gtk2,3,qt etc.
I have myself a unit called my_standard_functions, which has obviously my own standard routines, but also contains other functions the set/get variables needed for other code, theses functions have various ifdef and nested ifdef to set get values. But makes the rest of my code much easier to read as other units do not contain ifdef, and if something changes i just alter my_standard_functions unit, then any app i have created i can just recompile as it will compile using the moded standard_functions unit.