--- gforth/prim 2000/08/11 19:49:39 1.53 +++ gforth/prim 2000/08/14 19:15:53 1.54 @@ -2261,7 +2261,9 @@ c_addr=newline; u=sizeof(newline); : "newline count ; -Create "newline 1 c, \$0A c, +Create "newline e? crlf [IF] 2 c, \$0D c, [ELSE] 1 c, [THEN] \$0A c, + +\+os utime ( -- dtime ) gforth ""Report the current time in microseconds since some epoch."" @@ -2287,6 +2289,10 @@ duser = timeval2us(&time1); dsystem = (DCell)0; #endif +\+ + +\+floating + v* ( f_addr1 nstride1 f_addr2 nstride2 ucount -- r ) gforth v_star ""dot-product: r=v1*v2. The first element of v1 is at f_addr1, the next at f_addr1+nstride1 and so on (similar for v2). Both vectors have @@ -2296,6 +2302,10 @@ for (r=0.; ucount>0; ucount--) { f_addr1 = (Float *)(((Address)f_addr1)+nstride1); f_addr2 = (Float *)(((Address)f_addr2)+nstride2); } +: + >r swap 2swap swap 0e r> 0 ?DO + dup f@ over + 2swap dup f@ f* f+ over + 2swap + LOOP 2drop 2drop ; faxpy ( ra f_x nstridex f_y nstridey ucount -- ) gforth ""vy=ra*vx+vy"" @@ -2304,3 +2314,9 @@ for (; ucount>0; ucount--) { f_x = (Float *)(((Address)f_x)+nstridex); f_y = (Float *)(((Address)f_y)+nstridey); } +: + >r swap 2swap swap r> 0 ?DO + fdup dup f@ f* over + 2swap dup f@ f+ dup f! over + 2swap + LOOP 2drop 2drop fdrop ; + +\+