# ISA Pseudo-code ISA is the [[!wikipedia Instruction_set_architecture]] of a machine, the: CPU instructions, register set, memory model, etc, that describe the way a machine works. These pages contain (in a strict machine-readable subset of mdwn) the pseudo-code for all opcodes in the POWER v3.0B Public Spec * [[isa/bcd]] * [[isa/branch]] * [[isa/comparefixed]] * [[isa/condition]] * [[isa/fixedarith]] * [[isa/fixedload]] * [[isa/fixedlogical]] * [[isa/fixedshift]] * [[isa/fixedstore]] * [[isa/fixedtrap]] * [[isa/sprset]] * [[isa/stringldst]] * [[isa/system]] FP instructions: useful for testing * [[isa/fpload]] * [[isa/fpstore]] * [[isa/fpmove]] * [[isa/fparith]] * [[isa/fpcvt]] Scalar instructions added as part of [[sv/svp64]] development, these are all **DRAFT FORM** and they are all stand-alone Scalar (no hard dependency on Simple-V). Explanation of the rules for twin register targets (implicit RS, FRS) explained in SVP64 [[sv/svp64/appendix]] * [[isa/svfixedarith]] * [[isa/svfparith]] * [[isa/bitmanip]] * [[isa/av]] - Audio/Video includes minmax, sum of absolute difference etc. Scalar "Post-Increment" Draft Load/Store with Update * [[isa/pifixedload]] * [[isa/pifixedstore]] * [[isa/pifpload]] * [[isa/pifpstore]] Scalar "Post-Increment" Draft Load/Store with Shift * [[isa/pifixedloadshift]] * [[isa/pifixedstoreshift]] * [[isa/pifploadshift]] * [[isa/pifpstoreshift]] Part of the DRAFT Simple-V Specification: * [[isa/simplev]] A useful aide to finding Power ISA instructions: # Pseudocode syntax The syntax is shown in the v3.0B OpenPOWER Reference Manual. The implementation of a parser, using python-ply, is here: The parser is based on the python-ply GardenSnake.py example (except bugs were fixed in it, first). Extra tokens, in the lexer phase, are inserted dynamically into the stream to make the parser think that it is seeing python-like syntax where in fact it is not. Example: when a pseudocode keyword "THEN" is seen, this is substituted for ":". The keyword "ELSE" will also automatically have a second ":" token inserted in order to comply with python syntax. Thus the following pseudocode: if x = 1 then RT <- 1 else RT <- 0 results in the parser seeing the following python code: if x == 1: RT = 1 else RT = 0 To support this python-like syntax some of the pseudocode after extraction from the PDF had to be cleaned up and proper indentation added. Also worth noting as used in the above example: the following operators are used (see section 1.3 "Notation" of v3.0B PDF): * `<-` assignment, instead of "=" as in python * `=` equals comparator, instead of "==" as in python * `||` concatenate, done bitwise, in MSB0 order. * `>u` for unsigned greater (">" is signed) * `