[OpenBIOS] [RFC 2/3] ppc64: Switch to 64-bit cell size
tarl-b2 at tarl.net
Sat May 28 20:49:15 CEST 2011
On 2011-May-28 14:30 , Segher Boessenkool wrote:
>> If I recall correctly what I said, the device-tree property cell size
>> is _always_ 32-bit, regardless of what the internal cell size is.
> Don't call that "cell size" :-) The OF standard calls it "a 32-bit
> as encoded by encode-int".
There are places where 1275 refers to "cells" in the properties, where
it _means_ 32-bit quantities. It's an unfortunate terminology problem.
>> - The cell size presented to FCode version 2 drivers (plug-in cards),
>> which is emulated to be 32 bits.
> Do you mean the size of (lit) here? That's 32-bit signed always,
> yes. The
> FCode cell size is the same as the Forth cell size. Most FCode programs
> written for 32-bit systems work as-is on 64-bit systems; some need some
> fixes. Programs that need 64-bit numbers (for example, for devices that
> have 64-bit registers) need some careful coding.
The FCode version 2 interpreter on SPARCs emulates 32-bit FCode by
making various operations 32-bit specific. E.g., "0<>" tests only the
low-order 32 bits of a cell. The intent was to ensure that 32-bit FCode
programs did _not_ need fixes (because we couldn't afford the hassle of
forcing everyone to fix them). That has resulted in considerable pain
over the years as FCode programs and Forth don't always run the same.
When doing the iSCSI work and porting the SHA-1 algorithm from FCode to
Forth, for example, I found a lot of code that _knew_ it was running on
32-bit and had to be fixed to run in 64-bit conditions.
More information about the OpenBIOS