remove the -dontsplitarrays compiler option

it was still there for backward compatibility reasons with really old prog8 code. If you need a word array to be not split, just use @nosplit on the array.
This commit is contained in:
Irmen de Jong
2025-10-05 14:44:17 +02:00
parent 4195e3968a
commit 3e1386a987
12 changed files with 13 additions and 51 deletions

View File

@@ -162,10 +162,6 @@ One or more .p8 module files
Add this user-defined symbol directly to the beginning of the generated assembly file.
Can be repeated to define multiple symbols.
``-dontsplitarrays``
Treat all word arrays as tagged with @nosplit so they are all stored linearly in memory,
instead of splitting them in separate lsb and msb arrays.
``-dumpsymbols``
print a dump of the variable declarations and subroutine signatures

View File

@@ -73,7 +73,7 @@ So the syntax for declaring typed pointers looks like this:
``^^type[size]``: array with size size containing pointers to a type.
So for example; ``^^word[100] values`` declares values to be an array of 100 pointers to words.
Note that an array of pointers (regardless of the type they point to) is always a @split word array at this time.
Note that an array of pointers (regardless of the type they point to) is always a split word array.
(this is the most efficient way to access the pointers, and they need to be copied to zeropage first to
be able to use them anyway. It also allows for arrays of up to 256 pointers instead of 128.)

View File

@@ -1,6 +1,10 @@
TODO
====
remove "@split" tag SplitWish.NOSPLIT
LONG TYPE
---------
- implement the other comparison operators (<,>,<=,>=) on longs
@@ -94,7 +98,7 @@ IR/VM
- idea: (but LLVM IR simply keeps the variables, so not a good idea then?...): replace all scalar variables by an allocated register. Keep a table of the variable to register mapping (including the datatype)
global initialization values are simply a list of LOAD instructions.
Variables replaced include all subroutine parameters? Or not? So the only variables that remain as variables are arrays and strings.
- the @split arrays are currently also split in _lsb/_msb arrays in the IR, and operations take multiple (byte) instructions that may lead to verbose and slow operation and machine code generation down the line.
- the split word arrays are currently also split in _lsb/_msb arrays in the IR, and operations take multiple (byte) instructions that may lead to verbose and slow operation and machine code generation down the line.
maybe another representation is needed once actual codegeneration is done from the IR...? Should array operations be encoded in a more high level form in the IR?
- ExpressionCodeResult: get rid of the separation between single result register and multiple result registers? maybe not, this requires hundreds of lines to change.. :(
- sometimes source lines end up missing in the output p8ir, for example the first assignment is gone in:

View File

@@ -366,14 +366,9 @@ For normal prog8 array indexing, the compiler takes care of the distiction for y
*But for assembly code, or code that otherwise accesses the array elements directly, you have to be aware of the distinction from 'normal' arrays.*
In the assembly code, the array is generated as two byte arrays namely ``name_lsb`` and ``name_msb``, immediately following eachother in memory.
The ``@split`` tag can be added to the variable declaration to *always* split the array even when the command line option -dontsplitarrays is set
The ``@nosplit`` tag can be added to the variable declaration to *never* split the array. This is useful for compatibility with
code that expects the words to be sequentially in memory (such as the cx16.FB_set_palette routine).
There is a command line option ``-dontsplitarrays`` that avoids splitting word arrays by default,
so every word array is layed out sequentially in memory (this is what older versions of Prog8 used to do).immediately
It reduces the maximum word array length to 128. You can still override this by adding ``@split`` explicitly.
.. note::
Most but not all array operations are supported yet on "split word arrays".
If you get a compiler error message, simply revert to a regular sequential word array using ``@nosplit``,