View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000432 | mercury | Feature Request | public | 2017-03-21 13:12 | 2018-02-22 14:06 | ||||||||
Reporter | wangp | ||||||||||||
Assigned To | zs | ||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | assigned | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000432: pack constructor arguments in same word as primary tag | ||||||||||||
Description | When we have a data constructor with a primary tag, whose arguments have a total width less than or equal to the number of remaining bits, we could pack the arguments into the same word as the tag instead of a separate cell. e.g. :- type bits_or_string ---> bits(bool, bool, bool) ; string(string). This would be more useful once we have smaller-than-word-size ints. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
zs (developer) 2017-03-21 15:48 |
That is a good idea. Actually, it could also be applied to secondary tags. If a type has enough non-constant functors to need a secondary tag for some functors, then at the moment, we allocate the entire first word of the memory cells of those functors to the secondary tag. However, we could allocate only the minimum number of secondary tag bits needed to distinguish those functors, and allocate the rest to hold the packable arguments of those functors. However, I expect this would be useful much more rarely than Peter's original proposal. |