Merge branch 'newbreach'

Conflicts:
	urb/urbit.pill
This commit is contained in:
Jared Hance 2014-06-03 13:38:33 -04:00
commit 1585ca9581
3 changed files with 187 additions and 0 deletions

View File

@ -170,6 +170,7 @@ J164_5_OFILES=\
gen164/5/mink.o \
gen164/5/mule.o \
gen164/5/parse.o \
gen164/5/rd.o \
gen164/5/repg.o \
gen164/5/rexp.o \
gen164/5/rub.o \

184
gen164/5/rd.c Normal file
View File

@ -0,0 +1,184 @@
/* j/5/aes.c
**
** This file is in the public domain.
*/
#include "all.h"
#include "../pit.h"
union doub {
double d;
c3_d c;
};
/* declarations
*/
extern u2_ho_jet j2_mcj(Pt5, rd, mul)[];
extern u2_ho_jet j2_mcj(Pt5, rd, div)[];
extern u2_ho_jet j2_mcj(Pt5, rd, add)[];
extern u2_ho_jet j2_mcj(Pt5, rd, sub)[];
/* functions
*/
/* mul
*/
u2_weak
j2_mcd(Pt5, rd, mul)(u2_wire wir_r,
u2_atom a,
u2_atom b)
{
union doub c, d, e;
c.c = u2_chub(0, a);
d.c = u2_chub(0, b);
e.d = c.d * d.d;
return u2_ci_chubs(1, &e.c);
}
u2_weak
j2_mc(Pt5, rd, mul)(u2_wire wir_r,
u2_noun cor)
{
u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) ||
u2_no == u2_stud(b) )
{
return u2_bl_bail(wir_r, c3__exit);
}
else {
return j2_mcd(Pt5, rd, mul)(wir_r, a, b);
}
}
/* div
*/
u2_weak
j2_mcd(Pt5, rd, div)(u2_wire wir_r,
u2_atom a,
u2_atom b)
{
union doub c, d, e;
c.c = u2_chub(0, a);
d.c = u2_chub(0, b);
e.d = c.d / d.d;
return u2_ci_chubs(1, &e.c);
}
u2_weak
j2_mc(Pt5, rd, div)(u2_wire wir_r,
u2_noun cor)
{
u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) ||
u2_no == u2_stud(b) )
{
return u2_bl_bail(wir_r, c3__exit);
}
else {
return j2_mcd(Pt5, rd, div)(wir_r, a, b);
}
}
/* add
*/
u2_weak
j2_mcd(Pt5, rd, add)(u2_wire wir_r,
u2_atom a,
u2_atom b)
{
union doub c, d, e;
c.c = u2_chub(0, a);
d.c = u2_chub(0, b);
e.d = c.d + d.d;
return u2_ci_chubs(1, &e.c);
}
u2_weak
j2_mc(Pt5, rd, add)(u2_wire wir_r,
u2_noun cor)
{
u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) ||
u2_no == u2_stud(b) )
{
return u2_bl_bail(wir_r, c3__exit);
}
else {
return j2_mcd(Pt5, rd, add)(wir_r, a, b);
}
}
/* sub
*/
u2_weak
j2_mcd(Pt5, rd, sub)(u2_wire wir_r,
u2_atom a,
u2_atom b)
{
union doub c, d, e;
c.c = u2_chub(0, a);
d.c = u2_chub(0, b);
e.d = c.d - d.d;
return u2_ci_chubs(1, &e.c);
}
u2_weak
j2_mc(Pt5, rd, sub)(u2_wire wir_r,
u2_noun cor)
{
u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) ||
u2_no == u2_stud(b) )
{
return u2_bl_bail(wir_r, c3__exit);
}
else {
return j2_mcd(Pt5, rd, sub)(wir_r, a, b);
}
}
/* structures
*/
u2_ho_jet
j2_mcj(Pt5, rd, mul)[] = {
{ ".2", c3__lite, j2_mc(Pt5, rd, mul), Tier5_test, u2_none, u2_none },
{ }
};
u2_ho_jet
j2_mcj(Pt5, rd, div)[] = {
{ ".2", c3__lite, j2_mc(Pt5, rd, div), Tier5_test, u2_none, u2_none },
{ }
};
u2_ho_jet
j2_mcj(Pt5, rd, add)[] = {
{ ".2", c3__lite, j2_mc(Pt5, rd, add), Tier5_test, u2_none, u2_none },
{ }
};
u2_ho_jet
j2_mcj(Pt5, rd, sub)[] = {
{ ".2", c3__lite, j2_mc(Pt5, rd, sub), Tier5_test, u2_none, u2_none },
{ }
};
u2_ho_driver
j2_mbd(Pt5, rd)[] = {
{ j2_sc(Pt5, rd, mul), j2_mcj(Pt5, rd, mul), 0, 0, u2_none },
{ j2_sc(Pt5, rd, div), j2_mcj(Pt5, rd, div), 0, 0, u2_none },
{ j2_sc(Pt5, rd, add), j2_mcj(Pt5, rd, add), 0, 0, u2_none },
{ j2_sc(Pt5, rd, sub), j2_mcj(Pt5, rd, sub), 0, 0, u2_none },
{ }
};
u2_ho_driver
j2_db(Pt5, rd) =
{ j2_sb(Pt5, rd), 0, j2_mbd(Pt5, rd), 0, u2_none };

View File

@ -110,6 +110,7 @@
extern u2_ho_driver j2_mbd(Pt5, just)[];
extern u2_ho_driver j2_mbd(Pt5, mask)[];
extern u2_ho_driver j2_mbd(Pt5, og)[];
extern u2_ho_driver j2_mbd(Pt5, rd)[];
extern u2_ho_driver j2_mbd(Pt5, shim)[];
extern u2_ho_driver j2_mbd(Pt5, stag)[];
extern u2_ho_driver j2_mbd(Pt5, stew)[];
@ -241,6 +242,7 @@
{ j2_sb(Pt5, pfix), j2_mbj(Pt5, pfix), 0, 0, u2_none },
{ j2_sb(Pt5, plug), j2_mbj(Pt5, plug), 0, 0, u2_none },
{ j2_sb(Pt5, pose), j2_mbj(Pt5, pose), 0, 0, u2_none },
{ j2_sb(Pt5, rd), 0, j2_mbd(Pt5, rd), 0, u2_none },
{ j2_sb(Pt5, repg), j2_mbj(Pt5, repg), 0, 0, u2_none },
{ j2_sb(Pt5, rexp), j2_mbj(Pt5, rexp), 0, 0, u2_none },
{ j2_sb(Pt5, rub), j2_mbj(Pt5, rub), 0, 0, u2_none },