Sign in Join
Wiki copytemporary

The code generator: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: The code generator

OldNewLine
1+back to contents [[FPC internals]]
2+
3+With the version 1.9.x of FPC the code generator has been completly rewritten to fit the needs of a compiler with multiple processor target support.
4+
5+## MM support
6+
7+The FPC code generator supports the usage of multimedia registers as they are implemented by modern processors.
8+
9+### The shuffle operand
10+
11+Most multimedia units support scalar as well as vector operations on the multimedia registers. To distinguish between these different operations, the mm methods of tcg take a so-called shuffle parameter. This parameter allows to specify how the data is processed when generating multimedia code.
12+
13+``` pascal
14+ pmmshuffle = ^tmmshuffle;
15+ { this record describes shuffle operations for mm operations; if a pointer a shuffle record
16+ passed to an mm operation is nil, it means that the whole location is moved }
17+ tmmshuffle = record
18+ { describes how many shuffles are actually described, if len=0 then
19+ moving the scalar with index 0 to the scalar with index 0 is meant }
20+ len : byte;
21+ { lower nibble of each entry of this array describes index of the source data index while
22+ the upper nibble describes the destination index }
23+ shuffles : array[1..1] of byte;
24+ end;
25+```
26+
27+---
28+*From the Free Pascal wiki, page "The code generator", as it stood on 2020-12-31 after a change by E-ric, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history