return (value & (sign - 1)) - (value & sign)
+def EXTS(value):
+ """ extends sign bit out from current MSB to all 256 bits
+ """
+ assert isinstance(value, SelectableInt)
+ return SelectableInt(exts(value.value, value.bits) & ((1 << 256)-1), 256)
+
def EXTS64(value):
- if isinstance(value, SelectableInt):
- value = value.value
- return SelectableInt(exts(value, 32) & ((1 << 64)-1), 64)
+ """ extends sign bit out from current MSB to 64 bits
+ """
+ assert isinstance(value, SelectableInt)
+ return SelectableInt(exts(value.value, value.bits) & ((1 << 64)-1), 64)
+# XXX should this explicitly extend from 32 to 64?
def EXTZ64(value):
if isinstance(value, SelectableInt):
value = value.value
return SelectableInt(value & ((1<<32)-1), 64)
+
def rotl(value, bits, wordlen):
mask = (1 << wordlen) - 1
bits = bits & (wordlen - 1)
# auto-generated by pywriter.py, do not edit or commit
from soc.decoder.isa.caller import ISACaller, inject
-from soc.decoder.helpers import (EXTS64, EXTZ64, ROTL64, ROTL32, MASK,)
+from soc.decoder.helpers import (EXTS, EXTS64, EXTZ64, ROTL64, ROTL32, MASK,)
from soc.decoder.selectable_int import SelectableInt
from soc.decoder.selectable_int import selectconcat as concat
from soc.decoder.orderedset import OrderedSet
if __name__ == '__main__':
isa = PyISAWriter()
- isa.write_pysource('fixedlogical')
+ isa.write_pysource('branch')
exit(0)
+ isa.write_pysource('fixedlogical')
isa.write_pysource('fixedstore')
isa.write_pysource('fixedload')
isa.write_pysource('comparefixed')