Slow things commented out.

This commit is contained in:
C. Guy Yarvin 2014-05-30 13:57:49 -07:00
parent 534e1a9090
commit c5513510f0
5 changed files with 164 additions and 2 deletions

View File

@ -57,7 +57,7 @@ endif
INCLUDE=include INCLUDE=include
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\" MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\"
CFLAGS= -O -g \ CFLAGS= -O3 \
-I/usr/local/include \ -I/usr/local/include \
-I/opt/local/include \ -I/opt/local/include \
-I$(INCLUDE) \ -I$(INCLUDE) \

View File

@ -14,6 +14,10 @@
static u2_noun _nock_mool(u2_noun, u2_noun, u2_kode*); static u2_noun _nock_mool(u2_noun, u2_noun, u2_kode*);
static u2_noun _nock_molg(u2_noun, u2_noun, u2_kode*); static u2_noun _nock_molg(u2_noun, u2_noun, u2_kode*);
#ifdef GHETTO
extern c3_w nox_w;
#endif
/* _nock_pray_mool(): load from namespace, in virtual mode. /* _nock_pray_mool(): load from namespace, in virtual mode.
*/ */
static u2_noun static u2_noun
@ -304,6 +308,10 @@ _nock_cool(u2_noun bus,
while ( 1 ) { while ( 1 ) {
u2_tx_did_hop(u2_Wire, 1); u2_tx_did_hop(u2_Wire, 1);
#ifdef GHETTO
nox_w++;
#endif
if ( u2_no == u2du(fol) ) { if ( u2_no == u2du(fol) ) {
return u2_cm_bail(c3__exit); return u2_cm_bail(c3__exit);
} }
@ -556,6 +564,10 @@ _nock_mool(u2_noun bus,
while ( 1 ) { while ( 1 ) {
u2_tx_did_hop(u2_Wire, 1); u2_tx_did_hop(u2_Wire, 1);
#ifdef GHETTO
nox_w++;
#endif
if ( u2_no == u2du(fol) ) { if ( u2_no == u2du(fol) ) {
*pon = 2; *pon = 2;
u2z(bus); u2z(fol); u2z(bus); u2z(fol);

View File

@ -692,6 +692,10 @@ _print_wall(u2_noun wal,
} }
#endif #endif
#ifdef GHETTO
c3_w nox_w;
#endif
/* u2_tx_slog(): print debug syslog [0-3 tank] 0=debug 3=alarm /* u2_tx_slog(): print debug syslog [0-3 tank] 0=debug 3=alarm
*/ */
void void
@ -711,9 +715,10 @@ u2_tx_slog(u2_ray wir_r,
timersub(&t, &p, &d); timersub(&t, &p, &d);
ms_w = (d.tv_sec * 1000) + (d.tv_usec / 1000); ms_w = (d.tv_sec * 1000) + (d.tv_usec / 1000);
printf("%d.%dms ", ms_w, (d.tv_usec % 1000) / 10); printf("%d.%dms (%d) ", ms_w, (d.tv_usec % 1000) / 10, nox_w);
} }
haz = 1; haz = 1;
nox_w = 0;
#endif #endif
{ {
if ( u2_yes == u2du(luf) ) { if ( u2_yes == u2du(luf) ) {

66
gen164/6/slot.c Normal file
View File

@ -0,0 +1,66 @@
/* j/6/slot.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
/* functions
*/
u2_noun // transfer
j2_mby(Pt6, slot)(u2_wire wir_r,
u2_atom axe, // retain
u2_noun vax) // retain
{
u2_weak fag = u2_frag(axe, u2t(vax));
fprintf(stderr, "slot axe %d\r\n", axe);
if ( u2_none == fag ) {
return u2_bl_bail(wir_r, c3__exit);
}
else {
u2_noun typ = j2_mcy(Pt6, ut, peek)(
}
c3_w i_w, met_w = c3_min(u2_met(3, axe), u2_met(3, vax));
if ( u2_no == _slot_fiz(wir_r, axe, vax) ) {
return u2_no;
}
for ( i_w = 0; i_w < met_w; i_w++ ) {
c3_y axe_y = u2_byte(i_w, axe);
c3_y vax_y = u2_byte(i_w, vax);
if ( (axe_y >= 'A') && (axe_y <= 'Z') ) axe_y = 0;
if ( (vax_y >= 'A') && (vax_y <= 'Z') ) vax_y = 0;
if ( axe_y && vax_y && (axe_y != vax_y) ) {
return u2_no;
}
}
return u2_yes;
}
u2_noun // transfer
j2_mb(Pt6, slot)(u2_wire wir_r,
u2_noun cor) // retain
{
u2_noun axe, vax;
if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &axe, u2_cv_sam_3, &vax, 0)) ||
(u2_no == u2ud(axe)) ||
(u2_no == u2du(vax)) )
{
return u2_bl_bail(wir_r, c3__fail);
} else {
return j2_mby(Pt6, slot)(wir_r, axe, vax);
}
}
/* structures
*/
u2_ho_jet
j2_mbj(Pt6, slot)[] = {
{ ".2", c3__hevy, j2_mb(Pt6, slot), u2_jet_live | u2_jet_test, u2_none, u2_none },
{ }
};

79
gen164/6/spec.c Normal file
View File

@ -0,0 +1,79 @@
/* j/6/fitz.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
/* functions
*/
static u2_bean
_fitz_fiz(u2_wire wir_r,
u2_noun yaz,
u2_noun wix)
{
c3_w yaz_w = u2_met(3, yaz);
c3_w wix_w = u2_met(3, wix);
c3_y yaz_y, wix_y;
yaz_y = (0 == yaz_w) ? 0 : u2_byte((yaz_w - 1), yaz);
if ( (yaz_y < 'A') || (yaz_y > 'Z') ) yaz_y = 0;
wix_y = (0 == wix_w) ? 0 : u2_byte((wix_w - 1), wix);
if ( (wix_y < 'A') || (wix_y > 'Z') ) wix_y = 0;
if ( yaz_y && wix_y ) {
if ( !wix_y || (wix_y > yaz_y) ) {
return u2_no;
}
}
return u2_yes;
}
u2_noun // transfer
j2_mby(Pt6, fitz)(u2_wire wir_r,
u2_noun yaz, // retain
u2_noun wix) // retain
{
c3_w i_w, met_w = c3_min(u2_met(3, yaz), u2_met(3, wix));
if ( u2_no == _fitz_fiz(wir_r, yaz, wix) ) {
return u2_no;
}
for ( i_w = 0; i_w < met_w; i_w++ ) {
c3_y yaz_y = u2_byte(i_w, yaz);
c3_y wix_y = u2_byte(i_w, wix);
if ( (yaz_y >= 'A') && (yaz_y <= 'Z') ) yaz_y = 0;
if ( (wix_y >= 'A') && (wix_y <= 'Z') ) wix_y = 0;
if ( yaz_y && wix_y && (yaz_y != wix_y) ) {
return u2_no;
}
}
return u2_yes;
}
u2_noun // transfer
j2_mb(Pt6, fitz)(u2_wire wir_r,
u2_noun cor) // retain
{
u2_noun yaz, wix;
if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &yaz, u2_cv_sam_3, &wix, 0)) ||
(u2_no == u2ud(yaz)) ||
(u2_no == u2ud(wix)) )
{
return u2_bl_bail(wir_r, c3__fail);
} else {
return j2_mby(Pt6, fitz)(wir_r, yaz, wix);
}
}
/* structures
*/
u2_ho_jet
j2_mbj(Pt6, fitz)[] = {
{ ".2", c3__hevy, j2_mb(Pt6, fitz), Tier6_a, u2_none, u2_none },
{ }
};