### Diff for /gforth/prim between versions 1.148 and 1.151

version 1.148, 2003/11/06 09:47:49 version 1.151, 2004/03/29 11:23:01
Line 249  execute ( xt -- )  core Line 249  execute ( xt -- )  core
#ifndef NO_IP  #ifndef NO_IP
ip=IP;  ip=IP;
#endif  #endif
IF_spTOS(spTOS = sp[0]);  IF_spTOS(spTOS = sp[0]); /* inst_tail would produce a NEXT_P1 */
SUPER_END;  SUPER_END;
EXEC(xt);  EXEC(xt);

Line 259  perform ( a_addr -- ) gforth Line 259  perform ( a_addr -- ) gforth
#ifndef NO_IP  #ifndef NO_IP
ip=IP;  ip=IP;
#endif  #endif
IF_spTOS(spTOS = sp[0]);  IF_spTOS(spTOS = sp[0]); /* inst_tail would produce a NEXT_P1 */
SUPER_END;  SUPER_END;
:  :
Line 433  condbranch((+loop),n R:nlimit R:n1 -- R: Line 433  condbranch((+loop),n R:nlimit R:n1 -- R:
/* dependent upon two's complement arithmetic */  /* dependent upon two's complement arithmetic */
Cell olddiff = n1-nlimit;  Cell olddiff = n1-nlimit;
n2=n1+n;          n2=n1+n;
,if ((olddiff^(olddiff+n))>=0   /* the limit is not crossed */  ,if (((olddiff^(olddiff+n))    /* the limit is not crossed */
|| (olddiff^n)>=0          /* it is a wrap-around effect */) {       &(olddiff^n))             /* OR it is a wrap-around effect */
>=0) { /* & is used to avoid having two branches for gforth-native */
,:  ,:
r> swap   r> swap
r> r> 2dup - >r   r> r> 2dup - >r
Line 463  if (n<0) { Line 464  if (n<0) {
newdiff = -newdiff;      newdiff = -newdiff;
}  }
n2=n1+n;  n2=n1+n;
,if (diff>=0 || newdiff<0) {  ,if (((~diff)|newdiff)<0) { /* use | to avoid two branches for gforth-native */
,)  ,)

\+  \+
Line 2353  av-double ( r -- ) gforth  av_double Line 2354  av-double ( r -- ) gforth  av_double
av_double(alist, r);  av_double(alist, r);

av-longlong     ( d -- )        gforth  av_longlong  av-longlong     ( d -- )        gforth  av_longlong
#ifdef BUGGY_LONG_LONG
av_longlong(alist, d.lo);
#else
av_longlong(alist, d);  av_longlong(alist, d);
#endif

av-ptr  ( c_addr -- )   gforth  av_ptr  av-ptr  ( c_addr -- )   gforth  av_ptr
Line 2372  lp += sizeof(Float); Line 2377  lp += sizeof(Float);
av_double(alist, r);  av_double(alist, r);

av-longlong-r   ( R:d -- )      gforth  av_longlong_r  av-longlong-r   ( R:d -- )      gforth  av_longlong_r
#ifdef BUGGY_LONG_LONG
av_longlong(alist, d.lo);
#else
av_longlong(alist, d);  av_longlong(alist, d);
#endif

av-ptr-r        ( R:c_addr -- ) gforth  av_ptr_r  av-ptr-r        ( R:c_addr -- ) gforth  av_ptr_r
Line 2404  av-call-longlong ( -- d ) gforth  av_cal Line 2413  av-call-longlong ( -- d ) gforth  av_cal
SAVE_REGS  SAVE_REGS
av_call(alist);  av_call(alist);
REST_REGS  REST_REGS
#ifdef BUGGY_LONG_LONG
d = llrv;  d = llrv;
#else
d.lo = llrv;
d.hi = 0;
#endif

av-call-ptr     ( -- c_addr )   gforth  av_call_ptr  av-call-ptr     ( -- c_addr )   gforth  av_call_ptr
SAVE_REGS  SAVE_REGS
Line 2437  va-arg-int ( -- w ) gforth va_arg_int Line 2451  va-arg-int ( -- w ) gforth va_arg_int
w = va_arg_int(clist);  w = va_arg_int(clist);

va-arg-longlong ( -- d )        gforth  va_arg_longlong  va-arg-longlong ( -- d )        gforth  va_arg_longlong
#ifdef BUGGY_LONG_LONG
d.lo = va_arg_longlong(clist);
d.hi = 0;
#else
d = va_arg_longlong(clist);  d = va_arg_longlong(clist);
#endif

va-arg-ptr      ( -- c_addr )   gforth  va_arg_ptr  va-arg-ptr      ( -- c_addr )   gforth  va_arg_ptr
c_addr = (char *)va_arg_ptr(clist,char*);  c_addr = (char *)va_arg_ptr(clist,char*);
Line 2461  va_return_ptr(clist, void *, c_addr); Line 2480  va_return_ptr(clist, void *, c_addr);
return 0;  return 0;

va-return-longlong ( d -- )     gforth va_return_longlong  va-return-longlong ( d -- )     gforth va_return_longlong
#ifdef BUGGY_LONG_LONG
va_return_longlong(clist, d.lo);
#else
va_return_longlong(clist, d);  va_return_longlong(clist, d);
#endif
return 0;  return 0;

va-return-float ( r -- )        gforth va_return_float  va-return-float ( r -- )        gforth va_return_float
Line 2526  compile_prim1(a_prim); Line 2549  compile_prim1(a_prim);
finish-code ( -- ) gforth finish_code  finish-code ( -- ) gforth finish_code
""Perform delayed steps in code generation (branch resolution, I-cache  ""Perform delayed steps in code generation (branch resolution, I-cache
flushing).""  flushing).""
IF_spTOS(sp[0]=spTOS); /* workaround for failing to save spTOS
(gcc-2.95.1, gforth-fast --enable-force-reg) */
finish_code();  finish_code();
IF_spTOS(spTOS=sp[0]);

forget-dyncode ( c_code -- f ) gforth-internal forget_dyncode  forget-dyncode ( c_code -- f ) gforth-internal forget_dyncode
f = forget_dyncode(c_code);  f = forget_dyncode(c_code);

 Removed from v.1.148 changed lines Added in v.1.151

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>