From b3a0288f15751bb467eb98734350872460c71e6f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 4 Apr 2023 14:02:13 +0100 Subject: [PATCH] comment about massive unnecessary code-duplication that should not have been done in the way it was, but it is a good step along the right lines because it a gets the job done by b producing the right answers that c get us to the simplified path in an incremental fashion. am adding this note in the source code to make sure that readers are aware --- src/openpower/decoder/isa/caller.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 9feec8b4..b3c680f3 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1370,6 +1370,22 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): self.namespace['SNZ'] = SelectableInt(bc_snz, 1) def get_kludged_op_add_ca_ov(self, inputs, inp_ca_ov): + """ this was not at all necessary to do. this function massively + duplicates - in a laborious and complex fashion - the contents of + the CSV files that were extracted two years ago from microwatt's + source code. A-inversion is the "inv A" column, output inversion + is the "inv out" column, carry-in equal to 0 or 1 or CA is the + "cry in" column + + all of that information is available in + self.instrs[ins_name].op_fields + where info is usually assigned to self.instrs[ins_name] + + https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=openpower/isatables/minor_31.csv;hb=HEAD + + the immediate constants are *also* decoded correctly and placed + usually by DecodeIn2Imm into operand2, as part of power_decoder2.py + """ def ca(a, b, ca_in, width): mask = (1 << width) - 1 y = (a & mask) + (b & mask) + ca_in -- 2.30.2