Opened 2 years ago

Closed 12 months ago

#334 closed defect (fixed)

call.pl1 calculation for storage used by decimal(N) unaligned numbers is incorrect.

Reported by: Gary Dixon Owned by: Gary Dixon
Priority: major Milestone: MR12.9
Component: Tools Version: MR12.8
Keywords: Cc:

Description (last modified by Gary Dixon)

The Multics data types involving 4-bit decimal digits are selected by the PL/I Attributes:

  • real fixed decimal (N) unaligned: which selects data type 43: real_fix_dec_4bit_bytealigned_ls_dtype
  • real float decimal (N) unaligned: which selects data type 44: real_flt_dec_4bit_bytealigned_dtype

The calculation for storage used by this data type are made in the storage_for_pl1_dtype subroutine whose code resides in the call_dtype_fcns.incl.pl1 include segment. The existing calculations do not account for the requirement that stored scalar or array values of these data types must begin on a word boundary and occupy a full number of words. This is specified in the Multics Programmer's Reference Guide (AG91-04) Appendix D (page D-18), and was verified by array data descriptors created by the PL/I compiler for offset between adjacent array elements.

The proposed bug fix is shown by the following compare_ascii output.

cpa [lpn call_dtype_fcns.ip] ==

Inserted in B:
B10         3) change(2024-02-16,GDixon):
B11            Correct total words used to store fixed dec(N) unal  and  float dec(N) unal descriptor types:
B12            real_fix_dec_4bit_bytealigned_ls_dtype, and real_flt_dec_4bit_bytealigned_dtype.  These always
B13            begin on word-boundary and always occupy a full number of words of storage even though they are
B14            PL/I unaligned storage.  The unaligned attribute shifts from 9-bit to 4-bit digits.
Preceding:
A10                                                          END HISTORY COMMENTS */


A209      unalStoreSize (real_fix_dec_4bit_bytealigned_ls_dtype):     /* +2 for sign nibble + round up to full byte boundary.   */
A210                                                  call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0));
A211      unalStoreSize (real_flt_dec_4bit_bytealigned_dtype):        /* +2 for sign nibble + round up to full byte boundary.   */
A212                                                                  /*  +1 after divide for the binary exponent field.        */
A213                                                  call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0)+1);
Changed by B to:
B242      unalStoreSize (real_fix_dec_4bit_bytealigned_ls_dtype):     /* +1 for sign nibble + round up to end on word boundary. */
B243                                                  call st(BOUNDARY.Word,
B244                                                     divide( dsize + 1 +
B245                                                             (packed_digits_per_character * characters_per_word) - 1,
B246                                                             (packed_digits_per_character * characters_per_word), 24, 0);
B247      unalStoreSize (real_flt_dec_4bit_bytealigned_dtype):        /* +1 for sign nibble +2 for the binary exponent field    */
B248                                                                  /*    rounded up to full word boundary                    */
B249                                                  call st(BOUNDARY.Word,
B250                                                     divide( dsize + 3 +
B251                                                             (packed_digits_per_character * characters_per_word) - 1,
B252                                                             (packed_digits_per_character * characters_per_word), 24, 0);

Change History (3)

comment:1 by Gary Dixon, 2 years ago

Description: modified (diff)

comment:2 by Gary Dixon, 13 months ago

Owner: changed from Eric Swenson to Gary Dixon
Status: newaccepted

comment:3 by Eric Swenson, 12 months ago

Milestone: MR12.9
Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.