From f0e6fa50f146e8fddd4d837e179ae3e0eb0d0445 Mon Sep 17 00:00:00 2001 From: "mtnolan2640@5b3e5887a309d4a2372aaf5e76b851870f15ca92" Date: Mon, 24 Feb 2020 17:16:54 +0000 Subject: [PATCH] Add page for the decoder --- 3d_gpu/architecture/decoder.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 3d_gpu/architecture/decoder.mdwn diff --git a/3d_gpu/architecture/decoder.mdwn b/3d_gpu/architecture/decoder.mdwn new file mode 100644 index 000000000..5a6f18db6 --- /dev/null +++ b/3d_gpu/architecture/decoder.mdwn @@ -0,0 +1,18 @@ +# Decoder + +The decoder is in charge of translating the RISCV or POWER instruction stream into operations that can be handled by our backend. It will have an extra input bit, set via a MSR that will switch which architecture it treats an instruction as. + +## POWER + +### Fixed point instructions + - `addi`, `addis`, `mulli` - fairly straightforward - extract registers and immediate and translate to the appropriate op + - `addic`, `addic.`, `subfic` - similar to above, but now carry needs to be saved somewhere + - `add[o][.]`, `subf[o][.]`, `adde*`, `subfe*`, `addze*`, `neg*`, `mullw*`, `divw*` - These are more fun. They need to set the carry (if `.` is present) and overflow (if `o` is present) flags, as well as taking in the carry flag for the `e`xtended versions. + - `addex` - uses the overflow flag as a carry in, and if `CY` is set to 1, sets overflow like it would carry. + - `cmp`, `cmpi` - sets bits of the selected comparison result register based on whether the comparison result was greater than, less than, or equal to + - `andi.`, `ori`, `andis.`, `oris`, `xori`, `xoris` - similar to above, though the `and` versions set the flags in `CR0` + - `and*`, `or*`, `xor*`, `nand*`, `eqv*`, `andc*`, `orc*` - similar to the register-register arithmetic instructions above + + + +## RISCV -- 2.30.2