Author: wmb Date: Fri Jun 1 20:33:29 2012 New Revision: 2996 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2996
Log: FCode tokenizer - removed the macro versions of */ and */mod, which do not work correctly (the intermediate result can overflow). If you need to use these functions in an FCode driver, use um* and um/mod to perform the calculations.
Modified: ofw/tokenizer/crosslis.fth
Modified: ofw/tokenizer/crosslis.fth ============================================================================== --- ofw/tokenizer/crosslis.fth Fri Jun 1 20:31:33 2012 (r2995) +++ ofw/tokenizer/crosslis.fth Fri Jun 1 20:33:29 2012 (r2996) @@ -140,8 +140,10 @@ : 2+ 2 + ; : 2- 2 - ; : <<a << ; -: */mod >r * r> /mod ; -: */ >r * r> / ; +\ These are not correct because the intermediate overflows. +\ If you need these functions, write them explicitly using um* and um/mod +\ : */mod >r * r> /mod ; +\ : */ >r * r> / ; : xu>l ( ux -- ul ) drop ; \ 64 -> 32 : lu>x ( ul -- ux ) 0 ; \ 32 -> 64