Date: Tue, 2 Jul 1996 20:42:05 -0700 From: dmk@uask4it-223 (David Kahn) Subject: Item #370: 64-bit Extensions: FCode32 Compatibility P1275 OpenFirmware Working Group Proposal -- Proposal #:370 Ver 1 Title: 64-Bit Extensions: Fcode32 Compatibility Author: David Kahn Date: 2 July 1996 Ed/Tech: Technical Synopsis: Extend IEEE p1275.6 to allow for 32 bit FCode compatibility. Doc & Version: 64 Bit Extensions, p1275.6/D5 Problem: The 64 bit extensions supplement needs to deal with compatibility for the existing wealth of 32 bit FCode. Draft 5 largely ignored the unfortunate fact that many existing FCode programs will not work without assistance in a 64 bit cell-sized environment. The reasons are varied; sometimes the FCode programs have incorrect assumptions that the cell size is 4; other cases are that simply sign-extending or zero-extending 32 bit values won't work. Proposal: Create a basic 32 bit environment for FCode, but allow for 64 bit register operations using lxjoin xlsplit (and similar words) with rx! and rx@ for the few devices in the future that may depend on a 64 bit environment. -------- Create a new section 6 in the document with the following text: 6. FCode Environment Since existing FCode is written for a 32 bit environment, The FCode interpreter for 64 bit systems must provide a 32-bit clean environment to allow existing 32-bit FCode to work. The following FCode's have special semantics in 64-bit environments. The semantics are modified as noted below in the following table. Note that the FCode implementation does not affect any other interface, thus the existing semantics in the user interface are unchanged. New Definitions: These definitions extend the definitions in Section A.1.2.2 in the Core specification: l-addr: a 32-bit address, normalized by the implementation. The implementation shall ignore the most-significant 32-bits of the address. l-qaddr: a quad-aligned 32-bit address, normalized by the implementation. The implementation shall ignore the most-significant 32-bits of the address. l-waddr: a doublet-aligned 32-bit address, normalized by the implementation. The implementation shall ignore the most-significant 32-bits of the address. lval, lvalxyz: a quadlet, normalized by the implementation. (arbitrary number) The stack item is an arbitrary 32-bit value. The most significant 32-bits of the stack item are ignored. ln, lnxyz: a quadlet, sign-extended by the implementation. The stack item is a signed 32-bit value, the most significant 32-bits of the stack item are ignored. ul, ulxyz: Unsigned arbitrary quadlet; the implementation shall ignore the most-significant 32-bits of the value. The stack item is an unsigned 32-bit number. (Ed note: Where the 'interpret as' refers to an existing definition, no stack diagram is shown. The document will include short descriptions of each item. For the "interpret as" column, names not given in the standard will either be defined in the document, or not used in the description.) FCode Interpret as: Stack Diagram: ===== ============= ============== , l, Core Definition Applies. /n /l Core Definition Applies. na+ la+ Core Definition Applies. cell+ la1+ Core Definition Applies. cells /l* Core Definition Applies. +! l+! ( nu l-addr -- ) >>a l>>a ( q1 u -- q2 ) rshift lrshift ( q1 u -- q2 ) b?branch lb?branch ( ln-dont-branch? -- ) ( F: /Fcode-offset32/ -- ) b(of) lb(of) ( ln-sel ln-of-val -- sel| ) ( F: /Fcode-offset32/ -- ) b(do) lb(do) ( ln-limit ln-start -- ) ( F: /Fcode-offset32/ -- ) b(?do) lb(?do) ( ln-limit ln-start -- ) ( F: /Fcode-offset32/ -- ) b(+loop) lb(+loop) ( ln-delta -- ) ( F: /Fcode-offset32/ -- ) 0= l0= ( lval | flag -- equal-to-0? ) 0<> l0<> ( lval -- not-equal-to-0? ) 0< l0< ( lval -- less-than-0? ) 0<= l0<= ( lval -- less-or-eq-to-0? ) 0> l0> ( lval -- greater-than-0? ) 0>= l0>= ( lval -- gt-or-eq-to-0? ) < l< ( lval1 lval2 -- less? ) > l> ( lval1 lval2 -- greater? ) = l= ( lval1 lval2 -- equal? ) <> l<> ( lval1 lval2 -- not-equal? ) >= l>= ( lval1 lval2 -- gt-or-eq? ) <= l<= ( lval1 lval2 -- lt-ot-eq? ) u> lu> ( ul1 ul2 -- unsigned-gt? ) u<= lu<= ( ul1 ul2 -- unsigned-lt-or-eq? ) u< lu< ( ul1 ul2 -- unsigned-less? ) u>= lu>= ( ul1 ul2 -- unsigned-gt-or-eq? ) between l-between ( lval min max -- min<=lval<=max?) within l-within ( lval min max -- min<=lval