Compares of character fields of different lengths, and a repeated subfield value #642
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-ag-padded-fields-20261026"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Compares of character fields of different lengths, and a repeated subfield value
A compare of two character fields of N and N + R bytes (
blank3 <> high2,and
sub3 <> sub2of two subfields of one structure) compiles to builtin 17over N bytes, then a compare of the R bytes after them in the longer field
with blanks through a template, and a result of 1 when either differs. A
rule existed only for a based field against a literal, so the statement
stayed unresolved. The new value unit reads the two-field form and becomes
two loads, the compare and the store of its result. The compares of one
condition reuse the two work temporaries: the unit proves that it writes
them before it reads them and that nothing after it reads them first.
The source emitter takes the width of each end of such a compare
(
compareEnds), so a subfield that only a compare names gets itschar(W)declaration, and the end at byte 0 of a structure is thatsubfield, not the whole structure.
A character subfield whose initial value repeats one character is
inz(*all'c')when the module keeps no constant of those bytes:inz('ZZZ')keeps a constant 'ZZZ' beside the initial value of thestructure, and
inz(*all'Z')does not (measured by recompiling both).r5i-figurativeis the public reproduction; its emit round-trips to amatch.
Gates