| Author |
Message |
Guest
|
Posted:
Tue Oct 25, 2005 5:44 am Post subject:
"Introduction to MMIX" bug confirmation request |
|
|
Knuth writes on the third page of
http://mbox.informatik.fh-muenchen.de/mmixmb/mmix-doc.pdf
"The virtual memory of MMIX is an array M of 2^64 bytes. If k is any
unsigned octabyte, M[k] is a 1-byte quantity... We use the notation
M_(2^t)[k] to stand for a number consisting of 2^t consecutive bytes
starting at location k LOGICAL_AND (2^64 - 2^t). (The notation
k LOGICAL_AND (2^64 - 2^t) means that the least significant t bits of
k are set to 0, and only the least 64 bits of the resulting address are
retained. Similarly, the notation k LOGICAL_OR (2^t - 1) means that
the least significant t bits of k are set to 1.)" [Formatting adjusted
to pure ASCII, with "^" used for exponentiation.]
The apparent bug is that "least 64 bits of the resulting address"
should be "most significant 64-t bits of the resulting address". Can
anyone confirm? |
|
| Back to top |
|
 |
David Hopwood
Guest
|
Posted:
Tue Oct 25, 2005 8:15 am Post subject:
Re: "Introduction to MMIX" bug confirmation request |
|
|
andrewspencers@yahoo.com wrote:
| Quote: | Knuth writes on the third page of
http://mbox.informatik.fh-muenchen.de/mmixmb/mmix-doc.pdf
"The virtual memory of MMIX is an array M of 2^64 bytes. If k is any
unsigned octabyte, M[k] is a 1-byte quantity... We use the notation
M_(2^t)[k] to stand for a number consisting of 2^t consecutive bytes
starting at location k LOGICAL_AND (2^64 - 2^t). (The notation
k LOGICAL_AND (2^64 - 2^t) means that the least significant t bits of
k are set to 0, and only the least 64 bits of the resulting address are
retained. Similarly, the notation k LOGICAL_OR (2^t - 1) means that
the least significant t bits of k are set to 1.)" [Formatting adjusted
to pure ASCII, with "^" used for exponentiation.]
The apparent bug is that "least 64 bits of the resulting address"
should be "most significant 64-t bits of the resulting address". Can
anyone confirm?
|
The original is clearly incorrect. However "most significant 64-t bits"
is ambiguous since the MSB of the address is not necessarily bit 63,
if it is interpreted as an integer. I would just delete ", and only the
least 64 bits of the resulting address are retained."
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk> |
|
| Back to top |
|
 |
Guest
|
Posted:
Wed Oct 26, 2005 12:15 am Post subject:
Re: "Introduction to MMIX" bug confirmation request |
|
|
David Hopwood wrote:
| Quote: | The original is clearly incorrect. However "most significant 64-t bits"
is ambiguous since the MSB of the address is not necessarily bit 63,
if it is interpreted as an integer.
Did you actually mean "...if it [the address] is interpreted as a |
signed integer"? If not, then what did you mean? |
|
| Back to top |
|
 |
David Brown
Guest
|
Posted:
Wed Oct 26, 2005 3:51 pm Post subject:
Re: "Introduction to MMIX" bug confirmation request |
|
|
andrewspencers@yahoo.com wrote:
| Quote: | Knuth writes on the third page of
http://mbox.informatik.fh-muenchen.de/mmixmb/mmix-doc.pdf
"The virtual memory of MMIX is an array M of 2^64 bytes. If k is any
unsigned octabyte, M[k] is a 1-byte quantity... We use the notation
M_(2^t)[k] to stand for a number consisting of 2^t consecutive bytes
starting at location k LOGICAL_AND (2^64 - 2^t). (The notation
k LOGICAL_AND (2^64 - 2^t) means that the least significant t bits of
k are set to 0, and only the least 64 bits of the resulting address are
retained. Similarly, the notation k LOGICAL_OR (2^t - 1) means that
the least significant t bits of k are set to 1.)" [Formatting adjusted
to pure ASCII, with "^" used for exponentiation.]
The apparent bug is that "least 64 bits of the resulting address"
should be "most significant 64-t bits of the resulting address". Can
anyone confirm?
|
As far as I can see, there is no error. The expression given zeros out
the lowest t bits, and also all bits higher than 64 - thus it returns
the "least 64 bits of the resulting address". Your suggested "most
significant 64-t bits of the resulting address" would clearly be wrong
if the original address were larger than 64 bits, and even if it were
not, it would get the alignment wrong. As an example, using 16 instead
of 64 bits for compactness, if k = 0x0103 and t = 4, then the correct
address is 0x0100 while the "most significant 16-t bits" is 0x010. |
|
| Back to top |
|
 |
David Hopwood
Guest
|
Posted:
Fri Oct 28, 2005 12:15 am Post subject:
Re: "Introduction to MMIX" bug confirmation request |
|
|
andrewspencers@yahoo.com wrote:
| Quote: | David Hopwood wrote:
The original is clearly incorrect.
|
Actually it's not, as David Brown pointed out.
| Quote: | However "most significant 64-t bits"
is ambiguous since the MSB of the address is not necessarily bit 63,
if it is interpreted as an integer.
Did you actually mean "...if it [the address] is interpreted as a
signed integer"? If not, then what did you mean?
|
That the most significant *set* bit of the address is not necessarily
bit 63. But never mind; David Brown's post got it right.
--
David Hopwood <david.nospam.hopwood@blueyonder.co.uk> |
|
| Back to top |
|
 |
|
|
|
|