libc: trailing whitespace cleanup
This commit is contained in:
parent
d094b7faa1
commit
e387915a8f
29 changed files with 117 additions and 117 deletions
|
@ -728,55 +728,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -676,56 +676,56 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -676,55 +676,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ nettrans(char *addr, char *naddr, int na, char *file, int nf)
|
||||||
p = strchr(buf+1, '/');
|
p = strchr(buf+1, '/');
|
||||||
if(p == nil)
|
if(p == nil)
|
||||||
p = buf;
|
p = buf;
|
||||||
else
|
else
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
snprint(file, nf, "%s/%s", netdir, p);
|
snprint(file, nf, "%s/%s", netdir, p);
|
||||||
|
|
|
@ -37,7 +37,7 @@ convM2D(uchar *buf, uint nbuf, Dir *d, char *strs)
|
||||||
int i, ns;
|
int i, ns;
|
||||||
|
|
||||||
if(nbuf < STATFIXLEN)
|
if(nbuf < STATFIXLEN)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
ebuf = buf + nbuf;
|
ebuf = buf + nbuf;
|
||||||
|
@ -89,6 +89,6 @@ convM2D(uchar *buf, uint nbuf, Dir *d, char *strs)
|
||||||
d->gid = nullstring;
|
d->gid = nullstring;
|
||||||
d->muid = nullstring;
|
d->muid = nullstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
return p - buf;
|
return p - buf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ call(char *clone, char *dest, DS *ds)
|
||||||
p = strchr(clone+1, '/');
|
p = strchr(clone+1, '/');
|
||||||
if(p == nil)
|
if(p == nil)
|
||||||
p = clone;
|
p = clone;
|
||||||
else
|
else
|
||||||
p++;
|
p++;
|
||||||
} else
|
} else
|
||||||
p = clone;
|
p = clone;
|
||||||
|
|
|
@ -325,7 +325,7 @@ rwakeup(Rendez *r)
|
||||||
* take off wait and put on front of queue
|
* take off wait and put on front of queue
|
||||||
* put on front so guys that have been waiting will not get starved
|
* put on front so guys that have been waiting will not get starved
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!r->l)
|
if(!r->l)
|
||||||
abort();
|
abort();
|
||||||
lock(&r->l->lock);
|
lock(&r->l->lock);
|
||||||
|
|
|
@ -27,7 +27,7 @@ _balign:
|
||||||
MOVB R2, (R6)
|
MOVB R2, (R6)
|
||||||
ADDL $-1, R7, R7
|
ADDL $-1, R7, R7
|
||||||
JMP _balign
|
JMP _balign
|
||||||
|
|
||||||
_baligned:
|
_baligned:
|
||||||
AND $(QUAD-1), R7, R1 /* is the source quad-aligned */
|
AND $(QUAD-1), R7, R1 /* is the source quad-aligned */
|
||||||
BNE R1, _bunaligned
|
BNE R1, _bunaligned
|
||||||
|
|
|
@ -85,9 +85,9 @@ _f32loop:
|
||||||
CMP R(TMP), R(TS)
|
CMP R(TMP), R(TS)
|
||||||
BHS _f4tail
|
BHS _f4tail
|
||||||
|
|
||||||
MOVM.IA.W (R(FROM)), [R4-R7]
|
MOVM.IA.W (R(FROM)), [R4-R7]
|
||||||
MOVM.IA.W [R4-R7], (R(TS))
|
MOVM.IA.W [R4-R7], (R(TS))
|
||||||
MOVM.IA.W (R(FROM)), [R4-R7]
|
MOVM.IA.W (R(FROM)), [R4-R7]
|
||||||
MOVM.IA.W [R4-R7], (R(TS))
|
MOVM.IA.W [R4-R7], (R(TS))
|
||||||
B _f32loop
|
B _f32loop
|
||||||
|
|
||||||
|
|
|
@ -694,55 +694,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,7 +303,7 @@ _floatfmt(Fmt *fmt, double f)
|
||||||
* The max length of a %f string is
|
* The max length of a %f string is
|
||||||
* '[+-]'+"max exponent"+'.'+"max precision"+'\0'
|
* '[+-]'+"max exponent"+'.'+"max precision"+'\0'
|
||||||
* which is 341 currently.
|
* which is 341 currently.
|
||||||
*/
|
*/
|
||||||
xdtoa(fmt, s, f);
|
xdtoa(fmt, s, f);
|
||||||
fmt->flags &= FmtWidth|FmtLeft;
|
fmt->flags &= FmtWidth|FmtLeft;
|
||||||
_fmtcpy(fmt, s, strlen(s), strlen(s));
|
_fmtcpy(fmt, s, strlen(s), strlen(s));
|
||||||
|
|
|
@ -76,7 +76,7 @@ sqrt(double arg)
|
||||||
/*
|
/*
|
||||||
* this is the program that generated the table.
|
* this is the program that generated the table.
|
||||||
* it calls sqrt by some other means.
|
* it calls sqrt by some other means.
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* main(void)
|
* main(void)
|
||||||
* {
|
* {
|
||||||
|
@ -90,7 +90,7 @@ sqrt(double arg)
|
||||||
* long ls;
|
* long ls;
|
||||||
* };
|
* };
|
||||||
* } u;
|
* } u;
|
||||||
*
|
*
|
||||||
* for(i=0; i<64; i++) {
|
* for(i=0; i<64; i++) {
|
||||||
* u.ms = (i<<15) | 0x3fe04000;
|
* u.ms = (i<<15) | 0x3fe04000;
|
||||||
* u.ls = 0;
|
* u.ls = 0;
|
||||||
|
|
|
@ -705,55 +705,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ cleanname(char *name)
|
||||||
if(q == name) /* empty string is really ``.'' */
|
if(q == name) /* empty string is really ``.'' */
|
||||||
*q++ = '.';
|
*q++ = '.';
|
||||||
*q = '\0';
|
*q = '\0';
|
||||||
if(erasedprefix && name[0] == '#'){
|
if(erasedprefix && name[0] == '#'){
|
||||||
/* this was not a #x device path originally - make it not one now */
|
/* this was not a #x device path originally - make it not one now */
|
||||||
memmove(name+2, name, strlen(name)+1);
|
memmove(name+2, name, strlen(name)+1);
|
||||||
name[0] = '.';
|
name[0] = '.';
|
||||||
|
|
|
@ -135,7 +135,7 @@ pprint(Pool *p, char *fmt, ...)
|
||||||
|
|
||||||
static char panicbuf[256];
|
static char panicbuf[256];
|
||||||
static void
|
static void
|
||||||
ppanic(Pool *p, char *fmt, ...)
|
ppanic(Pool *p, char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list v;
|
va_list v;
|
||||||
int n;
|
int n;
|
||||||
|
@ -170,7 +170,7 @@ ppanic(Pool *p, char *fmt, ...)
|
||||||
/* - except the code for malloc(), which alternately doesn't clear or does. - */
|
/* - except the code for malloc(), which alternately doesn't clear or does. - */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Npadlong is the number of ulongs's to leave at the beginning of
|
* Npadlong is the number of ulongs's to leave at the beginning of
|
||||||
* each allocated buffer for our own bookkeeping. We return to the callers
|
* each allocated buffer for our own bookkeeping. We return to the callers
|
||||||
* a pointer that points immediately after our bookkeeping area. Incoming pointers
|
* a pointer that points immediately after our bookkeeping area. Incoming pointers
|
||||||
* must be decremented by that much, and outgoing pointers incremented.
|
* must be decremented by that much, and outgoing pointers incremented.
|
||||||
|
@ -269,7 +269,7 @@ realloc(void *v, ulong size)
|
||||||
setrealloctag(nv, getcallerpc(&v));
|
setrealloctag(nv, getcallerpc(&v));
|
||||||
if(v == nil)
|
if(v == nil)
|
||||||
setmalloctag(nv, getcallerpc(&v));
|
setmalloctag(nv, getcallerpc(&v));
|
||||||
}
|
}
|
||||||
return nv;
|
return nv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This allocator takes blocks from a coarser allocator (p->alloc) and
|
* This allocator takes blocks from a coarser allocator (p->alloc) and
|
||||||
* uses them as arenas.
|
* uses them as arenas.
|
||||||
*
|
*
|
||||||
* An arena is split into a sequence of blocks of variable size. The
|
* An arena is split into a sequence of blocks of variable size. The
|
||||||
* blocks begin with a Bhdr that denotes the length (including the Bhdr)
|
* blocks begin with a Bhdr that denotes the length (including the Bhdr)
|
||||||
* of the block. An arena begins with an Arena header block (Arena,
|
* of the block. An arena begins with an Arena header block (Arena,
|
||||||
|
@ -9,17 +9,17 @@
|
||||||
* size 0. Intermediate blocks are either allocated or free. At the end
|
* size 0. Intermediate blocks are either allocated or free. At the end
|
||||||
* of each intermediate block is a Btail, which contains information
|
* of each intermediate block is a Btail, which contains information
|
||||||
* about where the block starts. This is useful for walking backwards.
|
* about where the block starts. This is useful for walking backwards.
|
||||||
*
|
*
|
||||||
* Free blocks (Free*) have a magic value of FREE_MAGIC in their Bhdr
|
* Free blocks (Free*) have a magic value of FREE_MAGIC in their Bhdr
|
||||||
* headers. They are kept in a binary tree (p->freeroot) traversible by
|
* headers. They are kept in a binary tree (p->freeroot) traversible by
|
||||||
* walking ->left and ->right. Each node of the binary tree is a pointer
|
* walking ->left and ->right. Each node of the binary tree is a pointer
|
||||||
* to a circular doubly-linked list (next, prev) of blocks of identical
|
* to a circular doubly-linked list (next, prev) of blocks of identical
|
||||||
* size. Blocks are added to this ``tree of lists'' by pooladd(), and
|
* size. Blocks are added to this ``tree of lists'' by pooladd(), and
|
||||||
* removed by pooldel().
|
* removed by pooldel().
|
||||||
*
|
*
|
||||||
* When freed, adjacent blocks are coalesced to create larger blocks when
|
* When freed, adjacent blocks are coalesced to create larger blocks when
|
||||||
* possible.
|
* possible.
|
||||||
*
|
*
|
||||||
* Allocated blocks (Alloc*) have one of two magic values: ALLOC_MAGIC or
|
* Allocated blocks (Alloc*) have one of two magic values: ALLOC_MAGIC or
|
||||||
* UNALLOC_MAGIC. When blocks are released from the pool, they have
|
* UNALLOC_MAGIC. When blocks are released from the pool, they have
|
||||||
* magic value UNALLOC_MAGIC. Once the block has been trimmed by trim()
|
* magic value UNALLOC_MAGIC. Once the block has been trimmed by trim()
|
||||||
|
@ -27,11 +27,11 @@
|
||||||
* datasize field of the tail, the magic value is changed to ALLOC_MAGIC.
|
* datasize field of the tail, the magic value is changed to ALLOC_MAGIC.
|
||||||
* All blocks returned to callers should be of type ALLOC_MAGIC, as
|
* All blocks returned to callers should be of type ALLOC_MAGIC, as
|
||||||
* should all blocks passed to us by callers. The amount of data the user
|
* should all blocks passed to us by callers. The amount of data the user
|
||||||
* asked us for can be found by subtracting the short in tail->datasize
|
* asked us for can be found by subtracting the short in tail->datasize
|
||||||
* from header->size. Further, the up to at most four bytes between the
|
* from header->size. Further, the up to at most four bytes between the
|
||||||
* end of the user-requested data block and the actual Btail structure are
|
* end of the user-requested data block and the actual Btail structure are
|
||||||
* marked with a magic value, which is checked to detect user overflow.
|
* marked with a magic value, which is checked to detect user overflow.
|
||||||
*
|
*
|
||||||
* The arenas returned by p->alloc are kept in a doubly-linked list
|
* The arenas returned by p->alloc are kept in a doubly-linked list
|
||||||
* (p->arenalist) running through the arena headers, sorted by descending
|
* (p->arenalist) running through the arena headers, sorted by descending
|
||||||
* base address (prev, next). When a new arena is allocated, we attempt
|
* base address (prev, next). When a new arena is allocated, we attempt
|
||||||
|
@ -159,12 +159,12 @@ static Free* treesplay(Free*, ulong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging
|
* Debugging
|
||||||
*
|
*
|
||||||
* Antagonism causes blocks to always be filled with garbage if their
|
* Antagonism causes blocks to always be filled with garbage if their
|
||||||
* contents are undefined. This tickles both programs and the library.
|
* contents are undefined. This tickles both programs and the library.
|
||||||
* It's a linear time hit but not so noticeable during nondegenerate use.
|
* It's a linear time hit but not so noticeable during nondegenerate use.
|
||||||
* It would be worth leaving in except that it negates the benefits of the
|
* It would be worth leaving in except that it negates the benefits of the
|
||||||
* kernel's demand-paging. The tail magic and end-of-data magic
|
* kernel's demand-paging. The tail magic and end-of-data magic
|
||||||
* provide most of the user-visible benefit that antagonism does anyway.
|
* provide most of the user-visible benefit that antagonism does anyway.
|
||||||
*
|
*
|
||||||
* Paranoia causes the library to recheck the entire pool on each lock
|
* Paranoia causes the library to recheck the entire pool on each lock
|
||||||
|
@ -220,7 +220,7 @@ checktree(Free *t, int a, int b)
|
||||||
checktree(t->left, a, t->size);
|
checktree(t->left, a, t->size);
|
||||||
if(t->right)
|
if(t->right)
|
||||||
checktree(t->right, t->size, b);
|
checktree(t->right, t->size, b);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* treelookupgt: find smallest node in tree with size >= size */
|
/* treelookupgt: find smallest node in tree with size >= size */
|
||||||
|
@ -379,7 +379,7 @@ pooldel(Pool *p, Free *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Block maintenance
|
* Block maintenance
|
||||||
*/
|
*/
|
||||||
/* block allocation */
|
/* block allocation */
|
||||||
static ulong
|
static ulong
|
||||||
|
@ -527,7 +527,7 @@ freefromfront(Pool *p, Alloc *b, ulong skip)
|
||||||
pooladd(p, b);
|
pooladd(p, b);
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -656,7 +656,7 @@ arenamerge(Pool *p, Arena *bot, Arena *top)
|
||||||
bot->aup->down = bot;
|
bot->aup->down = bot;
|
||||||
else
|
else
|
||||||
p->arenalist = bot;
|
p->arenalist = bot;
|
||||||
|
|
||||||
/* save ptrs to last block in bot, first block in top */
|
/* save ptrs to last block in bot, first block in top */
|
||||||
t = B2PT(A2TB(bot));
|
t = B2PT(A2TB(bot));
|
||||||
bbot = T2HDR(t);
|
bbot = T2HDR(t);
|
||||||
|
@ -848,7 +848,7 @@ arenacompact(Pool *p, Arena *a)
|
||||||
pooladd(p, (Alloc*)wb);
|
pooladd(p, (Alloc*)wb);
|
||||||
}
|
}
|
||||||
|
|
||||||
return compacted;
|
return compacted;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1033,7 +1033,7 @@ poolreallocl(Pool *p, void *v, ulong ndsize)
|
||||||
|
|
||||||
/* enough cleverness */
|
/* enough cleverness */
|
||||||
memmove(nv, v, odsize);
|
memmove(nv, v, odsize);
|
||||||
antagonism {
|
antagonism {
|
||||||
memset((char*)nv+odsize, 0xDE, ndsize-odsize);
|
memset((char*)nv+odsize, 0xDE, ndsize-odsize);
|
||||||
}
|
}
|
||||||
poolfreel(p, v);
|
poolfreel(p, v);
|
||||||
|
@ -1078,7 +1078,7 @@ poolallocalignl(Pool *p, ulong dsize, ulong align, long offset, ulong span)
|
||||||
*
|
*
|
||||||
* to satisfy alignment, just allocate an extra
|
* to satisfy alignment, just allocate an extra
|
||||||
* align bytes and then shift appropriately.
|
* align bytes and then shift appropriately.
|
||||||
*
|
*
|
||||||
* to satisfy span, try once and see if we're
|
* to satisfy span, try once and see if we're
|
||||||
* lucky. the second time, allocate 2x asize
|
* lucky. the second time, allocate 2x asize
|
||||||
* so that we definitely get one not crossing
|
* so that we definitely get one not crossing
|
||||||
|
@ -1133,7 +1133,7 @@ poolallocalignl(Pool *p, ulong dsize, ulong align, long offset, ulong span)
|
||||||
trim(p, b, skip+dsize);
|
trim(p, b, skip+dsize);
|
||||||
p->curalloc += b->size;
|
p->curalloc += b->size;
|
||||||
assert(D2B(p, c) == b);
|
assert(D2B(p, c) == b);
|
||||||
antagonism {
|
antagonism {
|
||||||
memset(c, 0xDD, dsize);
|
memset(c, 0xDD, dsize);
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
|
@ -1159,7 +1159,7 @@ poolfreel(Pool *p, void *v)
|
||||||
n = getdsize(ab)-8;
|
n = getdsize(ab)-8;
|
||||||
if(n > 0)
|
if(n > 0)
|
||||||
memset((uchar*)v+8, 0xDA, n);
|
memset((uchar*)v+8, 0xDA, n);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->nfree++;
|
p->nfree++;
|
||||||
|
@ -1297,7 +1297,7 @@ poolfree(Pool *p, void *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the real size of a block, and let the user use it.
|
* Return the real size of a block, and let the user use it.
|
||||||
*/
|
*/
|
||||||
ulong
|
ulong
|
||||||
poolmsize(Pool *p, void *v)
|
poolmsize(Pool *p, void *v)
|
||||||
|
@ -1333,7 +1333,7 @@ poolmsize(Pool *p, void *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging
|
* Debugging
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
static
|
static
|
||||||
double tab[] =
|
double tab[] =
|
||||||
{
|
{
|
||||||
1.0e0, 1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5, 1.0e6, 1.0e7, 1.0e8, 1.0e9,
|
1.0e0, 1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5, 1.0e6, 1.0e7, 1.0e8, 1.0e9,
|
||||||
1.0e10, 1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15, 1.0e16, 1.0e17, 1.0e18, 1.0e19,
|
1.0e10, 1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15, 1.0e16, 1.0e17, 1.0e18, 1.0e19,
|
||||||
1.0e20, 1.0e21, 1.0e22, 1.0e23, 1.0e24, 1.0e25, 1.0e26, 1.0e27, 1.0e28, 1.0e29,
|
1.0e20, 1.0e21, 1.0e22, 1.0e23, 1.0e24, 1.0e25, 1.0e26, 1.0e27, 1.0e28, 1.0e29,
|
||||||
1.0e30, 1.0e31, 1.0e32, 1.0e33, 1.0e34, 1.0e35, 1.0e36, 1.0e37, 1.0e38, 1.0e39,
|
1.0e30, 1.0e31, 1.0e32, 1.0e33, 1.0e34, 1.0e35, 1.0e36, 1.0e37, 1.0e38, 1.0e39,
|
||||||
1.0e40, 1.0e41, 1.0e42, 1.0e43, 1.0e44, 1.0e45, 1.0e46, 1.0e47, 1.0e48, 1.0e49,
|
1.0e40, 1.0e41, 1.0e42, 1.0e43, 1.0e44, 1.0e45, 1.0e46, 1.0e47, 1.0e48, 1.0e49,
|
||||||
1.0e50, 1.0e51, 1.0e52, 1.0e53, 1.0e54, 1.0e55, 1.0e56, 1.0e57, 1.0e58, 1.0e59,
|
1.0e50, 1.0e51, 1.0e52, 1.0e53, 1.0e54, 1.0e55, 1.0e56, 1.0e57, 1.0e58, 1.0e59,
|
||||||
1.0e60, 1.0e61, 1.0e62, 1.0e63, 1.0e64, 1.0e65, 1.0e66, 1.0e67, 1.0e68, 1.0e69,
|
1.0e60, 1.0e61, 1.0e62, 1.0e63, 1.0e64, 1.0e65, 1.0e66, 1.0e67, 1.0e68, 1.0e69,
|
||||||
1.0e70, 1.0e71, 1.0e72, 1.0e73, 1.0e74, 1.0e75, 1.0e76, 1.0e77, 1.0e78, 1.0e79,
|
1.0e70, 1.0e71, 1.0e72, 1.0e73, 1.0e74, 1.0e75, 1.0e76, 1.0e77, 1.0e78, 1.0e79,
|
||||||
1.0e80, 1.0e81, 1.0e82, 1.0e83, 1.0e84, 1.0e85, 1.0e86, 1.0e87, 1.0e88, 1.0e89,
|
1.0e80, 1.0e81, 1.0e82, 1.0e83, 1.0e84, 1.0e85, 1.0e86, 1.0e87, 1.0e88, 1.0e89,
|
||||||
1.0e90, 1.0e91, 1.0e92, 1.0e93, 1.0e94, 1.0e95, 1.0e96, 1.0e97, 1.0e98, 1.0e99,
|
1.0e90, 1.0e91, 1.0e92, 1.0e93, 1.0e94, 1.0e95, 1.0e96, 1.0e97, 1.0e98, 1.0e99,
|
||||||
1.0e100,1.0e101,1.0e102,1.0e103,1.0e104,1.0e105,1.0e106,1.0e107,1.0e108,1.0e109,
|
1.0e100,1.0e101,1.0e102,1.0e103,1.0e104,1.0e105,1.0e106,1.0e107,1.0e108,1.0e109,
|
||||||
1.0e110,1.0e111,1.0e112,1.0e113,1.0e114,1.0e115,1.0e116,1.0e117,1.0e118,1.0e119,
|
1.0e110,1.0e111,1.0e112,1.0e113,1.0e114,1.0e115,1.0e116,1.0e117,1.0e118,1.0e119,
|
||||||
1.0e120,1.0e121,1.0e122,1.0e123,1.0e124,1.0e125,1.0e126,1.0e127,1.0e128,1.0e129,
|
1.0e120,1.0e121,1.0e122,1.0e123,1.0e124,1.0e125,1.0e126,1.0e127,1.0e128,1.0e129,
|
||||||
|
|
|
@ -73,7 +73,7 @@ out:
|
||||||
/* Add kernel cycles on proc entry */
|
/* Add kernel cycles on proc entry */
|
||||||
p->time = p->time + _tos->kcycles;
|
p->time = p->time + _tos->kcycles;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case Proftime:
|
case Proftime:
|
||||||
proftime: /* Subtract cycle counter on proc entry */
|
proftime: /* Subtract cycle counter on proc entry */
|
||||||
cycles((uvlong*)&t);
|
cycles((uvlong*)&t);
|
||||||
p->time = p->time - t;
|
p->time = p->time - t;
|
||||||
|
@ -104,7 +104,7 @@ _profout(void)
|
||||||
case Profuser: /* Subtract kernel cycles on proc entry */
|
case Profuser: /* Subtract kernel cycles on proc entry */
|
||||||
p->time = p->time - _tos->kcycles;
|
p->time = p->time - _tos->kcycles;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case Proftime:
|
case Proftime:
|
||||||
proftime: /* Add cycle counter on proc entry */
|
proftime: /* Add cycle counter on proc entry */
|
||||||
cycles((uvlong*)&t);
|
cycles((uvlong*)&t);
|
||||||
p->time = p->time + t;
|
p->time = p->time + t;
|
||||||
|
|
|
@ -91,7 +91,7 @@ quotestrdup(char *s)
|
||||||
|
|
||||||
if(_needsquotes(s, "elen) == 0)
|
if(_needsquotes(s, "elen) == 0)
|
||||||
return strdup(s);
|
return strdup(s);
|
||||||
|
|
||||||
ret = malloc(quotelen+1);
|
ret = malloc(quotelen+1);
|
||||||
if(ret == nil)
|
if(ret == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -117,7 +117,7 @@ quoterunestrdup(Rune *s)
|
||||||
|
|
||||||
if(_runeneedsquotes(s, "elen) == 0)
|
if(_runeneedsquotes(s, "elen) == 0)
|
||||||
return runestrdup(s);
|
return runestrdup(s);
|
||||||
|
|
||||||
ret = malloc((quotelen+1)*sizeof(Rune));
|
ret = malloc((quotelen+1)*sizeof(Rune));
|
||||||
if(ret == nil)
|
if(ret == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
|
||||||
Rune*
|
Rune*
|
||||||
runestrdup(Rune *s)
|
runestrdup(Rune *s)
|
||||||
{
|
{
|
||||||
Rune *ns;
|
Rune *ns;
|
||||||
|
|
||||||
ns = malloc(sizeof(Rune)*(runestrlen(s) + 1));
|
ns = malloc(sizeof(Rune)*(runestrlen(s) + 1));
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
|
||||||
char*
|
char*
|
||||||
strdup(char *s)
|
strdup(char *s)
|
||||||
{
|
{
|
||||||
char *ns;
|
char *ns;
|
||||||
|
|
||||||
ns = malloc(strlen(s) + 1);
|
ns = malloc(strlen(s) + 1);
|
||||||
|
|
|
@ -36,7 +36,7 @@ dec64(uchar *out, int lim, char *in, int n)
|
||||||
b24 = 0;
|
b24 = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
while(n-- > 0){
|
while(n-- > 0){
|
||||||
|
|
||||||
c = t64d[*(uchar*)in++];
|
c = t64d[*(uchar*)in++];
|
||||||
if(c == INVAL)
|
if(c == INVAL)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -76,7 +76,7 @@ sqrt(double arg)
|
||||||
/*
|
/*
|
||||||
* this is the program that generated the table.
|
* this is the program that generated the table.
|
||||||
* it calls sqrt by some other means.
|
* it calls sqrt by some other means.
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* main(void)
|
* main(void)
|
||||||
* {
|
* {
|
||||||
|
@ -90,7 +90,7 @@ sqrt(double arg)
|
||||||
* long ls;
|
* long ls;
|
||||||
* };
|
* };
|
||||||
* } u;
|
* } u;
|
||||||
*
|
*
|
||||||
* for(i=0; i<64; i++) {
|
* for(i=0; i<64; i++) {
|
||||||
* u.ms = (i<<15) | 0x3fe04000;
|
* u.ms = (i<<15) | 0x3fe04000;
|
||||||
* u.ls = 0;
|
* u.ls = 0;
|
||||||
|
|
|
@ -110,7 +110,7 @@ fout:
|
||||||
* whole thing repeated for backwards
|
* whole thing repeated for backwards
|
||||||
*/
|
*/
|
||||||
back:
|
back:
|
||||||
SUBCC $8,R9, R0
|
SUBCC $8,R9, R0
|
||||||
BL bout
|
BL bout
|
||||||
|
|
||||||
XOR R12,R13, R7
|
XOR R12,R13, R7
|
||||||
|
|
|
@ -76,7 +76,7 @@ sqrt(double arg)
|
||||||
/*
|
/*
|
||||||
* this is the program that generated the table.
|
* this is the program that generated the table.
|
||||||
* it calls sqrt by some other means.
|
* it calls sqrt by some other means.
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* main(void)
|
* main(void)
|
||||||
* {
|
* {
|
||||||
|
@ -90,7 +90,7 @@ sqrt(double arg)
|
||||||
* long ls;
|
* long ls;
|
||||||
* };
|
* };
|
||||||
* } u;
|
* } u;
|
||||||
*
|
*
|
||||||
* for(i=0; i<64; i++) {
|
* for(i=0; i<64; i++) {
|
||||||
* u.ms = (i<<15) | 0x3fe04000;
|
* u.ms = (i<<15) | 0x3fe04000;
|
||||||
* u.ls = 0;
|
* u.ls = 0;
|
||||||
|
|
|
@ -109,4 +109,4 @@ nomul1:
|
||||||
nomul2:
|
nomul2:
|
||||||
|
|
||||||
MOVW R9, 0(R7)
|
MOVW R9, 0(R7)
|
||||||
RETURN
|
RETURN
|
||||||
|
|
|
@ -705,55 +705,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ sqrt(double arg)
|
||||||
/*
|
/*
|
||||||
* this is the program that generated the table.
|
* this is the program that generated the table.
|
||||||
* it calls sqrt by some other means.
|
* it calls sqrt by some other means.
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* main(void)
|
* main(void)
|
||||||
* {
|
* {
|
||||||
|
@ -90,7 +90,7 @@ sqrt(double arg)
|
||||||
* long ls;
|
* long ls;
|
||||||
* };
|
* };
|
||||||
* } u;
|
* } u;
|
||||||
*
|
*
|
||||||
* for(i=0; i<64; i++) {
|
* for(i=0; i<64; i++) {
|
||||||
* u.ms = (i<<15) | 0x3fe04000;
|
* u.ms = (i<<15) | 0x3fe04000;
|
||||||
* u.ls = 0;
|
* u.ls = 0;
|
||||||
|
|
|
@ -705,55 +705,55 @@ _nev(Vlong lv, Vlong rv)
|
||||||
int
|
int
|
||||||
_ltv(Vlong lv, Vlong rv)
|
_ltv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lev(Vlong lv, Vlong rv)
|
_lev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi < (long)rv.hi ||
|
return (long)lv.hi < (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gtv(Vlong lv, Vlong rv)
|
_gtv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_gev(Vlong lv, Vlong rv)
|
_gev(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return (long)lv.hi > (long)rv.hi ||
|
return (long)lv.hi > (long)rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lov(Vlong lv, Vlong rv)
|
_lov(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo < rv.lo);
|
(lv.hi == rv.hi && lv.lo < rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_lsv(Vlong lv, Vlong rv)
|
_lsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi < rv.hi ||
|
return lv.hi < rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
(lv.hi == rv.hi && lv.lo <= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hiv(Vlong lv, Vlong rv)
|
_hiv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo > rv.lo);
|
(lv.hi == rv.hi && lv.lo > rv.lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_hsv(Vlong lv, Vlong rv)
|
_hsv(Vlong lv, Vlong rv)
|
||||||
{
|
{
|
||||||
return lv.hi > rv.hi ||
|
return lv.hi > rv.hi ||
|
||||||
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
(lv.hi == rv.hi && lv.lo >= rv.lo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue