ALU clause maximum size is 128 instructions.
Or less, if there are literals in the clause.
A pair of literals consumes 64 bits. The instruction words are formed from bundles of 64-bit codes and literals (up to four per bundle) are optional 6th and 7th 64-bit codes on VLIW-5 chips.
On VLIW-4 chips they would be optional 5th and 6th 64-bit codes.
So, for example, bundle 110 contains five opcodes and 4 literals. The four literals are coded as two 64-bit codes, making instruction 110 consist of seven 64-bit codes.
So a clause can consist of either a maximum of 128 64-bit codes, or 32 bundles (VLIW instructions).
Basically the VLIW format is variable in length, from one 64-bit code up to seven.
For Cayman, the newest chip, the VLIW architecture is 4 slots per instruction, so there's a maximum of six 64-bit codes in the case of 4 literals.
The clause's CNT number in brackets tells you how many 64-bit codes there are.
Thanks you for explaining bundle format.
I feel I should try to allcoate rest GPRs to constants to pack more instructions in clauses.
Regarding the question: why is clause 07 "short" and 08 is "long", one possible explanation is that 08 is the target of a JUMP instruction somewhere.
A JUMP always goes to the start of a clause.
So for example the end of clause 04 might evaluate a conditional expression. Clause 05 would consist of a JUMP instruction, which would skip over clauses 06 and 07. This is all my guess, but it is one explanation for the long-short-long construction of these 3 clauses.
Normally you'd see these clauses in long-long-short layout.
Another possibility has to do with the use of clause-temporary registers. In instruction 108 you can see a clause-temporary called T3.
Clause-temporary registers have a scope of a single clause. So T3 belongs to clause 06 and the value is lost once clause 06 has completed. T3 can be used again in clauses 07 and 08, but it initially has an undefined value in each of those clauses.
It's possible that the compiler has used clause temporaries in 08. To manage the scope (which is defined by the clause as a maximum of 128 64-bit codes or 32 bundles) the compiler had to choose a place to split the 133 64-bit codes (11 + 122 codes in clauses 07 and 08). The split is "early" and my guess is that T0, T1, T2 and T3 GPRs (or a subset, e.g. T0 and T1) are used in clause 08.
So, my second guess is that the compiler has chosen to use clause-temporary registers for some of the instructions in 08. The scope rule means that the compiler had to make a choice about the split point for 07 and 08. In this case the split is early.
What a excellent guess!
Actually, T2 and T3 were used through instruction 116 to 130. (Clause 08 is instruction 111 to 130.)
Very very thanks.