split out instructions from openpower/isa/fixedarith.mdwn
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:04:00 +0000 (16:04 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:06:58 +0000 (16:06 -0700)
83 files changed:
openpower/isa/fixedarith.mdwn
openpower/isa/fixedarith/add.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/add_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addc.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addc_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/adde.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/adde_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addex.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addex_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addi.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addi_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addic..mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addic._code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addic.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addic_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addis.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addis_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addme.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addme_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addpcis.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addpcis_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addze.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/addze_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/darn.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/darn_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divd.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divd_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divde.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divde_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divdeu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divdeu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divdu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divdu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divw.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divw_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divwe.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divwe_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divweu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divweu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divwu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/divwu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddhd.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddhd_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddhdu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddhdu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddld.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/maddld_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modsd.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modsd_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modsw.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modsw_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modud.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/modud_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/moduw.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/moduw_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhd.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhd_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhdu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhdu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhw.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhw_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhwu.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulhwu_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulld.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulld_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulli.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mulli_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mullw.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/mullw_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/neg.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/neg_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subf.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subf_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfc.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfc_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfe.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfe_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfic.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfic_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfme.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfme_code.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfze.mdwn [new file with mode: 0644]
openpower/isa/fixedarith/subfze_code.mdwn [new file with mode: 0644]

index 4044ded9798ab2349f694de7a715cca8ec157e9a..bf824530edb672a6988a8e3e0c470ee884d37b1b 100644 (file)
 
 <!-- Section 3.3.9 Fixed-point arithmetic instructions. Pages 67 - 83 -->
 
-# Add Immediate
+[[!inline pagenames="openpower/isa/fixedarith/addi" raw="yes"]]
 
-D-Form
+[[!inline pagenames="openpower/isa/fixedarith/addis" raw="yes"]]
 
-* addi RT,RA,SI
+[[!inline pagenames="openpower/isa/fixedarith/addpcis" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/add" raw="yes"]]
 
-    RT <- (RA|0) + EXTS(SI)
+[[!inline pagenames="openpower/isa/fixedarith/subf" raw="yes"]]
 
-Special Registers Altered:
+[[!inline pagenames="openpower/isa/fixedarith/addic" raw="yes"]]
 
-    None
+[[!inline pagenames="openpower/isa/fixedarith/addic." raw="yes"]]
 
-# Add Immediate Shifted
+[[!inline pagenames="openpower/isa/fixedarith/subfic" raw="yes"]]
 
-D-Form
+[[!inline pagenames="openpower/isa/fixedarith/addc" raw="yes"]]
 
-* addis RT,RA,SI
+[[!inline pagenames="openpower/isa/fixedarith/subfc" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/adde" raw="yes"]]
 
-    RT <- (RA|0) + EXTS(SI || [0]*16)
+[[!inline pagenames="openpower/isa/fixedarith/subfe" raw="yes"]]
 
-Special Registers Altered:
+[[!inline pagenames="openpower/isa/fixedarith/addme" raw="yes"]]
 
-    None
+[[!inline pagenames="openpower/isa/fixedarith/subfme" raw="yes"]]
 
-# Add PC Immediate Shifted
+[[!inline pagenames="openpower/isa/fixedarith/addex" raw="yes"]]
 
-DX-Form
+[[!inline pagenames="openpower/isa/fixedarith/subfze" raw="yes"]]
 
-* addpcis RT,D
+[[!inline pagenames="openpower/isa/fixedarith/addze" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/neg" raw="yes"]]
 
-    D <- d0||d1||d2
-    RT <- NIA + EXTS(D || [0]*16)
+[[!inline pagenames="openpower/isa/fixedarith/mulli" raw="yes"]]
 
-Special Registers Altered:
+[[!inline pagenames="openpower/isa/fixedarith/mulhw" raw="yes"]]
 
-    None
+[[!inline pagenames="openpower/isa/fixedarith/mullw" raw="yes"]]
 
-# Add
+[[!inline pagenames="openpower/isa/fixedarith/mulhwu" raw="yes"]]
 
-XO-Form
+[[!inline pagenames="openpower/isa/fixedarith/divw" raw="yes"]]
 
-* add RT,RA,RB (OE=0 Rc=0)
-* add.  RT,RA,RB (OE=0 Rc=1)
-* addo RT,RA,RB (OE=1 Rc=0)
-* addo.  RT,RA,RB (OE=1 Rc=1)
+[[!inline pagenames="openpower/isa/fixedarith/divwu" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/divwe" raw="yes"]]
 
-    RT <- (RA) + (RB)
+[[!inline pagenames="openpower/isa/fixedarith/divweu" raw="yes"]]
 
-Special Registers Altered:
+[[!inline pagenames="openpower/isa/fixedarith/modsw" raw="yes"]]
 
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
+[[!inline pagenames="openpower/isa/fixedarith/moduw" raw="yes"]]
 
-# Subtract From
+[[!inline pagenames="openpower/isa/fixedarith/darn" raw="yes"]]
 
-XO-Form
+[[!inline pagenames="openpower/isa/fixedarith/mulld" raw="yes"]]
 
-* subf RT,RA,RB (OE=0 Rc=0)
-* subf.  RT,RA,RB (OE=0 Rc=1)
-* subfo RT,RA,RB (OE=1 Rc=0)
-* subfo.  RT,RA,RB (OE=1 Rc=1)
+[[!inline pagenames="openpower/isa/fixedarith/mulhd" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/mulhdu" raw="yes"]]
 
-    RT <- ¬(RA) + (RB) + 1
+[[!inline pagenames="openpower/isa/fixedarith/maddhd" raw="yes"]]
 
-Special Registers Altered:
+[[!inline pagenames="openpower/isa/fixedarith/maddhdu" raw="yes"]]
 
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
+[[!inline pagenames="openpower/isa/fixedarith/maddld" raw="yes"]]
 
-# Add Immediate Carrying
+[[!inline pagenames="openpower/isa/fixedarith/divd" raw="yes"]]
 
-D-Form
+[[!inline pagenames="openpower/isa/fixedarith/divdu" raw="yes"]]
 
-* addic RT,RA,SI
+[[!inline pagenames="openpower/isa/fixedarith/divde" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/fixedarith/divdeu" raw="yes"]]
 
-    RT <- (RA) + EXTS(SI)
+[[!inline pagenames="openpower/isa/fixedarith/modsd" raw="yes"]]
 
-Special Registers Altered:
-
-    CA CA32
-
-# Add Immediate Carrying and Record
-
-D-Form
-
-* addic. RT,RA,SI
-
-Pseudo-code:
-
-    RT <- (RA) + EXTS(SI)
-
-Special Registers Altered:
-
-    CR0 CA CA32
-
-# Subtract From Immediate Carrying
-
-D-Form
-
-* subfic RT,RA,SI
-
-Pseudo-code:
-
-    RT <- ¬(RA) + EXTS(SI) + 1
-
-Special Registers Altered:
-
-    CA CA32
-
-# Add Carrying
-
-XO-Form
-
-* addc RT,RA,RB (OE=0 Rc=0)
-* addc.  RT,RA,RB (OE=0 Rc=1)
-* addco RT,RA,RB (OE=1 Rc=0)
-* addco.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- (RA) + (RB)
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Subtract From Carrying
-
-XO-Form
-
-* subfc RT,RA,RB (OE=0 Rc=0)
-* subfc.  RT,RA,RB (OE=0 Rc=1)
-* subfco RT,RA,RB (OE=1 Rc=0)
-* subfco.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- ¬(RA) + (RB) + 1
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Add Extended
-
-XO-Form
-
-* adde RT,RA,RB (OE=0 Rc=0)
-* adde.  RT,RA,RB (OE=0 Rc=1)
-* addeo RT,RA,RB (OE=1 Rc=0)
-* addeo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- (RA) + (RB) + CA
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Subtract From Extended
-
-XO-Form
-
-* subfe RT,RA,RB (OE=0 Rc=0)
-* subfe.  RT,RA,RB (OE=0 Rc=1)
-* subfeo RT,RA,RB (OE=1 Rc=0)
-* subfeo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- ¬(RA) + (RB) + CA
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Add to Minus One Extended
-
-XO-Form
-
-* addme RT,RA (OE=0 Rc=0)
-* addme.  RT,RA (OE=0 Rc=1)
-* addmeo RT,RA (OE=1 Rc=0)
-* addmeo.  RT,RA (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- (RA) + CA - 1
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Subtract From Minus One Extended
-
-XO-Form
-
-* subfme RT,RA (OE=0 Rc=0)
-* subfme.  RT,RA (OE=0 Rc=1)
-* subfmeo RT,RA (OE=1 Rc=0)
-* subfmeo.  RT,RA (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- ¬(RA) + CA - 1
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Add Extended using alternate carry bit
-
-Z23-Form
-
-* addex RT,RA,RB,CY
-
-Pseudo-code:
-
-    if CY=0 then RT <- (RA) + (RB) + OV
-
-Special Registers Altered:
-
-    OV OV32                (if CY=0 )
-
-# Subtract From Zero Extended
-
-XO-Form
-
-* subfze RT,RA (OE=0 Rc=0)
-* subfze.  RT,RA (OE=0 Rc=1)
-* subfzeo RT,RA (OE=1 Rc=0)
-* subfzeo.  RT,RA (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- ¬(RA) + CA
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Add to Zero Extended
-
-XO-Form
-
-* addze RT,RA (OE=0 Rc=0)
-* addze.  RT,RA (OE=0 Rc=1)
-* addzeo RT,RA (OE=1 Rc=0)
-* addzeo.  RT,RA (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- (RA) + CA
-
-Special Registers Altered:
-
-    CA CA32
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Negate
-
-XO-Form
-
-* neg RT,RA (OE=0 Rc=0)
-* neg.  RT,RA (OE=0 Rc=1)
-* nego RT,RA (OE=1 Rc=0)
-* nego.  RT,RA (OE=1 Rc=1)
-
-Pseudo-code:
-
-    RT <- ¬(RA) + 1
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Multiply Low Immediate
-
-D-Form
-
-* mulli RT,RA,SI
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- MULS((RA), EXTS(SI))
-    RT <- prod[XLEN:(XLEN*2)-1]
-
-Special Registers Altered:
-
-    None
-
-# Multiply High Word
-
-XO-Form
-
-* mulhw RT,RA,RB (Rc=0)
-* mulhw.  RT,RA,RB (Rc=1)
-
-Pseudo-code:
-
-    prod[0:XLEN-1] <- MULS((RA)[XLEN/2:XLEN-1], (RB)[XLEN/2:XLEN-1])
-    RT[XLEN/2:XLEN-1] <- prod[0:(XLEN/2)-1]
-    RT[0:(XLEN/2)-1] <- undefined(prod[0:(XLEN/2)-1])
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-
-# Multiply Low Word
-
-XO-Form
-
-* mullw RT,RA,RB (OE=0 Rc=0)
-* mullw.  RT,RA,RB (OE=0 Rc=1)
-* mullwo RT,RA,RB (OE=1 Rc=0)
-* mullwo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    prod[0:XLEN-1] <- MULS((RA)[XLEN/2:XLEN-1], (RB)[XLEN/2:XLEN-1])
-    RT <- prod
-    overflow <- ((prod[0:XLEN/2] != [0]*((XLEN/2)+1)) &
-                 (prod[0:XLEN/2] != [1]*((XLEN/2)+1)))
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Multiply High Word Unsigned
-
-XO-Form
-
-* mulhwu RT,RA,RB (Rc=0)
-* mulhwu.  RT,RA,RB (Rc=1)
-
-Pseudo-code:
-
-    prod[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] * (RB)[XLEN/2:XLEN-1]
-    RT[XLEN/2:XLEN-1] <- prod[0:(XLEN/2)-1]
-    RT[0:(XLEN/2)-1] <- undefined(prod[0:(XLEN/2)-1])
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-
-# Divide Word
-
-XO-Form
-
-* divw RT,RA,RB (OE=0 Rc=0)
-* divw.  RT,RA,RB (OE=0 Rc=1)
-* divwo RT,RA,RB (OE=1 Rc=0)
-* divwo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
-    divisor[0:(XLEN/2)-1] <- (RB) [XLEN/2:XLEN-1]
-    if (((dividend = (0b1 || ([0b0] * ((XLEN/2)-1)))) &
-         (divisor = [1]*(XLEN/2))) |
-         (divisor = [0]*(XLEN/2))) then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT[XLEN/2:XLEN-1] <- DIVS(dividend, divisor)
-        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
-        overflow <- 0
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-    SO OV OV32                              (if OE=1)
-
-# Divide Word Unsigned
-
-XO-Form
-
-* divwu RT,RA,RB (OE=0 Rc=0)
-* divwu.  RT,RA,RB (OE=0 Rc=1)
-* divwuo RT,RA,RB (OE=1 Rc=0)
-* divwuo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
-    divisor[0:(XLEN/2)-1] <- (RB)[XLEN/2:XLEN-1]
-    if divisor != 0 then
-        RT[XLEN/2:XLEN-1] <- dividend / divisor
-        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
-        overflow <- 0
-    else
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-    SO OV OV32                              (if OE=1)
-
-# Divide Word Extended
-
-XO-Form
-
-* divwe RT,RA,RB (OE=0 Rc=0)
-* divwe.  RT,RA,RB (OE=0 Rc=1)
-* divweo RT,RA,RB (OE=1 Rc=0)
-* divweo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] || [0]*(XLEN/2)
-    divisor[0:XLEN-1] <- EXTS64((RB)[XLEN/2:XLEN-1])
-    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
-         (divisor = [1]*XLEN)) |
-         (divisor = [0]*XLEN)) then
-        overflow <- 1
-    else
-        result <- DIVS(dividend, divisor)
-        result_half[0:XLEN-1] <- EXTS64(result[XLEN/2:XLEN-1])
-        if (result_half = result) then
-            RT[XLEN/2:XLEN-1] <- result[XLEN/2:XLEN-1]
-            RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
-            overflow <- 0
-        else
-            overflow <- 1
-    if overflow = 1 then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-    SO OV OV32                              (if OE=1)
-
-# Divide Word Extended Unsigned
-
-XO-Form
-
-* divweu RT,RA,RB (OE=0 Rc=0)
-* divweu.  RT,RA,RB (OE=0 Rc=1)
-* divweuo RT,RA,RB (OE=1 Rc=0)
-* divweuo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] || [0]*(XLEN/2)
-    divisor[0:XLEN-1] <- [0]*(XLEN/2) || (RB)[XLEN/2:XLEN-1]
-    if (divisor = [0]*XLEN) then
-        overflow <- 1
-    else
-        result <- dividend / divisor
-        if RA[XLEN/2:XLEN-1] <u RB[XLEN/2:XLEN-1] then
-            RT[XLEN/2:XLEN-1] <- result[XLEN/2:XLEN-1]
-            RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
-            overflow <- 0
-        else
-            overflow <- 1
-    if overflow = 1 then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-
-Special Registers Altered:
-
-    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
-    SO OV OV32                              (if OE=1)
-
-# Modulo Signed Word
-
-X-Form
-
-* modsw RT,RA,RB
-
-Pseudo-code:
-
-    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
-    divisor[0:(XLEN/2)-1] <- (RB)[XLEN/2:XLEN-1]
-    if (((dividend = (0b1 || ([0b0] * ((XLEN/2)-1)))) &
-         (divisor = [1]*(XLEN/2))) |
-         (divisor = [0]*(XLEN/2))) then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT[0:XLEN-1] <- EXTS64(MODS(dividend, divisor))
-        RT[0:(XLEN/2)-1] <- undefined(RT[0:(XLEN/2)-1])
-        overflow <- 0
-
-Special Registers Altered:
-
-    None
-
-# Modulo Unsigned Word
-
-X-Form
-
-* moduw RT,RA,RB
-
-Pseudo-code:
-
-    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:63]
-    divisor [0:(XLEN/2)-1] <- (RB)[XLEN/2:63]
-    if divisor = [0]*(XLEN/2) then
-        RT[0:XLEN-1] <- undefined([0]*64)
-        overflow <- 1
-    else
-        RT[XLEN/2:XLEN-1] <- dividend % divisor
-        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
-        overflow <- 0
-
-Special Registers Altered:
-
-    None
-
-# Deliver A Random Number
-
-X-Form
-
-* darn RT,L3
-
-Pseudo-code:
-
-    RT <- random(L3)
-
-Special Registers Altered:
-
-    none
-
-# Multiply Low Doubleword
-
-XO-Form
-
-* mulld RT,RA,RB (OE=0 Rc=0)
-* mulld.  RT,RA,RB (OE=0 Rc=1)
-* mulldo RT,RA,RB (OE=1 Rc=0)
-* mulldo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
-    RT <- prod[XLEN:(XLEN*2)-1]
-    overflow <- ((prod[0:XLEN] != [0]*(XLEN+1)) &
-                 (prod[0:XLEN] != [1]*(XLEN+1)))
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Multiply High Doubleword
-
-XO-Form
-
-* mulhd RT,RA,RB (Rc=0)
-* mulhd.  RT,RA,RB (Rc=1)
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
-    RT <- prod[0:XLEN-1]
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-
-# Multiply High Doubleword Unsigned
-
-XO-Form
-
-* mulhdu RT,RA,RB (Rc=0)
-* mulhdu.  RT,RA,RB (Rc=1)
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- (RA) * (RB)
-    RT <- prod[0:XLEN-1]
-
-Special Registers Altered:
-
-    CR0                    (if Rc=1)
-
-# Multiply-Add High Doubleword VA-Form
-
-VA-Form
-
-* maddhd RT,RA,RB,RC
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
-    sum[0:(XLEN*2)-1] <- prod + EXTS(RC)[0:XLEN*2]
-    RT <- sum[0:XLEN-1]
-
-Special Registers Altered:
-
-    None
-
-# Multiply-Add High Doubleword Unsigned
-
-VA-Form
-
-* maddhdu RT,RA,RB,RC
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- (RA) * (RB)
-    sum[0:(XLEN*2)-1] <- prod + EXTZ(RC)
-    RT <- sum[0:XLEN-1]
-
-Special Registers Altered:
-
-    None
-
-# Multiply-Add Low Doubleword
-
-VA-Form
-
-* maddld RT,RA,RB,RC
-
-Pseudo-code:
-
-    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
-    sum[0:(XLEN*2)-1] <- prod + EXTS(RC)
-    RT <- sum[XLEN:(XLEN*2)-1]
-
-Special Registers Altered:
-
-    None
-
-# Divide Doubleword
-
-XO-Form
-
-* divd RT,RA,RB (OE=0 Rc=0)
-* divd.  RT,RA,RB (OE=0 Rc=1)
-* divdo RT,RA,RB (OE=1 Rc=0)
-* divdo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:XLEN-1] <- (RA)
-    divisor[0:XLEN-1] <- (RB)
-    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
-         (divisor = [1]*XLEN)) |
-         (divisor = [0]*XLEN)) then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT <- DIVS(dividend, divisor)
-        overflow <- 0
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Divide Doubleword Unsigned
-
-XO-Form
-
-* divdu RT,RA,RB (OE=0 Rc=0)
-* divdu.  RT,RA,RB (OE=0 Rc=1)
-* divduo RT,RA,RB (OE=1 Rc=0)
-* divduo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:XLEN-1] <- (RA)
-    divisor[0:XLEN-1] <- (RB)
-    if (divisor = [0]*XLEN) then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT <- dividend / divisor
-        overflow <- 0
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Divide Doubleword Extended
-
-XO-Form
-
-* divde RT,RA,RB (OE=0 Rc=0)
-* divde.  RT,RA,RB (OE=0 Rc=1)
-* divdeo RT,RA,RB (OE=1 Rc=0)
-* divdeo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:(XLEN*2)-1] <- (RA) || [0]*XLEN
-    divisor[0:(XLEN*2)-1] <- EXTS128((RB))
-    if (((dividend = (0b1 || ([0b0] * ((XLEN*2)-1)))) &
-         (divisor = [1]*(XLEN*2))) |
-         (divisor = [0]*(XLEN*2))) then
-        overflow <- 1
-    else
-        result <- DIVS(dividend, divisor)
-        result_half[0:(XLEN*2)-1] <- EXTS128(result[XLEN:(XLEN*2)-1])
-        if (result_half = result) then
-            RT <- result[XLEN:(XLEN*2)-1]
-            overflow <- 0
-        else
-            overflow <- 1
-    if overflow = 1 then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Divide Doubleword Extended Unsigned
-
-XO-Form
-
-* divdeu RT,RA,RB (OE=0 Rc=0)
-* divdeu.  RT,RA,RB (OE=0 Rc=1)
-* divdeuo RT,RA,RB (OE=1 Rc=0)
-* divdeuo.  RT,RA,RB (OE=1 Rc=1)
-
-Pseudo-code:
-
-    dividend[0:(XLEN*2)-1] <- (RA) || [0]*XLEN
-    divisor[0:(XLEN*2)-1] <- [0]*XLEN || (RB)
-    if divisor = [0]*(XLEN*2) then
-        overflow <- 1
-    else
-        result <- dividend / divisor
-        if (RA) <u (RB) then
-            RT <- result[XLEN:(XLEN*2)-1]
-            overflow <- 0
-        else
-            overflow <- 1
-    if overflow = 1 then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-
-Special Registers Altered:
-
-    CR0                     (if Rc=1)
-    SO OV OV32             (if OE=1)
-
-# Modulo Signed Doubleword
-
-X-Form
-
-* modsd RT,RA,RB
-
-Pseudo-code:
-
-    dividend <- (RA)
-    divisor <- (RB)
-    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
-         (divisor = [1]*XLEN)) |
-         (divisor = [0]*XLEN)) then
-        RT[0:63] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT <- MODS(dividend, divisor)
-        overflow <- 0
-
-Special Registers Altered:
-
-    None
-
-# Modulo Unsigned Doubleword
-
-X-Form
-
-* modud RT,RA,RB
-
-Pseudo-code:
-
-    dividend <- (RA)
-    divisor <- (RB)
-    if (divisor = [0]*XLEN) then
-        RT[0:XLEN-1] <- undefined([0]*XLEN)
-        overflow <- 1
-    else
-        RT <- dividend % divisor
-        overflow <- 0
-
-Special Registers Altered:
-
-    None
-
-<!-- Checked March 2021 -->
+[[!inline pagenames="openpower/isa/fixedarith/modud" raw="yes"]]
diff --git a/openpower/isa/fixedarith/add.mdwn b/openpower/isa/fixedarith/add.mdwn
new file mode 100644 (file)
index 0000000..d35fca2
--- /dev/null
@@ -0,0 +1,17 @@
+# Add
+
+XO-Form
+
+* add RT,RA,RB (OE=0 Rc=0)
+* add.  RT,RA,RB (OE=0 Rc=1)
+* addo RT,RA,RB (OE=1 Rc=0)
+* addo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/add_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/add_code.mdwn b/openpower/isa/fixedarith/add_code.mdwn
new file mode 100644 (file)
index 0000000..056a153
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + (RB)
diff --git a/openpower/isa/fixedarith/addc.mdwn b/openpower/isa/fixedarith/addc.mdwn
new file mode 100644 (file)
index 0000000..359e844
--- /dev/null
@@ -0,0 +1,18 @@
+# Add Carrying
+
+XO-Form
+
+* addc RT,RA,RB (OE=0 Rc=0)
+* addc.  RT,RA,RB (OE=0 Rc=1)
+* addco RT,RA,RB (OE=1 Rc=0)
+* addco.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addc_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/addc_code.mdwn b/openpower/isa/fixedarith/addc_code.mdwn
new file mode 100644 (file)
index 0000000..056a153
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + (RB)
diff --git a/openpower/isa/fixedarith/adde.mdwn b/openpower/isa/fixedarith/adde.mdwn
new file mode 100644 (file)
index 0000000..1b2c064
--- /dev/null
@@ -0,0 +1,18 @@
+# Add Extended
+
+XO-Form
+
+* adde RT,RA,RB (OE=0 Rc=0)
+* adde.  RT,RA,RB (OE=0 Rc=1)
+* addeo RT,RA,RB (OE=1 Rc=0)
+* addeo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/adde_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/adde_code.mdwn b/openpower/isa/fixedarith/adde_code.mdwn
new file mode 100644 (file)
index 0000000..2f3ce72
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + (RB) + CA
diff --git a/openpower/isa/fixedarith/addex.mdwn b/openpower/isa/fixedarith/addex.mdwn
new file mode 100644 (file)
index 0000000..a18238c
--- /dev/null
@@ -0,0 +1,13 @@
+# Add Extended using alternate carry bit
+
+Z23-Form
+
+* addex RT,RA,RB,CY
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addex_code" raw="yes"]]
+
+Special Registers Altered:
+
+    OV OV32                (if CY=0 )
diff --git a/openpower/isa/fixedarith/addex_code.mdwn b/openpower/isa/fixedarith/addex_code.mdwn
new file mode 100644 (file)
index 0000000..2d9bb4f
--- /dev/null
@@ -0,0 +1 @@
+    if CY=0 then RT <- (RA) + (RB) + OV
diff --git a/openpower/isa/fixedarith/addi.mdwn b/openpower/isa/fixedarith/addi.mdwn
new file mode 100644 (file)
index 0000000..f8ecaca
--- /dev/null
@@ -0,0 +1,13 @@
+# Add Immediate
+
+D-Form
+
+* addi RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addi_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/addi_code.mdwn b/openpower/isa/fixedarith/addi_code.mdwn
new file mode 100644 (file)
index 0000000..5d226be
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA|0) + EXTS(SI)
diff --git a/openpower/isa/fixedarith/addic..mdwn b/openpower/isa/fixedarith/addic..mdwn
new file mode 100644 (file)
index 0000000..dec27d5
--- /dev/null
@@ -0,0 +1,13 @@
+# Add Immediate Carrying and Record
+
+D-Form
+
+* addic. RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addic._code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 CA CA32
diff --git a/openpower/isa/fixedarith/addic._code.mdwn b/openpower/isa/fixedarith/addic._code.mdwn
new file mode 100644 (file)
index 0000000..c90b4dd
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + EXTS(SI)
diff --git a/openpower/isa/fixedarith/addic.mdwn b/openpower/isa/fixedarith/addic.mdwn
new file mode 100644 (file)
index 0000000..798a213
--- /dev/null
@@ -0,0 +1,13 @@
+# Add Immediate Carrying
+
+D-Form
+
+* addic RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addic_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
diff --git a/openpower/isa/fixedarith/addic_code.mdwn b/openpower/isa/fixedarith/addic_code.mdwn
new file mode 100644 (file)
index 0000000..c90b4dd
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + EXTS(SI)
diff --git a/openpower/isa/fixedarith/addis.mdwn b/openpower/isa/fixedarith/addis.mdwn
new file mode 100644 (file)
index 0000000..e5a02a7
--- /dev/null
@@ -0,0 +1,13 @@
+# Add Immediate Shifted
+
+D-Form
+
+* addis RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addis_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/addis_code.mdwn b/openpower/isa/fixedarith/addis_code.mdwn
new file mode 100644 (file)
index 0000000..5ea3670
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA|0) + EXTS(SI || [0]*16)
diff --git a/openpower/isa/fixedarith/addme.mdwn b/openpower/isa/fixedarith/addme.mdwn
new file mode 100644 (file)
index 0000000..64e089d
--- /dev/null
@@ -0,0 +1,18 @@
+# Add to Minus One Extended
+
+XO-Form
+
+* addme RT,RA (OE=0 Rc=0)
+* addme.  RT,RA (OE=0 Rc=1)
+* addmeo RT,RA (OE=1 Rc=0)
+* addmeo.  RT,RA (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addme_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/addme_code.mdwn b/openpower/isa/fixedarith/addme_code.mdwn
new file mode 100644 (file)
index 0000000..240998f
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + CA - 1
diff --git a/openpower/isa/fixedarith/addpcis.mdwn b/openpower/isa/fixedarith/addpcis.mdwn
new file mode 100644 (file)
index 0000000..ad6fef9
--- /dev/null
@@ -0,0 +1,13 @@
+# Add PC Immediate Shifted
+
+DX-Form
+
+* addpcis RT,D
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addpcis_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/addpcis_code.mdwn b/openpower/isa/fixedarith/addpcis_code.mdwn
new file mode 100644 (file)
index 0000000..6499756
--- /dev/null
@@ -0,0 +1,2 @@
+    D <- d0||d1||d2
+    RT <- NIA + EXTS(D || [0]*16)
diff --git a/openpower/isa/fixedarith/addze.mdwn b/openpower/isa/fixedarith/addze.mdwn
new file mode 100644 (file)
index 0000000..0163af0
--- /dev/null
@@ -0,0 +1,18 @@
+# Add to Zero Extended
+
+XO-Form
+
+* addze RT,RA (OE=0 Rc=0)
+* addze.  RT,RA (OE=0 Rc=1)
+* addzeo RT,RA (OE=1 Rc=0)
+* addzeo.  RT,RA (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/addze_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/addze_code.mdwn b/openpower/isa/fixedarith/addze_code.mdwn
new file mode 100644 (file)
index 0000000..e290a92
--- /dev/null
@@ -0,0 +1 @@
+    RT <- (RA) + CA
diff --git a/openpower/isa/fixedarith/darn.mdwn b/openpower/isa/fixedarith/darn.mdwn
new file mode 100644 (file)
index 0000000..5322b99
--- /dev/null
@@ -0,0 +1,13 @@
+# Deliver A Random Number
+
+X-Form
+
+* darn RT,L3
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/darn_code" raw="yes"]]
+
+Special Registers Altered:
+
+    none
diff --git a/openpower/isa/fixedarith/darn_code.mdwn b/openpower/isa/fixedarith/darn_code.mdwn
new file mode 100644 (file)
index 0000000..22aea60
--- /dev/null
@@ -0,0 +1 @@
+    RT <- random(L3)
diff --git a/openpower/isa/fixedarith/divd.mdwn b/openpower/isa/fixedarith/divd.mdwn
new file mode 100644 (file)
index 0000000..fd23e7b
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Doubleword
+
+XO-Form
+
+* divd RT,RA,RB (OE=0 Rc=0)
+* divd.  RT,RA,RB (OE=0 Rc=1)
+* divdo RT,RA,RB (OE=1 Rc=0)
+* divdo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divd_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/divd_code.mdwn b/openpower/isa/fixedarith/divd_code.mdwn
new file mode 100644 (file)
index 0000000..0206b44
--- /dev/null
@@ -0,0 +1,10 @@
+    dividend[0:XLEN-1] <- (RA)
+    divisor[0:XLEN-1] <- (RB)
+    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
+         (divisor = [1]*XLEN)) |
+         (divisor = [0]*XLEN)) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT <- DIVS(dividend, divisor)
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/divde.mdwn b/openpower/isa/fixedarith/divde.mdwn
new file mode 100644 (file)
index 0000000..9777b6f
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Doubleword Extended
+
+XO-Form
+
+* divde RT,RA,RB (OE=0 Rc=0)
+* divde.  RT,RA,RB (OE=0 Rc=1)
+* divdeo RT,RA,RB (OE=1 Rc=0)
+* divdeo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divde_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/divde_code.mdwn b/openpower/isa/fixedarith/divde_code.mdwn
new file mode 100644 (file)
index 0000000..bc4707e
--- /dev/null
@@ -0,0 +1,16 @@
+    dividend[0:(XLEN*2)-1] <- (RA) || [0]*XLEN
+    divisor[0:(XLEN*2)-1] <- EXTS128((RB))
+    if (((dividend = (0b1 || ([0b0] * ((XLEN*2)-1)))) &
+         (divisor = [1]*(XLEN*2))) |
+         (divisor = [0]*(XLEN*2))) then
+        overflow <- 1
+    else
+        result <- DIVS(dividend, divisor)
+        result_half[0:(XLEN*2)-1] <- EXTS128(result[XLEN:(XLEN*2)-1])
+        if (result_half = result) then
+            RT <- result[XLEN:(XLEN*2)-1]
+            overflow <- 0
+        else
+            overflow <- 1
+    if overflow = 1 then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
diff --git a/openpower/isa/fixedarith/divdeu.mdwn b/openpower/isa/fixedarith/divdeu.mdwn
new file mode 100644 (file)
index 0000000..eb47f6d
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Doubleword Extended Unsigned
+
+XO-Form
+
+* divdeu RT,RA,RB (OE=0 Rc=0)
+* divdeu.  RT,RA,RB (OE=0 Rc=1)
+* divdeuo RT,RA,RB (OE=1 Rc=0)
+* divdeuo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divdeu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/divdeu_code.mdwn b/openpower/isa/fixedarith/divdeu_code.mdwn
new file mode 100644 (file)
index 0000000..f44a9fe
--- /dev/null
@@ -0,0 +1,13 @@
+    dividend[0:(XLEN*2)-1] <- (RA) || [0]*XLEN
+    divisor[0:(XLEN*2)-1] <- [0]*XLEN || (RB)
+    if divisor = [0]*(XLEN*2) then
+        overflow <- 1
+    else
+        result <- dividend / divisor
+        if (RA) <u (RB) then
+            RT <- result[XLEN:(XLEN*2)-1]
+            overflow <- 0
+        else
+            overflow <- 1
+    if overflow = 1 then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
diff --git a/openpower/isa/fixedarith/divdu.mdwn b/openpower/isa/fixedarith/divdu.mdwn
new file mode 100644 (file)
index 0000000..0f4ed86
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Doubleword Unsigned
+
+XO-Form
+
+* divdu RT,RA,RB (OE=0 Rc=0)
+* divdu.  RT,RA,RB (OE=0 Rc=1)
+* divduo RT,RA,RB (OE=1 Rc=0)
+* divduo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divdu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/divdu_code.mdwn b/openpower/isa/fixedarith/divdu_code.mdwn
new file mode 100644 (file)
index 0000000..d44bbd2
--- /dev/null
@@ -0,0 +1,8 @@
+    dividend[0:XLEN-1] <- (RA)
+    divisor[0:XLEN-1] <- (RB)
+    if (divisor = [0]*XLEN) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT <- dividend / divisor
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/divw.mdwn b/openpower/isa/fixedarith/divw.mdwn
new file mode 100644 (file)
index 0000000..5d7b9df
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Word
+
+XO-Form
+
+* divw RT,RA,RB (OE=0 Rc=0)
+* divw.  RT,RA,RB (OE=0 Rc=1)
+* divwo RT,RA,RB (OE=1 Rc=0)
+* divwo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divw_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
+    SO OV OV32                              (if OE=1)
diff --git a/openpower/isa/fixedarith/divw_code.mdwn b/openpower/isa/fixedarith/divw_code.mdwn
new file mode 100644 (file)
index 0000000..32f1aca
--- /dev/null
@@ -0,0 +1,11 @@
+    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
+    divisor[0:(XLEN/2)-1] <- (RB) [XLEN/2:XLEN-1]
+    if (((dividend = (0b1 || ([0b0] * ((XLEN/2)-1)))) &
+         (divisor = [1]*(XLEN/2))) |
+         (divisor = [0]*(XLEN/2))) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT[XLEN/2:XLEN-1] <- DIVS(dividend, divisor)
+        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/divwe.mdwn b/openpower/isa/fixedarith/divwe.mdwn
new file mode 100644 (file)
index 0000000..da2c80e
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Word Extended
+
+XO-Form
+
+* divwe RT,RA,RB (OE=0 Rc=0)
+* divwe.  RT,RA,RB (OE=0 Rc=1)
+* divweo RT,RA,RB (OE=1 Rc=0)
+* divweo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divwe_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
+    SO OV OV32                              (if OE=1)
diff --git a/openpower/isa/fixedarith/divwe_code.mdwn b/openpower/isa/fixedarith/divwe_code.mdwn
new file mode 100644 (file)
index 0000000..002d119
--- /dev/null
@@ -0,0 +1,17 @@
+    dividend[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] || [0]*(XLEN/2)
+    divisor[0:XLEN-1] <- EXTS64((RB)[XLEN/2:XLEN-1])
+    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
+         (divisor = [1]*XLEN)) |
+         (divisor = [0]*XLEN)) then
+        overflow <- 1
+    else
+        result <- DIVS(dividend, divisor)
+        result_half[0:XLEN-1] <- EXTS64(result[XLEN/2:XLEN-1])
+        if (result_half = result) then
+            RT[XLEN/2:XLEN-1] <- result[XLEN/2:XLEN-1]
+            RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
+            overflow <- 0
+        else
+            overflow <- 1
+    if overflow = 1 then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
diff --git a/openpower/isa/fixedarith/divweu.mdwn b/openpower/isa/fixedarith/divweu.mdwn
new file mode 100644 (file)
index 0000000..e9fdced
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Word Extended Unsigned
+
+XO-Form
+
+* divweu RT,RA,RB (OE=0 Rc=0)
+* divweu.  RT,RA,RB (OE=0 Rc=1)
+* divweuo RT,RA,RB (OE=1 Rc=0)
+* divweuo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divweu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
+    SO OV OV32                              (if OE=1)
diff --git a/openpower/isa/fixedarith/divweu_code.mdwn b/openpower/isa/fixedarith/divweu_code.mdwn
new file mode 100644 (file)
index 0000000..5c7de09
--- /dev/null
@@ -0,0 +1,14 @@
+    dividend[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] || [0]*(XLEN/2)
+    divisor[0:XLEN-1] <- [0]*(XLEN/2) || (RB)[XLEN/2:XLEN-1]
+    if (divisor = [0]*XLEN) then
+        overflow <- 1
+    else
+        result <- dividend / divisor
+        if RA[XLEN/2:XLEN-1] <u RB[XLEN/2:XLEN-1] then
+            RT[XLEN/2:XLEN-1] <- result[XLEN/2:XLEN-1]
+            RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
+            overflow <- 0
+        else
+            overflow <- 1
+    if overflow = 1 then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
diff --git a/openpower/isa/fixedarith/divwu.mdwn b/openpower/isa/fixedarith/divwu.mdwn
new file mode 100644 (file)
index 0000000..7970e96
--- /dev/null
@@ -0,0 +1,17 @@
+# Divide Word Unsigned
+
+XO-Form
+
+* divwu RT,RA,RB (OE=0 Rc=0)
+* divwu.  RT,RA,RB (OE=0 Rc=1)
+* divwuo RT,RA,RB (OE=1 Rc=0)
+* divwuo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/divwu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
+    SO OV OV32                              (if OE=1)
diff --git a/openpower/isa/fixedarith/divwu_code.mdwn b/openpower/isa/fixedarith/divwu_code.mdwn
new file mode 100644 (file)
index 0000000..d3cfce4
--- /dev/null
@@ -0,0 +1,9 @@
+    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
+    divisor[0:(XLEN/2)-1] <- (RB)[XLEN/2:XLEN-1]
+    if divisor != 0 then
+        RT[XLEN/2:XLEN-1] <- dividend / divisor
+        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
+        overflow <- 0
+    else
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
diff --git a/openpower/isa/fixedarith/maddhd.mdwn b/openpower/isa/fixedarith/maddhd.mdwn
new file mode 100644 (file)
index 0000000..e85326b
--- /dev/null
@@ -0,0 +1,13 @@
+# Multiply-Add High Doubleword VA-Form
+
+VA-Form
+
+* maddhd RT,RA,RB,RC
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/maddhd_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/maddhd_code.mdwn b/openpower/isa/fixedarith/maddhd_code.mdwn
new file mode 100644 (file)
index 0000000..7b73ad6
--- /dev/null
@@ -0,0 +1,3 @@
+    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
+    sum[0:(XLEN*2)-1] <- prod + EXTS(RC)[0:XLEN*2]
+    RT <- sum[0:XLEN-1]
diff --git a/openpower/isa/fixedarith/maddhdu.mdwn b/openpower/isa/fixedarith/maddhdu.mdwn
new file mode 100644 (file)
index 0000000..5751fb7
--- /dev/null
@@ -0,0 +1,13 @@
+# Multiply-Add High Doubleword Unsigned
+
+VA-Form
+
+* maddhdu RT,RA,RB,RC
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/maddhdu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/maddhdu_code.mdwn b/openpower/isa/fixedarith/maddhdu_code.mdwn
new file mode 100644 (file)
index 0000000..7823e09
--- /dev/null
@@ -0,0 +1,3 @@
+    prod[0:(XLEN*2)-1] <- (RA) * (RB)
+    sum[0:(XLEN*2)-1] <- prod + EXTZ(RC)
+    RT <- sum[0:XLEN-1]
diff --git a/openpower/isa/fixedarith/maddld.mdwn b/openpower/isa/fixedarith/maddld.mdwn
new file mode 100644 (file)
index 0000000..02c702b
--- /dev/null
@@ -0,0 +1,13 @@
+# Multiply-Add Low Doubleword
+
+VA-Form
+
+* maddld RT,RA,RB,RC
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/maddld_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/maddld_code.mdwn b/openpower/isa/fixedarith/maddld_code.mdwn
new file mode 100644 (file)
index 0000000..ee52c73
--- /dev/null
@@ -0,0 +1,3 @@
+    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
+    sum[0:(XLEN*2)-1] <- prod + EXTS(RC)
+    RT <- sum[XLEN:(XLEN*2)-1]
diff --git a/openpower/isa/fixedarith/modsd.mdwn b/openpower/isa/fixedarith/modsd.mdwn
new file mode 100644 (file)
index 0000000..1d38d33
--- /dev/null
@@ -0,0 +1,13 @@
+# Modulo Signed Doubleword
+
+X-Form
+
+* modsd RT,RA,RB
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/modsd_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/modsd_code.mdwn b/openpower/isa/fixedarith/modsd_code.mdwn
new file mode 100644 (file)
index 0000000..944d430
--- /dev/null
@@ -0,0 +1,10 @@
+    dividend <- (RA)
+    divisor <- (RB)
+    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
+         (divisor = [1]*XLEN)) |
+         (divisor = [0]*XLEN)) then
+        RT[0:63] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT <- MODS(dividend, divisor)
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/modsw.mdwn b/openpower/isa/fixedarith/modsw.mdwn
new file mode 100644 (file)
index 0000000..2bcdbf1
--- /dev/null
@@ -0,0 +1,13 @@
+# Modulo Signed Word
+
+X-Form
+
+* modsw RT,RA,RB
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/modsw_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/modsw_code.mdwn b/openpower/isa/fixedarith/modsw_code.mdwn
new file mode 100644 (file)
index 0000000..6b935bf
--- /dev/null
@@ -0,0 +1,11 @@
+    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
+    divisor[0:(XLEN/2)-1] <- (RB)[XLEN/2:XLEN-1]
+    if (((dividend = (0b1 || ([0b0] * ((XLEN/2)-1)))) &
+         (divisor = [1]*(XLEN/2))) |
+         (divisor = [0]*(XLEN/2))) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT[0:XLEN-1] <- EXTS64(MODS(dividend, divisor))
+        RT[0:(XLEN/2)-1] <- undefined(RT[0:(XLEN/2)-1])
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/modud.mdwn b/openpower/isa/fixedarith/modud.mdwn
new file mode 100644 (file)
index 0000000..11e6464
--- /dev/null
@@ -0,0 +1,15 @@
+# Modulo Unsigned Doubleword
+
+X-Form
+
+* modud RT,RA,RB
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/modud_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
+
+<!-- Checked March 2021 -->
diff --git a/openpower/isa/fixedarith/modud_code.mdwn b/openpower/isa/fixedarith/modud_code.mdwn
new file mode 100644 (file)
index 0000000..86f74f4
--- /dev/null
@@ -0,0 +1,8 @@
+    dividend <- (RA)
+    divisor <- (RB)
+    if (divisor = [0]*XLEN) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
+        overflow <- 1
+    else
+        RT <- dividend % divisor
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/moduw.mdwn b/openpower/isa/fixedarith/moduw.mdwn
new file mode 100644 (file)
index 0000000..9c7c712
--- /dev/null
@@ -0,0 +1,13 @@
+# Modulo Unsigned Word
+
+X-Form
+
+* moduw RT,RA,RB
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/moduw_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/moduw_code.mdwn b/openpower/isa/fixedarith/moduw_code.mdwn
new file mode 100644 (file)
index 0000000..26c75a4
--- /dev/null
@@ -0,0 +1,9 @@
+    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:63]
+    divisor [0:(XLEN/2)-1] <- (RB)[XLEN/2:63]
+    if divisor = [0]*(XLEN/2) then
+        RT[0:XLEN-1] <- undefined([0]*64)
+        overflow <- 1
+    else
+        RT[XLEN/2:XLEN-1] <- dividend % divisor
+        RT[0:(XLEN/2)-1] <- undefined([0]*(XLEN/2))
+        overflow <- 0
diff --git a/openpower/isa/fixedarith/mulhd.mdwn b/openpower/isa/fixedarith/mulhd.mdwn
new file mode 100644 (file)
index 0000000..7882250
--- /dev/null
@@ -0,0 +1,14 @@
+# Multiply High Doubleword
+
+XO-Form
+
+* mulhd RT,RA,RB (Rc=0)
+* mulhd.  RT,RA,RB (Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulhd_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
diff --git a/openpower/isa/fixedarith/mulhd_code.mdwn b/openpower/isa/fixedarith/mulhd_code.mdwn
new file mode 100644 (file)
index 0000000..69d287c
--- /dev/null
@@ -0,0 +1,2 @@
+    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
+    RT <- prod[0:XLEN-1]
diff --git a/openpower/isa/fixedarith/mulhdu.mdwn b/openpower/isa/fixedarith/mulhdu.mdwn
new file mode 100644 (file)
index 0000000..98f81c5
--- /dev/null
@@ -0,0 +1,14 @@
+# Multiply High Doubleword Unsigned
+
+XO-Form
+
+* mulhdu RT,RA,RB (Rc=0)
+* mulhdu.  RT,RA,RB (Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulhdu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
diff --git a/openpower/isa/fixedarith/mulhdu_code.mdwn b/openpower/isa/fixedarith/mulhdu_code.mdwn
new file mode 100644 (file)
index 0000000..d455f52
--- /dev/null
@@ -0,0 +1,2 @@
+    prod[0:(XLEN*2)-1] <- (RA) * (RB)
+    RT <- prod[0:XLEN-1]
diff --git a/openpower/isa/fixedarith/mulhw.mdwn b/openpower/isa/fixedarith/mulhw.mdwn
new file mode 100644 (file)
index 0000000..05d01b9
--- /dev/null
@@ -0,0 +1,14 @@
+# Multiply High Word
+
+XO-Form
+
+* mulhw RT,RA,RB (Rc=0)
+* mulhw.  RT,RA,RB (Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulhw_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
diff --git a/openpower/isa/fixedarith/mulhw_code.mdwn b/openpower/isa/fixedarith/mulhw_code.mdwn
new file mode 100644 (file)
index 0000000..ec4384f
--- /dev/null
@@ -0,0 +1,3 @@
+    prod[0:XLEN-1] <- MULS((RA)[XLEN/2:XLEN-1], (RB)[XLEN/2:XLEN-1])
+    RT[XLEN/2:XLEN-1] <- prod[0:(XLEN/2)-1]
+    RT[0:(XLEN/2)-1] <- undefined(prod[0:(XLEN/2)-1])
diff --git a/openpower/isa/fixedarith/mulhwu.mdwn b/openpower/isa/fixedarith/mulhwu.mdwn
new file mode 100644 (file)
index 0000000..709b5fc
--- /dev/null
@@ -0,0 +1,14 @@
+# Multiply High Word Unsigned
+
+XO-Form
+
+* mulhwu RT,RA,RB (Rc=0)
+* mulhwu.  RT,RA,RB (Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulhwu_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)
diff --git a/openpower/isa/fixedarith/mulhwu_code.mdwn b/openpower/isa/fixedarith/mulhwu_code.mdwn
new file mode 100644 (file)
index 0000000..227c0b2
--- /dev/null
@@ -0,0 +1,3 @@
+    prod[0:XLEN-1] <- (RA)[XLEN/2:XLEN-1] * (RB)[XLEN/2:XLEN-1]
+    RT[XLEN/2:XLEN-1] <- prod[0:(XLEN/2)-1]
+    RT[0:(XLEN/2)-1] <- undefined(prod[0:(XLEN/2)-1])
diff --git a/openpower/isa/fixedarith/mulld.mdwn b/openpower/isa/fixedarith/mulld.mdwn
new file mode 100644 (file)
index 0000000..3b8b57b
--- /dev/null
@@ -0,0 +1,17 @@
+# Multiply Low Doubleword
+
+XO-Form
+
+* mulld RT,RA,RB (OE=0 Rc=0)
+* mulld.  RT,RA,RB (OE=0 Rc=1)
+* mulldo RT,RA,RB (OE=1 Rc=0)
+* mulldo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulld_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/mulld_code.mdwn b/openpower/isa/fixedarith/mulld_code.mdwn
new file mode 100644 (file)
index 0000000..2a3ebeb
--- /dev/null
@@ -0,0 +1,4 @@
+    prod[0:(XLEN*2)-1] <- MULS((RA), (RB))
+    RT <- prod[XLEN:(XLEN*2)-1]
+    overflow <- ((prod[0:XLEN] != [0]*(XLEN+1)) &
+                 (prod[0:XLEN] != [1]*(XLEN+1)))
diff --git a/openpower/isa/fixedarith/mulli.mdwn b/openpower/isa/fixedarith/mulli.mdwn
new file mode 100644 (file)
index 0000000..765f46b
--- /dev/null
@@ -0,0 +1,13 @@
+# Multiply Low Immediate
+
+D-Form
+
+* mulli RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mulli_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/fixedarith/mulli_code.mdwn b/openpower/isa/fixedarith/mulli_code.mdwn
new file mode 100644 (file)
index 0000000..5db27b8
--- /dev/null
@@ -0,0 +1,2 @@
+    prod[0:(XLEN*2)-1] <- MULS((RA), EXTS(SI))
+    RT <- prod[XLEN:(XLEN*2)-1]
diff --git a/openpower/isa/fixedarith/mullw.mdwn b/openpower/isa/fixedarith/mullw.mdwn
new file mode 100644 (file)
index 0000000..74ff59c
--- /dev/null
@@ -0,0 +1,17 @@
+# Multiply Low Word
+
+XO-Form
+
+* mullw RT,RA,RB (OE=0 Rc=0)
+* mullw.  RT,RA,RB (OE=0 Rc=1)
+* mullwo RT,RA,RB (OE=1 Rc=0)
+* mullwo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/mullw_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/mullw_code.mdwn b/openpower/isa/fixedarith/mullw_code.mdwn
new file mode 100644 (file)
index 0000000..8bcddcf
--- /dev/null
@@ -0,0 +1,4 @@
+    prod[0:XLEN-1] <- MULS((RA)[XLEN/2:XLEN-1], (RB)[XLEN/2:XLEN-1])
+    RT <- prod
+    overflow <- ((prod[0:XLEN/2] != [0]*((XLEN/2)+1)) &
+                 (prod[0:XLEN/2] != [1]*((XLEN/2)+1)))
diff --git a/openpower/isa/fixedarith/neg.mdwn b/openpower/isa/fixedarith/neg.mdwn
new file mode 100644 (file)
index 0000000..e71c279
--- /dev/null
@@ -0,0 +1,17 @@
+# Negate
+
+XO-Form
+
+* neg RT,RA (OE=0 Rc=0)
+* neg.  RT,RA (OE=0 Rc=1)
+* nego RT,RA (OE=1 Rc=0)
+* nego.  RT,RA (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/neg_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/neg_code.mdwn b/openpower/isa/fixedarith/neg_code.mdwn
new file mode 100644 (file)
index 0000000..99e7911
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + 1
diff --git a/openpower/isa/fixedarith/subf.mdwn b/openpower/isa/fixedarith/subf.mdwn
new file mode 100644 (file)
index 0000000..c286eb7
--- /dev/null
@@ -0,0 +1,17 @@
+# Subtract From
+
+XO-Form
+
+* subf RT,RA,RB (OE=0 Rc=0)
+* subf.  RT,RA,RB (OE=0 Rc=1)
+* subfo RT,RA,RB (OE=1 Rc=0)
+* subfo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subf_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/subf_code.mdwn b/openpower/isa/fixedarith/subf_code.mdwn
new file mode 100644 (file)
index 0000000..36749ef
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + (RB) + 1
diff --git a/openpower/isa/fixedarith/subfc.mdwn b/openpower/isa/fixedarith/subfc.mdwn
new file mode 100644 (file)
index 0000000..d6af11a
--- /dev/null
@@ -0,0 +1,18 @@
+# Subtract From Carrying
+
+XO-Form
+
+* subfc RT,RA,RB (OE=0 Rc=0)
+* subfc.  RT,RA,RB (OE=0 Rc=1)
+* subfco RT,RA,RB (OE=1 Rc=0)
+* subfco.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subfc_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/subfc_code.mdwn b/openpower/isa/fixedarith/subfc_code.mdwn
new file mode 100644 (file)
index 0000000..36749ef
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + (RB) + 1
diff --git a/openpower/isa/fixedarith/subfe.mdwn b/openpower/isa/fixedarith/subfe.mdwn
new file mode 100644 (file)
index 0000000..4347c1e
--- /dev/null
@@ -0,0 +1,18 @@
+# Subtract From Extended
+
+XO-Form
+
+* subfe RT,RA,RB (OE=0 Rc=0)
+* subfe.  RT,RA,RB (OE=0 Rc=1)
+* subfeo RT,RA,RB (OE=1 Rc=0)
+* subfeo.  RT,RA,RB (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subfe_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/subfe_code.mdwn b/openpower/isa/fixedarith/subfe_code.mdwn
new file mode 100644 (file)
index 0000000..0227b88
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + (RB) + CA
diff --git a/openpower/isa/fixedarith/subfic.mdwn b/openpower/isa/fixedarith/subfic.mdwn
new file mode 100644 (file)
index 0000000..7ba300e
--- /dev/null
@@ -0,0 +1,13 @@
+# Subtract From Immediate Carrying
+
+D-Form
+
+* subfic RT,RA,SI
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subfic_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
diff --git a/openpower/isa/fixedarith/subfic_code.mdwn b/openpower/isa/fixedarith/subfic_code.mdwn
new file mode 100644 (file)
index 0000000..a930d90
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + EXTS(SI) + 1
diff --git a/openpower/isa/fixedarith/subfme.mdwn b/openpower/isa/fixedarith/subfme.mdwn
new file mode 100644 (file)
index 0000000..4be0090
--- /dev/null
@@ -0,0 +1,18 @@
+# Subtract From Minus One Extended
+
+XO-Form
+
+* subfme RT,RA (OE=0 Rc=0)
+* subfme.  RT,RA (OE=0 Rc=1)
+* subfmeo RT,RA (OE=1 Rc=0)
+* subfmeo.  RT,RA (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subfme_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/subfme_code.mdwn b/openpower/isa/fixedarith/subfme_code.mdwn
new file mode 100644 (file)
index 0000000..46eaf19
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + CA - 1
diff --git a/openpower/isa/fixedarith/subfze.mdwn b/openpower/isa/fixedarith/subfze.mdwn
new file mode 100644 (file)
index 0000000..bb3c68c
--- /dev/null
@@ -0,0 +1,18 @@
+# Subtract From Zero Extended
+
+XO-Form
+
+* subfze RT,RA (OE=0 Rc=0)
+* subfze.  RT,RA (OE=0 Rc=1)
+* subfzeo RT,RA (OE=1 Rc=0)
+* subfzeo.  RT,RA (OE=1 Rc=1)
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/fixedarith/subfze_code" raw="yes"]]
+
+Special Registers Altered:
+
+    CA CA32
+    CR0                     (if Rc=1)
+    SO OV OV32             (if OE=1)
diff --git a/openpower/isa/fixedarith/subfze_code.mdwn b/openpower/isa/fixedarith/subfze_code.mdwn
new file mode 100644 (file)
index 0000000..158c16e
--- /dev/null
@@ -0,0 +1 @@
+    RT <- ¬(RA) + CA