Author: wmb
Date: Fri Jun 1 20:57:38 2012
New Revision: 2997
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2997
Log:
OLPC - use a different commit id for the NANDblaster code, fixing a build dependency problem introduced by the name change from start.s to start.S in the x86 directory of the client library.
Modified:
cpu/arm/olpc/1.75/mcnand-version.fth
cpu/x86/pc/olpc/versions.fth
cpu/x86/pc/olpc/via/mcnand-version.fth
Modified: cpu/arm/olpc/1.75/mcnand-version.fth
==============================================================================
--- cpu/arm/olpc/1.75/mcnand-version.fth Fri Jun 1 20:33:29 2012 (r2996)
+++ cpu/arm/olpc/1.75/mcnand-version.fth Fri Jun 1 20:57:38 2012 (r2997)
@@ -3,6 +3,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION 732fc96
+macro: MCNAND_VERSION e9c0662
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD
Modified: cpu/x86/pc/olpc/versions.fth
==============================================================================
--- cpu/x86/pc/olpc/versions.fth Fri Jun 1 20:33:29 2012 (r2996)
+++ cpu/x86/pc/olpc/versions.fth Fri Jun 1 20:57:38 2012 (r2997)
@@ -2,7 +2,7 @@
\ The overall firmware revision
macro: FW_MAJOR F
-macro: FW_MINOR 11
+macro: FW_MINOR 11ma
\ The EC microcode
macro: EC_VERSION 1_2_1
@@ -26,6 +26,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION 732fc96
+macro: MCNAND_VERSION e9c0662
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD
Modified: cpu/x86/pc/olpc/via/mcnand-version.fth
==============================================================================
--- cpu/x86/pc/olpc/via/mcnand-version.fth Fri Jun 1 20:33:29 2012 (r2996)
+++ cpu/x86/pc/olpc/via/mcnand-version.fth Fri Jun 1 20:57:38 2012 (r2997)
@@ -3,6 +3,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION 732fc96
+macro: MCNAND_VERSION e9c0662
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD
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
Author: wmb
Date: Fri Jun 1 20:31:33 2012
New Revision: 2995
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2995
Log:
isin.fth - before svn 2994, the calculation in set-period was using */, which is supposed to use a double-precision intermediate value to avoid overflow. However, */ is not a primitive FCode, so the FCode tokenizer was synthesizing it (incorrectly) using (overflowing) * and /. The correct fix, to retain precision, is to implement "u*/" using (double-precision) um* and um/mod .
Modified:
forth/lib/isin.fth
Modified: forth/lib/isin.fth
==============================================================================
--- forth/lib/isin.fth Fri Jun 1 14:21:35 2012 (r2994)
+++ forth/lib/isin.fth Fri Jun 1 20:31:33 2012 (r2995)
@@ -27,17 +27,17 @@
2/ dup to #cycle/2
2/ to #cycle/4
;
+: u*/ ( u1 unum udenom -- u2 ) >r um* r> um/mod nip ;
: set-period ( cycle/4 -- )
dup to #cycle/4 ( cycle/4 )
2* dup to #cycle/2 ( cycle/2 )
2* dup to #cycle ( cycle )
fs over / to freq ( period )
- pi swap / fs * to fstep ( )
+ pi fs rot u*/ to fstep ( )
;
\ Multiply two fractional numbers where the scale factor is 2^15
-\ : times ( n1 n2 -- n3 ) d# 32767 */ ; \ Insignificantly more accurate, but slower
-: times ( n1 n2 -- n3 ) * d# 15 rshift ;
+: times ( n1 n2 -- n3 ) d# 32767 u*/ ;
\ Computes (1 - (theta^2 / divisor) * last)
: sin-step ( last divisor -- next ) thetasq swap / times one min one swap - ;
@@ -48,7 +48,7 @@
\ 1 - (t^2/(1*2)) * (1 - (t^2/(3*4)) * (1 - (t^2/(5*6)) * (1 - (t^2/(7*8))))
: icos ( index -- frac )
- fstep fs 2/ */ to theta
+ fstep fs 2/ u*/ to theta
theta dup times to thetasq
one d# 90 cos-step d# 56 cos-step d# 30 cos-step d# 12 cos-step 2 cos-step one min
;
@@ -59,7 +59,7 @@
\ theta * (1 - (theta^2/(2*3)) * (1 - (theta^2/(4*5)) * (1 - (theta^2/(6*7)) * (1 - (theta^2/(8*9))))))
\ This is good for the first quadrant only, i.e. 0 <= index <= fs / freq / 4
: calc-sin ( index -- frac )
- fstep fs 2/ */ to theta
+ fstep fs 2/ u*/ to theta
theta dup times to thetasq
one d# 72 sin-step d# 42 sin-step d# 20 sin-step 6 sin-step theta times one min
;