Commit c7d5c438 authored by Russ Cox's avatar Russ Cox

runtime: adjust timediv to avoid _vasop; mark _subv okay

R=dvyukov
CC=golang-dev
https://golang.org/cl/12028046
parent 98cc58e2
......@@ -429,7 +429,7 @@ runtime·timediv(int64 v, int32 div, int32 *rem)
res = 0;
for(bit = 0x40000000; bit != 0; bit >>= 1) {
if(v >= (int64)bit*div) {
v -= (int64)bit*div;
v = v - (int64)bit*div;
res += bit;
}
}
......
......@@ -66,27 +66,20 @@ void runtime·abort(void);
void
_addv(Vlong *r, Vlong a, Vlong b)
{
ulong lo, hi;
lo = a.lo + b.lo;
hi = a.hi + b.hi;
if(lo < a.lo)
hi++;
r->lo = lo;
r->hi = hi;
r->lo = a.lo + b.lo;
r->hi = a.hi + b.hi;
if(r->lo < a.lo)
r->hi++;
}
#pragma textflag 7
void
_subv(Vlong *r, Vlong a, Vlong b)
{
ulong lo, hi;
lo = a.lo - b.lo;
hi = a.hi - b.hi;
if(lo > a.lo)
hi--;
r->lo = lo;
r->hi = hi;
r->lo = a.lo - b.lo;
r->hi = a.hi - b.hi;
if(r->lo > a.lo)
r->hi--;
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment