summary refs log tree commit diff stats
path: root/Makefile
Commit message (Expand)AuthorAgeFilesLines
...
* make test: reduce verbosityhut2010-03-261-1/+1
* fixed make cleanhut2010-03-251-1/+1
* make clean: safer method of cleaninghut2010-03-221-1/+1
* make compile: create pyc files toohut2010-03-221-1/+2
* make test: don't use "clean" before "test"hut2010-03-211-1/+1
* make install: chmod after copyinghut2010-03-141-0/+2
* incremented verison number v1.0.4hut2010-03-121-1/+1
* make install: catch an exceptionhut2010-03-121-0/+4
* make push: removed "hut" repohut2010-03-121-1/+0
* misc changes, make installhut2010-03-121-7/+34
* make snapshot: changed the format of the filenamehut2010-03-081-2/+3
* make minimal_snapshot: snapshot with only neccessary fileshut2010-03-081-1/+13
* make clean: fixedhut2010-02-281-2/+2
* Makefile: added make info + some improvementshut2010-02-271-7/+22
* added make snapshothut2010-02-251-0/+4
* make clean: delete pyo files as well.hut2010-02-251-1/+1
* added Makefilehut2010-02-251-0/+39
or: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
fn abs n: int -> _/eax: int {
  compare n, 0
  {
    break-if->=
    negate n
  }
  return n
}

fn sgn n: int -> _/eax: int {
  compare n, 0
  {
    break-if-<=
    return 1
  }
  {
    break-if->=
    return -1
  }
  return 0
}

fn shift-left-by n: int, bits: int -> _/eax: int {
  var i/eax: int <- copy bits
  {
    compare i, 0
    break-if-<=
    shift-left n, 1
    i <- decrement
    loop
  }
  return n
}

fn shift-right-by n: int, bits: int -> _/eax: int {
  var i/eax: int <- copy bits
  {
    compare i, 0
    break-if-<=
    shift-right n, 1
    i <- decrement
    loop
  }
  return n
}

fn clear-lowest-bits _n: (addr int), bits: int {
  var dest/edi: (addr int) <- copy _n
  var n/eax: int <- copy *dest
  n <- shift-right-by n, bits
  n <- shift-left-by n, bits
  copy-to *dest, n
}