Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -class CR3Operand(RegisterOperand):
- +class CR5Operand(RegisterOperand):
- def spec(self, insn, record):
- def merge(vector, value, span, spec, spec_span):
- # this is silly these should be in a general base class,
- @@ -6,15 +6,22 @@
- vshift = 4
- sshift = 3
- spshft = 2
- + lsbshf = 0
- + lsbmsk = (1<<lsbshf)-1
- + # record the 2 lsbs first
- + lsbs = _SelectableInt(value=value.value&(lsbmsk), bits=lsbshf)
- bits = (len(span) + len(spec_span))
- - value = _SelectableInt(value=value.value, bits=bits)
- + value = _SelectableInt(value=value.value>>lsbshf, bits=bits)
- spec = _SelectableInt(value=spec.value, bits=bits)
- if vector:
- value = ((value << vshift) | (spec<<spshft))
- - span = (span[0:3] + spec_span + ('{0}', '{0}') + span[3:5])
- + span = (span[0:3] + spec_span + spshft*('{0}',) + span[3:5])
- else:
- value = ((spec << sshift) | value)
- - span = (('{0}', '{0}') + spec_span + span)
- + span = (spshft*('{0}',) + spec_span + span)
- + # add the 2 LSBs back in
- + v = (value.value << lsbshf) + lsbs.value
- + value = _SelectableInt(value=v, bits=bits+lsbshf)
- return (value, span)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement