From: Luke Kenneth Casson Leighton Date: Sun, 11 Sep 2022 09:54:24 +0000 (+0100) Subject: add comments into CR5Operand class X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=987b53e0567b23852437901c54fc9e87ad931542;p=openpower-isa.git add comments into CR5Operand class --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 63db6856..994319bb 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -724,29 +724,31 @@ 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, + # settable by constructor + sshift = 3 # len(value) aka value.bits + vshift = 4 # 7-sshift + spshft = 2 # 5-sshift + spmask = (1<>2, bits=bits) + value = _SelectableInt(value=value.value>>spshft, bits=bits) spec = _SelectableInt(value=spec.value, bits=bits) #print ("spec", bin(spec.value), spec.bits) #print ("value", bin(value.value), value.bits) #print ("lsbs", bin(lsbs.value), lsbs.bits) - # this is silly these should be in a general base class, - # settable by constructor - vshift = 4 - sshift = 3 - spshft = 2 if vector: value = ((value << vshift) | (spec<