New x86 and ARM CodeGen

From Axel Public Wiki
Jump to navigation Jump to search

From LogicLab 5.20.0.x, two new code generators for x86 and ARM (that includes ARM32 and Thumb2) architectures have been introduced; their corresponding DLL files are LLCGX86_32bits.DLL and LLCGARM_32bits.DLL

They have a more modern internal architecture and more code in common with other newer code generators, because they internally implement a common "abstract code generator" interface of LogicLab.

In the mid/long term they will replace and make obsolete the older two corresponding code generators (LLCGX86.DLL and LLCGARM.DLL).

Most of the new features will be developed exclusively for these two new versions, while the two older ones will only receive maintenance and bug fixes.


When a new 5.20.0.x or newer is adopted, if a change in the compilation result (in terms of warnings, errors, and maybe generated code) is acceptable for the customer, it is possible to just switch to the newer code generator by editing the LogicLab5\LLExtConfig.xml file, by changing from

<processor name="x86" dll="LLCGX86.dll"/>
<processor name="ARM32" dll="LLCGARM.dll" init="0"/> 	
<processor name="ARM..." dll="LLCGARM.dll" init="..."/>

to

<processor name="x86" dll="LLCGX86_32bits.dll"/>
<processor name="ARM32" dll="LLCGARM_32bits.dll" init="0"/> 	
<processor name="ARM..." dll="LLCGARM_32bits.dll" init="..."/>


Otherwise, if keeping the old behaviour of the old code generators is desiderable (to keep compatibility with existing applications and so on), is it possible to keep the old and the new ones together, by adding to LLExtConfig.xml

<processor name="x86#absCG" dll="LLCGX86_32bits.dll"/>
<processor name="ARM32#absCG" dll="LLCGARM_32bits.dll" init="0"/> 	
<processor name="ARM...#absCG" dll="LLCGARM_32bits.dll" init="..."/>

and then, when a new target version is added in the catalog, edit its .TGTX file and specify x86#absCG or ARM32#absCG instead of the old x86 or ARM32; for example change from

<resource name="LLEXECPLC" processor="x86">

to

<resource name="LLEXECPLC" processor="x86#absCG">

In this way, existing targets and applications will use old code generators, and newer targets and applications only will use the new code generators instead.


IMPORTANT: remember to add the new LLCGX86_32bits.dll and/or LLCGARM_32bits.dll to your ISS setup script, if not already present.