2018-11-18 00:15 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000451mercuryFeature Requestpublic2018-06-08 22:19
Reporterzs 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityN/A
StatusassignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000451: unpack packed args only as necessary in field updates
DescriptionGiven a type such as

:- type thing
    ---> thing(bool, bool, int, bool, bool, t6 :: bool),

and two variables A and B of this type, the field update
unification B = A ^ t6 := ... now gets compiled to code that
picks up the value of every argument of A, except possibly
the one being replaced, and puts them one-by-one into
the newly allocated memory cell. Since the adjacent bools
are packed into one word, the first of those steps requires
using shifts and masks to unpack all of arguments 1, 2, 4 and 5,
operations that the second step then reverses.

In the common situation where the code following the field update
does not look at the fields that were not updated, we should be able
to generate code that picks up the first word of A as a complete entity
and assigns it to the first word of B. For the third word, part of which is
being replaced, it should still be possible to pick up the value of the
4th and 5th argument as a unit, and shift and OR it together with the
new value of the 6th field *without* separating the 4th and 5th from each
other.
Additional InformationThis probably needs to be done during code generation, because
a post-code-generation optimization pass would have no way of knowing
that the values of the padding bits don't matter.
TagsNo tags attached.
Attached Files
  • ? file icon y.m (788 bytes) 2018-02-20 16:41

-Relationships
+Relationships

-Notes

~0001000

zs (developer)

Implemented for hlc grades in a diff committed on 2018 June 2.

Not yet implemented for LLDS grades.
+Notes

-Issue History
Date Modified Username Field Change
2018-02-20 16:41 zs New Issue
2018-02-20 16:41 zs Status new => assigned
2018-02-20 16:41 zs Assigned To => zs
2018-02-20 16:41 zs File Added: y.m
2018-06-08 22:19 zs Note Added: 0001000
+Issue History