From 987b53e0567b23852437901c54fc9e87ad931542 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 11 Sep 2022 10:54:24 +0100 Subject: [PATCH] add comments into CR5Operand class --- src/openpower/decoder/power_insn.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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<